the first part look about if it's sunday night
if( DayOfWeek ()==0 && Hour()>=22)
but then i should look about the last close order if it close on sunday open, ad es i have 3 order 2 pending and one at market with target 1.47
market on sunday open at 1.48 so the broker close me at 1.47!!!!
i want if this order is close that all the pending is cancelled
so i should look at date time
OrderSelect(OrdersHistoryTotal()-1, SELECT_BY_POS, MODE_HISTORY); if(OrderCloseTime() >= 22)
but this closetime 22 i know is wrong, so how i do that?
datetime give me a string like that
rightnow=Year()+"-"+Month()+"-"+Day()+" "+Hour()+":"+Minute()+":"+Seconds();
rightnow2=StrToTime(rightnow);
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
exemple
-on friday i have a long from 1.46 and a pending long from 1.4580 not filled yet and both have target at 1.47.
-on monday morning market open at 1.48 an my "great broker close my posistion at 1.47 but still remain one pending order,
so i want if on morning the first order go at target i automatic close all the other pending order how i can do that?
i write this few code but not work