I want to know how to get the closing price of 9th later bar

szgy74
247
szgy74  
iClose: https://docs.mql4.com/series/iClose
William Roeder
25832
William Roeder  
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]

Farrokh Faghih
266
Farrokh Faghih  
szgy74:
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),";
Simon Gniadkowski
17410
farrokhfa:

If I want to get closing price of 9th later bar I should write like this? :

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.
szgy74
247
szgy74  
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));