farrokhfa: I want to know how to get the closing price of 9th later bar.
You can't predict the future. You must wait until 9 periods pass and use Close[1].
If you want 'the closing price of 9th earlier bar' that's easy Close[9]
szgy74:
iClose: https://docs.mql4.com/series/iClose
iClose: https://docs.mql4.com/series/iClose
If I want to get closing price of 9th later bar I should write like this? :
Print("Current bar for USDCHF H1: " iClose("USDCHF",PERIOD_H1,9),";
farrokhfa:
The current bar is bar 0, the H1 bar an hour ago, in the past, is bar 1, the code you posted will give the close price for USDCHF H1 bar 9 hours ago, in the past.
If I want to get closing price of 9th later bar I should write like this? :
farrokhfa:
If I want to get closing price of 9th later bar I should write like this? :
Yes, or Close[9] for the current chart.
Print("Current bar for USDCHF H1: ", iClose("USDCHF",PERIOD_H1,9));
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
I want to know how to get the closing price of 9th later bar.
which function should I use?