/*[[ Name := SilverTrend-off Author := Copyright © 2003, VIAC.RU AlexSilver,OlegVS,GOODMAN Link := http://viac.ru/ Separate Window := No First Color := Red First Draw Type := Histogram Use Second Data := Yes Second Color := Blue Second Draw Type := Histogram Second Symbol := 218 ]]*/ Inputs : KPr(20),SSP(9); Variables : K(0),shift(0), cnt(0), loopbegin(0); Variables : smin(0), smax(0), SsMax(0), SsMin(0) ,val1(0),val2(0); SetLoopCount(0); K=50-KPr; loopbegin = 0; For cnt = loopbegin to Bars-SSP+1 Begin shift=Bars-cnt-SSP+1; SsMax = High[Highest(MODE_HIGH,shift+SSP-1,SSP)]; SsMin = Low[Lowest(MODE_LOW,shift+SSP-1,SSP)]; smin = SsMin+(SsMax-SsMin)*K/100; smax = SsMax-(SsMax-SsMin)*K/100; val1=0; val2=0; If C[shift]smax Then {val2=High[shift]; val1=Low[shift]; }; SetIndexValue(shift,val1); SetIndexValue2(shift,val2); If shift>(SSP-1) then loopbegin=loopbegin+1; End;