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
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
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?