/*[[ Name := Band Filter Author := Dart Link := konstantin2004@bk.ru Separate Window := No First Color := Aqua First Draw Type := Line First Symbol := 217 Use Second Data := No Second Color := Red Second Draw Type := Line Second Symbol := 218 ]]*/ Input: Tl(20), Th(60), BarsCount(500); Variable : shift(0),flag(0),i(0),Int(0),Diff(0),EnterF(0),ExitF(0),Ti(0),Td(0),length(50),S(0),AccountedBars(0),cnt(0),digf(0); Var: tau(0); Array : Coef[500](0),ArrayOne[500](0); SetLoopCount(0); // loop from first bar to current bar (with shift=0) AccountedBars = Bars-BarsCount; If flag<>1 then { Ti=Tl; Td=Th; S=0; //If Ti>Td then Ti=Td; //calculate coefficients for i=1 to length { if i< tau then Diff=1 else Diff=-20*exp(-(i-tau)/Td)/Td; Int=20*exp(-i/Ti)/Ti; Coef[i]=1000*pow(Diff,8)*pow(Int,8); }; S=0; for i=1 to length {S=S+Coef[i];}; //Coef[i]=10000*(-CoefI[i-1]+CoefI[i]); for i=length downto 1 {Coef[i]=Coef[i]/S;}; //addition of coef and normalizetion flag=1; }; For cnt = AccountedBars To Bars-1 Begin shift = Bars - 1 - cnt; ExitF=0; for i=1 to length { EnterF=close[shift+i-1]; ExitF=ExitF+Coef[i]*EnterF; }; If shift