_SECTION_BEGIN("Trendlines Multitimeframe"); // Amibroker AFL code by Edward Pottasch, 6/8/2011 // Using fractals to create automatic trendlines // Using option to show multiple timeframes Version(5.21); xx=BarIndex();x=xx;Lx=LastValue(x); nbar=Param("N Pivot Bars",3,2,50,1); tf=Param("Time Frame (min)",5,1,100000,1);tfrm=in1Minute*tf; CleanPivots=ParamToggle("Use Clean Pivots","Off|On",0); PivotSymmetry=ParamToggle("Use Symmetric Pivots","Off|On",0); tld=ParamToggle("All trendlines","Show|Hide",1); showSignals=ParamToggle("Display signals","Off|On",0); TimeFrameSet(tfrm); if (PivotSymmetry) { fc=1; pk=H>Ref(HHV(H,nbar*fc),-1) AND Ref(HHV(H,nbar),nbar)<=H; tr=L<Ref(LLV(L,nbar*fc),-1) AND Ref(LLV(L,nbar),nbar)>=L; } else { fc=2; pk=H>Ref(HHV(H,nbar*fc),-1) AND Ref(HHV(H,nbar),nbar)<=H; tr=L<Ref(LLV(L,nbar*f...