Hi all

this is a very simple code  i have copied from AFL Library.
The graphes and the prints are corrects, but the exploration  (Filter = Y0 < 
Y1)  does not work correctly.
can Somebody  show me the error ?
Thank's and best regards

GraphXSpace = 8;
SetChartOptions(0, chartShowDates);
Plot(C, "C", colorBlack, styleCandle); 
Percent = Param("Percent", 4, 0, 10, 0.5);
LookBack = 60;
X = Cum(1);
Price = C;
PR1 = PeakBars(Price, Percent, 1)==0;
X0 = LastValue(ValueWhen(PR1, X, 2));
X1 = LastValue(ValueWhen(PR1, X, 1));
Y0 = LastValue(ValueWhen(PR1, Price, 2));
Y1 = LastValue(ValueWhen(PR1, Price, 1));
PlotShapes(IIf(X == X0, shapeDigit1, shapeNone), colorRed, 0, H, 12);
PlotShapes(IIf(X == X1, shapeDigit2, shapeNone), colorBlue, 0, H, 12);
Line = LineArray(X0-1, Y0, X1-1, Y1);
Plot(Line, "Line1", colorRed, styleLine|styleThick, 1);Filter = Y0 < Y1;
AddColumn(Y0, "Y0", 1.3);
AddColumn(Y1, "Y1", 1.3);Title = Name() + " - " + Date() + " - Price = " + 
Price +
" - Barindex = " + BarIndex() + " - Barcount = " + BarCount +

"\nX0 = " + X0 + " - Y0 = " + Y0;

Reply via email to