Custom symbols. Errors, bugs, questions, suggestions. - page 22

 
Artyom Trishkin :
Better to write in English than about customs symbols :)
Are these - custom characters meant? And no ticks are added to them?

Yes. TAKE TICKS are not added. I don't understand the reason. I'm checking the time. That was correct.

 
jaffer wilson:

Yes. TAX TICKETS have not been added. I don't understand the reason. I'm checking the time. It was the right thing to do.

@fxsaber is well versed in these matters. I am no help to you here.
Slava knows everything, but he is a busy man and there is not always time to prompt.
 
Artyom Trishkin:
@fxsaber knows these questions well. I am not your helper here.
Slava knows everything, but he is a busy man and does not always have time to advise.

The very first question will be about GetLastError and logs of the terminal and experts

 
Slava:

The very first question will be about GetLastError and terminal logs and experts

I keep getting this:

TestIndciatorTicks (EURUSD,M1)   2019.02 . 01 23 : 30 : 03 
TestIndciatorTicks (EURUSD,M1)   1 
TestIndciatorTicks (EURUSD,M1)   0 
TestIndciatorTicks (EURUSD,M1)   2019.02 . 01 23 : 30 : 04 
TestIndciatorTicks (EURUSD,M1)   1 
TestIndciatorTicks (EURUSD,M1)   0 
TestIndciatorTicks (EURUSD,M1)   2019.02 . 01 23 : 30 : 05 
TestIndciatorTicks (EURUSD,M1)   1 
TestIndciatorTicks (EURUSD,M1)   0 
TestIndciatorTicks (EURUSD,M1)   2019.02 . 01 23 : 30 : 06 
TestIndciatorTicks (EURUSD,M1)   1 
TestIndciatorTicks (EURUSD,M1)   0 
TestIndciatorTicks (EURUSD,M1)   2019.02 . 01 23 : 30 : 07 
TestIndciatorTicks (EURUSD,M1)   1 
TestIndciatorTicks (EURUSD,M1)   0 
TestIndciatorTicks (EURUSD,M1)   2019.02 . 01 23 : 30 : 08 
TestIndciatorTicks (EURUSD,M1)   1 
TestIndciatorTicks (EURUSD,M1)   0 
TestIndciatorTicks (EURUSD,M1)   2019.02 . 01 23 : 30 : 09 
TestIndciatorTicks (EURUSD,M1)   1 
TestIndciatorTicks (EURUSD,M1)   0 
TestIndciatorTicks (EURUSD,M1)   2019.02 . 01 23 : 31 : 00 
TestIndciatorTicks (EURUSD,M1)   1 
TestIndciatorTicks (EURUSD,M1)   5032 
TestIndciatorTicks (EURUSD,M1)   2019.02 . 01 23 : 31 : 01 
TestIndciatorTicks (EURUSD,M1)   1 
TestIndciatorTicks (EURUSD,M1)   0 
TestIndciatorTicks (EURUSD,M1)   2019.02 . 01 23 : 31 : 02 
TestIndciatorTicks (EURUSD,M1)   1 
TestIndciatorTicks (EURUSD,M1)   0 
TestIndciatorTicks (EURUSD,M1)   2019.02 . 01 23 : 31 : 03 
TestIndciatorTicks (EURUSD,M1)   1 
TestIndciatorTicks (EURUSD,M1)   0 
TestIndciatorTicks (EURUSD,M1)   2019.02 . 01 23 : 31 : 04 
TestIndciatorTicks (EURUSD,M1)   1 
TestIndciatorTicks (EURUSD,M1)   0 
TestIndciatorTicks (EURUSD,M1)   2019.02 . 01 23 : 31 : 05 
TestIndciatorTicks (EURUSD,M1)   1 
TestIndciatorTicks (EURUSD,M1)   0 
TestIndciatorTicks (EURUSD,M1)   2019.02 . 01 23 : 31 : 06 
TestIndciatorTicks (EURUSD,M1)   1 
TestIndciatorTicks (EURUSD,M1)   0 
TestIndciatorTicks (EURUSD,M1)   2019.02 . 01 23 : 31 : 07 
TestIndciatorTicks (EURUSD,M1)   1 
TestIndciatorTicks (EURUSD,M1)   0 
TestIndciatorTicks (EURUSD,M1)   2019.02 . 01 23 : 31 : 08 
TestIndciatorTicks (EURUSD,M1)   1 
TestIndciatorTicks (EURUSD,M1)   0 
TestIndciatorTicks (EURUSD,M1)   2019.02 . 01 23 : 31 : 09 
TestIndciatorTicks (EURUSD,M1)   1 
TestIndciatorTicks (EURUSD,M1)   0 
TestIndciatorTicks (EURUSD,M1)   2019.02 . 01 23 : 32 : 00 
TestIndciatorTicks (EURUSD,M1)   1 
TestIndciatorTicks (EURUSD,M1)   5032 

Please check.

 
jaffer wilson:

I keep getting this:

Please check.

Where did the 5032 error come from?

Where is the deletion of the custom history after deleting ticks?

Where are the checks for adding ticks? How many history bars formed after adding ticks to OnInit?

Why is CustomTicksAdd used in OnInit instead of CustomTicksReplace?


PS. The ticks are correctly received in MarketWatch, but not applied to the history chart. Figuring it out.

 
Slava:

PS. Ticks are correct in MarketWatch, but do not apply to the historical chart. Figuring it out.

So there's a decent amount of numbered bugs in this branch.

 

Slava:

PS. Ticks are correct in MarketWatch, but do not apply to the historical chart. Figuring it out.

