-
Play videoPlease edit your post.
For large amounts of code, attach it.
- Check your return codes (OrderSend) and find out why. What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
if (Hour()>StartHour)&&(Hour()<EndHour)) //Is the same as if (Hour()>StartHour) &&(Hour()<EndHour))
Sort out your () brackets as they are not correctly placed. Does your code even compile?
if((Hour()>StartHour && Hour()<EndHour)
|| (Hour()==StartHour && Minute()>=StartMinute)
|| (Hour()==EndHour && Minute()<EndMinute))
is better. Your code does not take into account if the session period passes through midnight
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
hello, if i have to link Trader's choice of Time to trade with OrderSend in EA using the following
code:
TIME:
bool TradeTime=false;
if (Hour()>StartHour)&&(Hour()<EndHour))
|| (Hour()==StartHour&&Minute()>=StartMinute)
|| (Hour()==EndHour&&Minute()<EndMinute)
)
TradeTime=true;
[ORDERSEND].
int ms = GetTickCount ();
tick = OrderSend (Symbol (), dir, lots, price, use_slp, use_sl, use_tp, "", magic_number) ;
placing the following can the Traders Time be executed on EA.
(The trader has to select a specific time to trade.)
Still not getting the result. Pls any suggestions