string start = "06:00"; string finish = "12:00"; datetime curT = TimeCurrent(); datetime s_time = StringToTime( TimeToString( curT, TIME_DATE ) + " " + start ); datetime f_time = StringToTime( TimeToString( curT, TIME_DATE ) + " " + finish ); if ( curT < s_time ) { return; } //--wait till time is ok to open if ( curT >= f_time ) { CloseAll(); return; } //--close all if finish time reached //--do the job here
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
Hi
I want to add to my EA option of stopping and starting by time . I mean :
1 . start time of trading
2. stop time of trading
3. closing all open positions at stop time (never mind win or loss )
thanks