AFL to draw line at high and close

sr114

Well-Known Member
#23
I have posted Pivot points above yours one..

But i want afl ploted for previous days and current day also (Not single day).

Thanx you
SHruti

do 1 thing - remove the part of the code

iif(Today == day(), part and u will get the plot of pivot for today and earlier day also

Plot(IIf(Today == Day(),PP,Null), "PP",colorGold,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
delete the colord part of the code

rgds
subroto
 
#24
Will anybody here help in writing an afl for weekly and monthly pivots plotting for the present week and month only just like daily pivots plotted for the present day.

thanks
 
#25
josh1

You did not even notice the actual fault. It was plotting wrong H L. Anyway here is the simple and corrected version of the code.

Code:
Plot (SelectedValue(TimeFrameGetPrice("H", inDaily, 1, expandLast)), "Prev H", IIf(abs(BarIndex() - SelectedValue(BarIndex())) > 5, GetChartBkColor(), colorGreen));
Plot (SelectedValue(TimeFrameGetPrice("L", inDaily, 1, expandLast)), "Prev L", IIf(abs(BarIndex() - SelectedValue(BarIndex())) > 5, GetChartBkColor(), colorOrange));
Thanks that was great code. I have been searching for something simple like this.

Now I modified it to use current Hi-Lo and brought it forward one layer.

But now I have two black bars that extend backwards from the coloured Hi-Lo lines... Any suggestion how to fix that?

This is the modified code...
Code:
_SECTION_BEGIN("Hi-Lo Lines");
Plot (SelectedValue(TimeFrameGetPrice("H", inDaily, 0, expandLast)), "Hi", IIf(abs(BarIndex() - SelectedValue(BarIndex())) > 5, GetChartBkColor(), colorYellow ), styleThick | styleNoTitle, Null, Null, 0, 1, 2 ); // last param is line width as percent of bar);
Plot (SelectedValue(TimeFrameGetPrice("L", inDaily, 0, expandLast)), "Lo", IIf(abs(BarIndex() - SelectedValue(BarIndex())) > 5, GetChartBkColor(), colorYellow ), styleThick | styleNoTitle, Null, Null, 0, 1, 2 ); // last param is line width as percent of bar);
// change 0 above to 1 for previous Hi/Lo
_SECTION_END();
 

Similar threads