自定义符号。误差、错误、问题、建议。 - 页 22

 
Artyom Trishkin :
用英语写比用习俗符号写更好 :)
这些是--自定义字符的意思吗?而且没有在他们身上添加任何虱子?

是的,没有添加TAKE TICKS。我不明白其中的原因。我在看时间。那是正确的。

 
jaffer wilson:

是的,税票没有被添加。我不明白其中的原因。我在看时间。这是正确的做法。

@fxsaber对这些事情很熟悉。我在这里对你没有帮助。
斯拉瓦什么都知道,但他是个大忙人,不一定有时间来提示。
 
Artyom Trishkin:
@fxsaber很了解这些问题。我在这里不是你的帮手。
斯拉瓦什么都知道,但他是个大忙人,并不总是有时间提供建议。

第一个问题是关于GetLastError 和终端的日志以及专家的问题。

 
Slava:

第一个问题是关于GetLastError和终端日志和专家的问题。

我一直得到这个消息。

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 

请检查。

 
jaffer wilson:

我一直得到这个消息。

请检查。

5032的错误从何而来?

删除蜱虫后的自定义历史记录在哪里?

添加虱子的检查在哪里?在OnInit中添加了ticks后,形成了多少个历史条?

为什么在OnInit中使用CustomTicksAdd 而不是CustomTicksReplace?


PS。在MarketWatch中正确地接收到了ticks,但没有应用到历史图表中。想明白了。

 
Slava:

PS。在MarketWatch中,刻度线是正确的,但不适用于历史图表。想明白了。

所以这个分支里有相当数量的编号错误。

 

Slava:

PS。在MarketWatch中,刻度线是正确的,但不适用于历史图表。想明白了。

不适用,因为不是当今时代。实际上是6个月大

 
Slava :

不适用,因为不是当今时代。完全是六个月大。

我已经尝试了增加检查的方案。仍然有同样的问题。

#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

请让我知道该怎么做。

 

目前,不可能用今天以外的日子(昨天、前天、去年等)的刻度线形成自定义工具条。

但是。我们已经做了更正。

使用CustomTicksReplace 时(不是CustomTicksAdd!不要使用CustomTicksAdd来批量添加刻度线),如果之前没有今天的刻度线,那么最后一天添加的刻度线会变成 "当前"。

等到下一个版本。然后我们将继续进行实验和讨论

 
Slava :

目前,不可能用今天以外的日子(昨天、前天、去年等)的刻度线形成自定义工具条。

但是。我们已经做了更正。

当使用CustomTicksReplace时(不是CustomTicksAdd!不要使用CustomTicksAdd来批量添加刻度线),如果之前没有当前日的刻度线,那么最后一天添加的刻度线将成为 "当前"。

等到下一个版本。然后我们将继续进行实验和讨论

谢谢,斯拉瓦。我等着它。