Quote:
|
Originally Posted by dvarrin
Hi,
I would like to know if it is possible to get the data (tick price, close, high, low, indicators, ...) of an higher timeframe and use them in an expert advisor attached to a chart of a smaller timeframe.
For example, I would like to know how is the candlestick on the higher timeframe chart and use it as an entry point for the smaller timeframe chart.
I hope there is a solution :-)
Cheers,
Daniel
|
Pretty sure this is how you do it:
Lets say you want to use RSI, so you call it in your code.
vla=iRSI(NULL,0,14,PRICE_CLOSE,0);
The zero after null signifies current chart time frame.
If you want to read 4 hour time frame change to:
vla=iRSI(NULL,PERIOD_H4,14,PRICE_CLOSE,0);
Then attach to a lesser time frame chart.
You can use any of these values:
Constant Value Description
PERIOD_M1 = 1 minute.
PERIOD_M5 = 5 minutes.
PERIOD_M15 = 15 minutes.
PERIOD_M30 = 30 minutes.
PERIOD_H1 = 1 hour.
PERIOD_H4 = 4 hour.
PERIOD_D1 = Daily.
PERIOD_W1 = Weekly.
PERIOD_MN1 = Monthly.
0 (zero) = Time frame used on the chart.
Hope this helps.
