/*[[ Name := SLS_T3 Author := Copyright © 2003, Sheldon Skidmore Link := http://groups.yahoo.com/group/MetaTrader_Experts_and_Indicators Separate Window := Yes First Color := Blue First Draw Type := Line First Symbol := 217 Use Second Data :=No Second Color := Red Second Draw Type := Line Second Symbol := 218 ]]*/ Input : t3_period(10), b(0.7); Variable : shift(0); Variable : t3(0),t3_1(0); Variable : e1(0),e2(0),e3(0),e4(0),e5(0),e6(0),c1(0),c2(0),c3(0),c4(0); Variable : e1x(0),e2x(0),e3x(0),e4x(0),e5x(0),e6x(0); Variable : n(0),w1(0),w2(0),b2(0),b3(0); Variable : ma_next(0),slope(0); Variable : prebars(0),init(true); if init then { b2=b*b; b3=b2*b; c1=-b3; c2=(3*(b2+b3)); c3=-3*(2*b2+b+b3); c4=(1+3*b+b3+3*b2); n=t3_period; if n<1 then n=1; n = 1 + 0.5*(n-1); w1 = 2 / (n + 1); w2 = 1 - w1; prebars=bars; init=false; }; SetLoopCount(99999999); For shift = Bars-t3_period-1 Downto 0 Begin e1 = w1*close[shift] + w2*e1x; e2 = w1*e1 + w2*e2x; e3 = w1*e2 + w2*e3x; e4 = w1*e3 + w2*e4x; e5 = w1*e4 + w2*e5x; e6 = w1*e5 + w2*e6x; t3 = c1*e6 + c2*e5 + c3*e4 + c4*e3; SetIndexValue2(shift,t3); t3_1=GetIndexValue2(shift+1); SetIndexValue(shift,(t3-t3_1)/t3_1); e1x=e1; e2x=e2; e3x=e3; e4x=e4; e5x=e5; e6x=e6; End;