EA: 扁平通道 - 页 2

 
refounder83:

您能告诉我时间控制在此 EA 中是否不起作用吗? 时间控制程序中有几行字

也就是说,如果 InpTimeControl 的值为 false,它是否会向 TimeControl 存储过程返回 true?

我建议使用更高级的 TimeControl 过程:

输入参数:

input bool     InpTimeControl    = true;     // 使用时间控制
input uchar    InpStartHour      = 10;       // 起始小时
input uchar    InpEndHour        = 15;       // 结束时间

存储过程本身(可以从早晨设置到傍晚,或从傍晚设置到早晨--即一天的转换)

//+------------------------------------------------------------------+
//| 时间控制|
//+------------------------------------------------------------------+
bool TimeControl(void)
  {
   if(!InpTimeControl)
      return(true);
   MqlDateTime STimeCurrent;
   datetime time_current=TimeCurrent();
   if(time_current==D'1970.01.01 00:00')
      return(false);
   TimeToStruct(time_current,STimeCurrent);
   if(InpStartHour<InpEndHour) // 盘中时间间隔
     {
/*
示例:
input uchar InpStartHour = 5;// 起始小时
input uchar InpEndHour = 10;// 结束小时
0 1 2 3 4 5 6 7 8 910 11 12 13 14 15 16 17 18 19 20 21 22 23 0 1 2 3 4 5 6 78 9 9 10 11 12 13 13 14 15
_ _ _ _ _ _ _ _ _ _ + + + ++ + + _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ _ _ _+ + + + _ _ _ _ _ _ _
*/
      if(STimeCurrent.hour>=InpStartHour && STimeCurrent.hour<InpEndHour)
         return(true);
     }
   else if(InpStartHour>InpEndHour) // 以天为单位的过渡时间间隔
     {
/*
示例:
输入 uchar InpStartHour = 10; // 起始小时
输入 ucharInpEndHour = 5;// 结束小时
0 1 2 3 4 5 6 7 8 910 11 12 13 14 15 16 17 18 19 20 21 22 23 0 1 2 3 4 5 6 78 9 9 10 11 11 12 13 13 14 15
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ _ + + + + + + + ++ + + + + + + + + + +_ _ _ _ _ _ _ _ _ + + + + + +
*/
      if(STimeCurrent.hour>=InpStartHour || STimeCurrent.hour<InpEndHour)
         return(true);
     }
   else
      return(false);
//---
   return(false);
  }
 
是的,如果"使用时间控制"参数设置为"false"(即完全禁用时间间隔),那么 bool TimeControl(void) 程序将始终返回 "true"。也就是说,它根本不会参与和干扰信号接收过程。
[删除]  
您好 Bladimir,它不允许放置 或 EA 只适用于 0.01 和 0.10 的资产,我使用的经纪商是 deriv,有波动的资产不工作的 EA 是一个很好的 EA,但它不工作的经纪人,它只适用于步进指数资产,允许 0.10 的其他资产的经纪人允许从 0.001 0.002 0.003 0.004