/*[[ Name := 3Line_Break Author := Copyright © 2004, MechanicalTrade Co. Link := http://www.mechanicaltrade.ru Separate Window := No First Color := Blue First Draw Type := Histogram First Symbol := 217 Use Second Data := Yes Second Color := Red Second Draw Type := Histogram Second Symbol := 218 ]]*/ Variable : shift(0),trend(0),First(true),loopbegin1(0),ttime(0),prevbars(0); Input: X_Line_Break(3); SetLoopCount(0); if bars<100 then exit; If Bars < prevbars Or Bars-prevbars>1 Then first = True; prevbars = Bars; If first Then Begin if C[Bars-100]>O[Bars-100] then trend=1 else trend=0; loopbegin1 = Bars-100; If loopbegin1 < 0 Then Exit; // not enough bars for counting first = False; // this block is to be evaluated once only End; loopbegin1 = loopbegin1+1; For shift = loopbegin1 Downto 0 Begin //---------------------------------------------- If trend=1 and C[shift+1]High[Highest(MODE_HIGH,shift+X_Line_Break+1,X_Line_Break)] then trend=1; If trend=1 Then Begin SetIndexValue(shift, High[shift]); SetIndexValue2(shift,Low[shift]); end; If trend=0 Then Begin SetIndexValue(shift, Low[shift]); SetIndexValue2(shift,High[shift]); end; //---------------------------------------------- loopbegin1 = loopbegin1-1; End;