jal_fr:
Hello,
I wonder if it is possible to retrieve the hours: minutes of a candle defined by its shift.
Hello,
I wonder if it is possible to retrieve the hours: minutes of a candle defined by its shift.
My indicator goes all the candles one by one, I would like him to back the opening date of the candle ..
Is there a function in MQL4 for this?
Thanks in advance.
How about this ...
datetime Time[] Series array that
contains open time of each bar of the current chart. Data like datetime
represent time, in seconds, that has passed since 00:00 a.m. of 1 January,
1970.Series array elements are indexed in the reverse order, i.e., from the last one to the first one. The current bar which is the last in the array is indexed as 0. The oldest bar, the first in the chart, is indexed as Bars-1. |
Hey, i found
|
jal_fr:
Hey, i found
Whilst you could use iTime(NULL,0,n) to refer to bar n on the current chart and the current timeframe, it is easier to just use Time[n]. Of course if you want a different symbol or a different timeframe then you do need to use iTime.
Hey, i found
|
jal_fr:
I wonder if it is possible to retrieve the hours: minutes of a candle defined by its shift.
I wonder if it is possible to retrieve the hours: minutes of a candle defined by its shift.
int shift = ...; datetime Tshift = Time[shift]; Print( "A shift of ", shift, " corresponds to ", TimeToStr(Tshift, TIME_MINUTES|TIME_SECONDS) ); Print( "A shift of ", shift, " corresponds to Hour=", TimeHour(Tshift), " minute=", TimeMinute(Tshift) );
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 wonder if it is possible to retrieve the hours: minutes of a candle defined by its shift.
My indicator goes all the candles one by one, I would like him to back the opening date of the candle ..
Is there a function in MQL4 for this?
Thanks in advance.