Not applied because not current day. Actually six months old

 
Slava :

Not applied because not current day. Six months old at all.

I have tried the programme with the added checks. Still have the same problem.

#property  indicator_chart_window
#property  indicator_buffers  1
#property  indicator_plots  1
#include  <Symbol.mqh>
input  datetime start_date = D'2019.10.7 00:00:00 ' ;
input  int Chops = 10 ;
int data_filled = 0 ;
string symbol_custom = StringFormat("% s_% dsec", _Symbol, Chops);
long chart_id =0 ;
datetime start;
void  OnInit()
  {
   ResetLastError();
// CustomSymbolDelete (symbol_custom);
   start = start_date- 60 ;
   Print("Ticks History Deleted:", CustomTicksDelete(symbol_custom, 0, LONG_MAX));
   data_filled = 0 ;

   const SYMBOL SYMB(symbol_custom);
   SYMB.CloneProperties(_Symbol);
   SYMB.On();
   MqlTick ticks_add [];
   int len = CopyTicksRange(_Symbol, ticks_add, COPY_TICKS_INFO, ulong(start_date) * 1000, ulong(TimeCurrent()) * 1000);
   Print("Ticks:", len);
   start = start - (len * 60);
   Print("Start Date:", start);
   for(int i = 0 ; i <len &&! IsStopped(); i ++)
     {
      if(data_filled% Chops == 0)
        {
         start = start + 60 ;
         start = datetime(TimeToString(start, TIME_DATE) + "" + TimeToString(start, TIME_MINUTES) + ": 00");
        }
      else
        {
         start ++;
        }
      ticks_add [i] .time = start;
      ticks_add [i] .time_msc = long (ticks_add [i] .time) * 1000 ;
      data_filled ++;
     }
   if(SYMB.CloneTicks(ticks_add)<1)
     {
      Print("Ticks cannot be replaced : ",GetLastError());
      if(CustomTicksAdd(symbol_custom, ticks_add)<1)
        {
         Print("Ticks Cannot be added : ",GetLastError());
        }
     }

   chart_id = ChartOpen(symbol_custom, _Period);
   Print(GetLastError());
   ResetLastError();
  }
void  OnDeinit(const  int r)
  {
   if(chart_id!= 0)
     {
      ChartClose(chart_id);
     }
   return ;
  }
// + ----------------------------------------------- ------------------- +
// + --------------------------- --------------------------------------- +
// | Custom indicator iteration function |
// + ----------------------------------------------- ------------------- +
int  OnCalculate(const  int rates_total,
                 const  int prev_calculated,
                 const  datetime & time [],
                 const  double & open [],
                 const  double & high [],
                 const  double & low [],
                 const  double & close [],
                 const  long & tick_volume [],
                 const  long & volume [],
                 const  int & spread [])
  {
   if(rates_total <= 0)
      return  0 ;
   MqlTick ticks [ 1 ];
   CopyTicks(_Symbol, ticks, COPY_TICKS_INFO, ulong(TimeCurrent()) * 1000, 1);
   if(data_filled% Chops == 0)
     {
      start = start + 60 ;
      start = datetime(TimeToString(start, TIME_DATE) + "" + TimeToString(start, TIME_MINUTES) + ": 00");
     }
   else
     {
      start ++;
     }
   Print(start,"  ",rates_total);
   ticks [ 0 ] .time = start;
   ticks [ 0 ] .time_msc = long (start) * 1000 ;
   data_filled ++;

   if(CustomTicksAdd(symbol_custom, ticks)<1)
     {
      Print("Tick not added : ", GetLastError());
     }
   return (rates_total);
  }
//+------------------------------------------------------------------+

TestIndciatorTicks (EURUSD,M1)  Ticks History Deleted:0
TestIndciatorTicks (EURUSD,M1)  Ticks:34877
TestIndciatorTicks (EURUSD,M1)  Start Date:2019.09.19 18:42:00
TestIndciatorTicks (EURUSD,M1)  Ticks cannot be replaced : 0
TestIndciatorTicks (EURUSD,M1)  Ticks Cannot be added : 5310
TestIndciatorTicks (EURUSD,M1)  5310
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:50:07  7468145
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:50:08  7468145
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:50:09  7468145
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:51:00  7468145
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:51:01  7468145
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:51:02  7468146
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:51:03  7468146
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:51:04  7468146
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:51:05  7468146
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:51:06  7468146
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:51:07  7468146
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:51:08  7468146
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:51:09  7468146
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:52:00  7468146
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:52:01  7468146
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:52:02  7468146
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:52:03  7468146
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:52:04  7468146
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:52:05  7468146
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:52:06  7468146
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:52:07  7468146
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:52:08  7468146
TestIndciatorTicks (EURUSD,M1)  2019.09.01 23:52:09  7468146

Please let me know what to do.

 

At the moment, it is not possible to form custom tool bars with ticks from a day not today (yesterday, the day before, last year etc.).

But. We have made a correction.

When using CustomTicksReplace (not CustomTicksAdd! do not use CustomTicksAdd to add ticks in bulk), the last day of added ticks becomes "current" if there were no ticks for today before that.

Wait for the next build. Then we'll continue experiments and discussions

 
Slava :

At the moment, it is not possible to form custom tool bars with ticks from a day not today (yesterday, the day before, last year etc.).

But. We have made a correction.

When using CustomTicksReplace (not CustomTicksAdd! don't use CustomTicksAdd to add ticks in bulk), the last day of added ticks becomes "current" if there were no ticks for the current day before that.

Wait for the next build. Then we'll continue experiments and discussions

Thanks, Slava. I'll wait for it.