how to check if current bar is 10 bars away from previous bar?
Documentation on MQL5: Timeseries and Indicators Access / iBarShift
- www.mql5.com
//| Script program start function | //
ok thanks. It works.
Datetime Previous_bar_Time = iTime(_Symbol,_Period,0); int Shift = iBarShift(NULL,0,SellFirstBeyondTime); if (Shift < 11 ) { //then do something }
static datetime Previous_bar_Time = iTime(_Symbol,PERIOD_CURRENT,0); if(iBarShift(_Symbol,PERIOD_CURRENT,Previous_bar_Time,true)<11) { //do something }
Mehrdad Jeddi:
Thanks
how to check if current bar is less than 10 bars away from previous bar?
I think the formula above is wrong, may I know what is the correct formula?