Hello everyone,
I am new to AFL and have been exploring it a bit..I'm trying to plot range high and low of the previous 4 days, but the problem is my code returns me the the results considering the current bar. I need to exclude the current bar from my range high/low and plot the lines exactly as they are now for the past N days. As per my current level of knowledge I have used HHV/LLV function. Any help would be much appreciated..
Here's my code - `/*
Objective:
- add chart settings
- add price
- consider range high and low of previous 4 days (excluding current bar)
- add lines to the highest and lowest points.
*/
_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", ParamColor("Color", colorDefault), styleThick | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("RHRL");
Plot(HHV(High,4), "RH", colorRed, styleLine);
Plot(LLV(Low,4), "RL", colorGreen, styleLine);
_SECTION_END();
And here's a screenshot -