_SECTION_BEGIN("SuperTrend "); _SECTION_BEGIN("SuperTrend"); SetBarsRequired(100000,0); GraphXSpae 1#; SetChartOpti$ns(0,hartSh$%&rr$%s'hartSh$%ates); SetChartBC$*$r(+araC$*$r("-$*$r",C$*$rRGB(0,0, 0))); G./SetB$de(0); G./SetOer*a2$de(1); SetBar3i**C$*$r(II.(C4O,+araC$*$r("Cand*e 5+ C$*$r", $*$rGreen),II.(C6O,+araC$*$r("Cand*e $%n C$*$r", $*$rRed),$*$r7i8htGre2))); +*$t(C,"9n+rie",II.(C4O,+araC$*$r(":i 5+ C$*$r", $*$rarGreen),II.(C6O,+araC$*$r(":i $%n C$*$r", $*$rarRed),$*$r7i8htGre2)),<,0,0,0,0); SetTradee*a2s(1,1,1,1); _N(Tit*e Str3$rat("==N&E>> Str3$rat("==N& E>> ? ==INTER@&7>> ==&TE>> ==&TE> > Open A8, i A8, 7$ A8, C*$se C*$ se A8 (A1.AA) ==@&75ES>>", O, , 7, C, Se*eted@a*ue( ROC( C, 1 ) ) )); 3at$r+ara("3at$r",D,1,10,1); +d+ara("&TR +eri$ds",10,1,100,1); 5p(7)F(3at$rH&TR(+d)); n(7)F?(3at$rH&TR(+d)); i&TR&TR(+d); Trend5pTrend$%nNu**; trend0J1; han8eO.Trend0; .*a8.*a8h0; .$r (i 1; i 6BarC$unt; i) = Trend5piJ Nu**; Trend$%niJ Nu**; trendiJ1;
i. (C*$seiJ45pi?1J) = trendiJ1; i. (trendi?1J ?1) han8eO.Trend 1; > e*se i. (C*$seiJ6ni?1J) = trendiJ?1; i. (trendi?1J 1) han8eO.Trend 1; > e*se i. (trendi?1J1) = trendiJ1; han8eO.Trend 0; > e*se i. (trendi?1J?1) = trendiJ?1; han8eO.Trend 0; > i. (trendiJ60 KK trendi?1J40) = .*a81; > e*se = .*a80;
> i. (trendiJ40 KK trendi?1J60) = .*a8h1; > e*se = .*a8h0; > i. (trendiJ40 KK niJ6ni?1J)= niJni?1J; > i. (trendiJ60 KK 5piJ45pi?1J) = 5piJ5pi?1J; > i. (.*a81) = 5piJ(iJ7iJ)F(3at$rHi&TRiJ);; > i. (.*a8h1) = niJ(iJ7iJ)F?(3at$rHi&TRiJ);; > i. (trendiJ1) = Trend5piJniJ; i. (han8eO.Trend 1) = Trend5pi?1J Trend$%ni?1J; han8eO.Trend 0; > > e*se i. (trendiJ?1) = Trend$%niJ5piJ; i. (han8eO.Trend 1) = Trend$%ni?1J Trend5pi?1J; han8eO.Trend 0; > > > +*$t(Trend5p,"Trend",$*$rGreen); +*$t(Trend$%n,"$%n",$*$rRed); Bu2 trend1; Se**trend?1; Bu2E/Re(Bu2,Se**); Se**E/Re(Se**,Bu2); Sh$rtSe**; C$erBu2;
Bu2+rie@a*ue:hen(Bu2,C); Se**+rie@a*ue:hen(Se**,C); Sh$rt+rie@a*ue:hen(Sh$rt,C); C$er+rie@a*ue:hen(C$er,C);
Tit*e En$deC$*$r($*$r:hite) "Super Trend" " ? " Nae() " ? " En$deC$*$r($*$rRed) Intera*() En$deC$*$r($*$r:hite) " ? " ate() " ? ""9n" En$deC$*$r($*$rRed) "Op?"O" ""i?"" ""7$?"7" " "C*?"C" " "@$* " :rite@a*(@)"9n" En$deC$*$r($*$r7ie) :riteI. (Bu2 , " GO 7ONG F Reerse Si8na* at "C" ","") :riteI. (Se** , " EXIT 7ONG F Reerse Si8na* at "C" ","") "9n"En$deC$*$r($*$rLe**$%) :riteI.(Se** , "T$ta* +r$.itF7$ss .$r the 7ast Trade Rs"(C?Bu2+rie)"","") :riteI.(Bu2 , "T$ta* +r$.itF7$ss .$r the 7ast trade Rs"(Se**+rie?C)"",""); +*$tShapes(II.(Bu2, shapeSquare, shapeN$ne),$*$rGreen, 0, 7, O..set?<0); +*$tShapes(II.(Bu2, shapeSquare, shapeN$ne),$*$r7ie, 0,7, O..set?#0); +*$tShapes(II.(Bu2, shape5p&rr$%, shapeN$ne),$*$r:hite, 0,7, O..set?<#); +*$tShapes(II.(Sh$rt, shapeSquare, shapeN$ne),$*$rRed, 0, , O..set<0); +*$tShapes(II.(Sh$rt, shapeSquare, shapeN$ne),$*$rOran8e, 0,, O..set#0); +*$tShapes(II.(Sh$rt, shape$%n&rr$%, shapeN$ne),$*$r:hite, 0,, O..set?<#); TrendS7II.(trend1,Trend5p,Trend$%n); .$r(iBarC$unt?1;i41;i??) = i.(Bu2iJ 1) = entr2 CiJ; si8 "B5L"; s* TrendS7iJ; tar1 entr2 (entr2 H 00#0); tar entr2 (entr2 H 00M); tarD entr2 (entr2 H 01M); -ars i; i 0; > i.(Se**iJ 1) = si8 "SE77"; entr2 CiJ; s* TrendS7iJ; tar1 entr2 ? (entr2 H 00#0); tar entr2 ? (entr2 H 011); tarD entr2 ? (entr2 H 01);
-ars i; i 0; > > O..set 0; C*r II.(si8 "B5L", $*$r7ie, $*$rRed); ss* II.(-ars BarC$unt?1, TrendS7BarC$unt?1J, Re.(TrendS7, ?1)); s* ss*BarC$unt?1J;
+*$t(7ine&rra2(-ars?O..set, tar1, BarC$unt, tar1,1), "", C*r, st2*e7ine'st2*e$ts, Nu**, Nu**, O..set);
+*$t(7ine&rra2(-ars?O..set, tar, BarC$unt, tar,1), "", C*r, st2*e7ine'st2*e$ts, Nu**, Nu**, O..set); +*$t(7ine&rra2(-ars?O..set, tarD, BarC$unt, tarD,1), "", C*r, st2*e7ine'st2*e$ts, Nu**, Nu**, O..set); FF+*$t(7ine&rra2(-ars?O..set, s*, BarC$unt, s*,1), "", $*$rarRed, st2*e7ine' st2*e7ine, Nu**, Nu**, O..set); FF+*$t(7ine&rra2(-ars?O..set, entr2, BarC$unt, entr2,1), "", $*$rGreen, st2*e7ine' st2*e7ine, Nu**, Nu**, O..set); .$r (i-ars; i 6BarC$unt;i) = +*$tTe/t(""si8""entr2, BarC$unt1,entr2,Nu**,$*$rB*ue); +*$tTe/t("T1"tar1,BarC$untD,tar1,Nu**,C*r);+*$tTe/t("T"tar,BarC$untD,tar,N u**,C*r);+*$tTe/t ("TD"tarD,BarC$untD,tarD,Nu**,C*r); > essa8e-$ard +araT$88*e("essa8e B$ard","Sh$%'ide",1); i. (essa8e-$ard 1 ) = G./Se*et3$nt( "Tah$a", 1D, 100 ); G./SetB$de( 1 ); G./SetTe/tC$*$r( $*$r:hite ); i. ( si8 "B5L") = G./Se*etS$*idBrush( $*$rB*ue ); FF this is the -$/ -a8r$und $*$r > e*se = G./Se*etS$*idBrush( $*$rRed ); FF this is the -$/ -a8r$und $*$r > p/ei8ht Status( "p/harthei8ht" ) ; // Status( "p/hart%idth"); 7e.t 1100; %idth D10; / #; / M0; 2 p/ei8ht; G./Se*et+en( $*$rGreen, 1); FF -r$ader $*$r G./R$undRet( /, 2 ? MP, /, 2 , , ) ; G./Te/tOut( ( "Supertrend"),1D,2?100); G./Te/tOut( (" "),,2?100); G./Te/tOut( ("7ast " si8 " Si8na* ae " (BarC$unt?-ars?1) H Intera*()F0 " ins a8$"), 1D, 2?P0) ; FF The te/t .$rat *$ati$n G./Te/tOut( ("" :riteI.(si8 "B5L",si8 " ",si8 " ") " Q " entr2), 1D, 2?0); G./Te/tOut( ("Trai*in8 S7 Q " TrendS7 " (" :rite@a*(II.(si8 "SE77",entr2? s*,s*?entr2), ) ")"), 1D, 2?<0); FHG./Te/tOut( ("TGTQ1 Q " tar1), 1D, 2 ?P0); G./Te/tOut( ("TGTQ Q " tar), 1D,2?0); G./Te/tOut( ("TGTQD Q " tarD), 1D,2?<0);HF G./Te/tOut( ("Current +F7 Q " :rite@a*(II.(si8 "B5L",(C?entr2),(entr2? C)),)), 1D, 2?);; >
_SECTION_EN();