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:
extern int TimeStart = 0;
extern bool No_Open = false;
bool EntryLimit = false;
int i, ticket;
if(No_Open == false && Hour() == TimeStart && EntryLimit == false)
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?
The variable TimeStart is set to 0
So when the mql4 instruction Hour() is equal to 0 , the boolean operation
Hour() == TimeStart
And Hour() is equal to 0 only at 12 am i.e. every new opening Day
Brokers use a variety of timezones. Their local time (with or without DST,) GMT/UTC, GMT+2, NY+7.
Only with NY+7 does the broker's 00:00 equals 5pm ET and the start of a daily bar (and H4) is the start of a new
GMT brokers, means there is a 1 or 2 hour D1/H4 bar on Sunday (depending on
NY DST,) and a short Friday bar.
GMT+2 is close but doesn't adjust for NY DST.
EET is closer except when their DST
doesn't match NY's. Last
Sunday of March and 1:00 on the last Sunday of October vs second Sunday in
March and return at 2:00 a.m. EDT to 1:00 a.m. EST on the first Sunday
Non-NY+7, means the chart daily
bar overlaps the start, and converting broker time to NY time requires broker to GMT to NY timezone conversions.