Experts: Flat Channel - page 2

 
refounder83:

Can you tell me if time control does not work in this EA? There are lines in the TimeControl procedure

i.e. if the value of InpTimeControl is false, it returns true to the TimeControl procedure?

I recommend using a more advanced TimeControl procedure:

Input parameters for it:

input bool     InpTimeControl    = true;     // Use time control
input uchar    InpStartHour      = 10;       // Start hour
input uchar    InpEndHour        = 15;       // End hour

The procedure itself (can be set from morning to evening, or from evening to morning - i.e. with a day transition)

//+------------------------------------------------------------------+
//| TimeControl|
//+------------------------------------------------------------------+
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) // intraday time interval
     {
/*
Example:
input uchar InpStartHour = 5;// Start hour
input uchar InpEndHour = 10; // End hour
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) // time interval with the transition in a day
     {
/*
Example:
input uchar InpStartHour = 10; // Start hour
input ucharInpEndHour = 5;// End hour
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);
  }
 
And so yes, if the"Use time control" parameter is set as"false" - that is, the time interval is disabled at all, then the bool TimeControl(void) procedure will always return "true". That is, it simply does not participate and does not interfere with the process of receiving signals.
[Deleted]  
Hello bladimir it does not allow to place or the ea only works in assets of 0.01 and 0.10 the broker that I use which is deriv and there are volatilitys assets does not work the ea is a good ea but it does not work in that broker it only works in the step index asset that allows 0.10 the other assets the broker allows from 0.001 0.002 0.003 0.004