Hi, I have a seemingly simple problem that unfortunately has bugged me for quite sometime.
I am trying to make a simple modification of the advanced trendline AFL (http://www.amibroker.com/library/detail.php?id=926&hilite=LineArray) so that it can adjust the "percentage" by itself. So, instead of the original : Percentage = Param("Percentage", 0.08, 0.01, 100. ,0.01); I try to change it to: Percentage = IIf(ADX(14)>20, 0.4, 0.7); Unfortunately this doesn't work. I get error when it tries to calculate x0, x1, y0, y1 (please see below). Would any kind soul be able to tell me where the mistake is ? Percentage = IIf(ADX(14)>20, 0.03, 0.08); Lines = Param("Lines?", 1, 1, BarCount-2); ...[snip] Plot(Main, "", IIf(C>O,colorGreen, colorRed), styleBar); if(DrawAllLines) for(i = 2; i<=Lines+1; i++) { if(DrawS!="Off") { x0 = GetXSupport(Support1, Percentage, i); x1 = GetXSupport(Support2, Percentage, i-1); y0 = GetYSupport(Support1, Percentage, i); y1 = GetYSupport(Support2, Percentage, i-1); x = LineArray(x0, y0, x1, y1, 1); if(!Method) Con = (IsTD_Demand(x0) AND IsTD_Demand(x1)); if(AllOrUpS) ConS = y0 < y1; if(Con AND ConS) Plot(x, "TD1", colorLightBlue, styleLine|styleThick); xa = Study("xa", GetChartID()); } ...[snip]
