TimeStart Code??

 

Hi there,


I am trying to learn the coding of MetaEditor4.

I have an EA from my friend and I am trying to learn each lines one by one.

Currently EA doesn't place as many trades as it did, and I found the reason was because of TimeStart code in OrderSend, below is the relevant coding of the packet:

On top:

extern int TimeStart = 0;
extern bool No_Open = false;
bool EntryLimit = false; 
int i, ticket;

Body:

if(No_Open == false && Hour() == TimeStart && EntryLimit == false)
     {
      ticket=OrderSend(Symbol(),OP_BUY,LotsOpt(),Ask,10,0,0,"abc",Magic+1,0,Blue);
     }

I found if I remove "Hour() == TimeStart", EA starts to place many trade as it used to. But if I leave it there it doesn't.


I want to know what is the reasoning behind this TimeStart code? Is this to set a time to trade?

If so, why it puts on top as TimeStart=0? Shouldn't it specify a time range?


I tried to search what TimeStart do on Google with no luck. Can anyone help to explain what this TimeStart do?

 
Sorry I think I posted on wrong forum.. and it says I cannot create another post in next 6 hours..
 
It means the EA will trade only when the Hour is equal to 0.
 

The variable TimeStart is set to 0

So when the mql4 instruction Hour() is equal to  0 , the boolean operation   

Hour() == TimeStart 

becomes TRUE 

---------------

And Hour() is equal to 0 only at 12 am i.e. every new opening Day 

Hour - Date and Time - MQL4 Reference
Hour - Date and Time - MQL4 Reference
  • docs.mql4.com
Hour - Date and Time - MQL4 Reference
 
paul selvan: 0 only at 12 am i.e. every new opening Day 
Reason: