Hello,
I am trying to get heikenashi close from 5 min to 1 min using timeframe set- restore method.
I want to get exact value of 5 min Heikenashi close at 1 minute candles close for backtesting.
But using expand first or last it is overriding the values of close to all the remaining candles.
Is there any way to get the HA close of the 5 min candle at the end of any 1 min candle covered in the same 5 min candle?
Unfortunately your question isn't clear enough and does not provide all necessary details to give you an answer. Please follow this advice: How to ask a good question
Did you read
https://www.amibroker.com/guide/h_timeframe.html
Where is the FORMULA that you wrote and tried?
Where is the SCREENSHOT showing what you see on screen?
here is the code .
`_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
//_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
//Plot( C, "Close",colorDefault, styleNoTitle | styleCandle | GetPriceStyle() );
_SECTION_END();
colorBullish = ParamColor("Color for bullish candle (Close > Open)", colorRGB(255, 255, 255));
colorBearish = ParamColor("Color for bearish candle (Close < Open)", colorRGB(255, 0, 255));
TimeFrameSet(in5Minute);
Haclose_1=(Open+High+Low+Close)/4;
HaOpen_1 = AMA( Ref( HaClose_1, -1 ), 0.5 );
HaHigh_1= Max( High, Max( HaClose_1, HaOpen_1 ) );
HaLow_1 = Min( Low, Min( HaClose_1, HaOpen_1 ) );
TimeFrameRestore();
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} HaOpen_1 %g, HaHigh_1 %g, HaLow_1 %g, Haclose_1 %g (%.1f%%) {{VALUES}}", HaOpen_1, HaHigh_1, HaLow_1, Haclose_1, SelectedValue( ROC( Haclose_1, 1 ) ) ));
PlotOHLC(HaOpen_1,HaHigh_1,HaLow_1,Haclose_1,"HEIKENASHI",color = IIf(Haclose_1>=HaOpen_1,colorbullish,colorbearish),styleNoTitle | styleCandle | GetPriceStyle() );
opentf11=TimeFrameExpand(HaOpen_1,in5Minute,expandFirst);
hightf11=TimeFrameExpand(HaHigh_1,in5Minute,expandFirst);
lowtf11=TimeFrameExpand(HaLow_1,in5Minute,expandFirst);
closetf11=TimeFrameExpand(Haclose_1,in5Minute,expandFirst);
Plot(closetf11,"ha_close",colorRed);
`
I tried almost all possible methods to get the exact close but it is not working.
This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.