Hi please help ive read a few articles relating to orders ect. but what i need is to know how many bars (timeframes) away was the last order
i need to do this so that i can identify what the bar index is of the last order placed and is still open. Thgis is so i can loop through the bars since the last order still open.
Thanks in advance
See iBarShift in this article (pt.18). Use the open time of your last order as time parameter.
Sorry to be Dumb here but how do i get the order time from my last order please?
How do you place your orders ? Simply set a datetime variable with the time you placed your order.
Hi thanks for this but i keep getting
'iBarShift' - function not defined
code
long create_time_msc=PositionGetInteger(POSITION_TIME_MSC);
int shift=iBarShift(_Symbol,PERIOD_M15,create_time_msc,false);

- www.mql5.com
Hi thanks for this but i keep getting
'iBarShift' - function not defined
code
long create_time_msc=PositionGetInteger(POSITION_TIME_MSC);
int shift=iBarShift(_Symbol,PERIOD_M15,create_time_msc,false);
iBarShift is a MQL4 function, did you include the code that implement this function for MQL5 to your code ?
Thanks i have it cured now thanks a lot for your help

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi please help ive read a few articles relating to orders ect. but what i need is to know how many bars (timeframes) away was the last order
i need to do this so that i can identify what the bar index is of the last order placed and is still open. Thgis is so i can loop through the bars since the last order still open.
Thanks in advance