sigwd=ParamToggle("sigchange","weekly|daily",1); //HBS mean hisogram !y sell and #HBS mean low !y high sell $eld= ParamToggle("$eld","$eldd|$eldw",1); %on = ParamToggle("%on","Show|Hide",1); message!oard = ParamToggle("&essage Board","Show|Hide",1); 're'lore= ParamToggle("'erce/!ysell","'ers|!ysell",1); S*+T-.B*.("Behgo S*+T-.B*.("Behgo0inSreng 0inSrengh hinder2"); inder2");
//'a= Param("'da", 13, 1, 455, 1);//21 //'2a= Param("'d2a", 1, 1, 455, 1);//21 //'4a= Param("'d3a", 1, 1, 455, 1);//21 //'3a= Param("'d6a", 1, 1, 455, 1);//21 //r1a= 7S(13); //r2a=8&9(r1a,'a); //ra1=8&9(r2a,'2a); //ra=8&9(ra1,'4a); //Plo(ra,"",colorBlack,s //Plo(ra,"",colorBlack,syle:oss yle:ossyleThick); yleThick); //Behgo0in Sock Srengh inder< //Sim'ly shows he Srengh o% any Sock so yo can selec he !es sock //9lso can !e sed as !y and sell sysem !y crossing 0ero line // can !e sed in daily, weekly or monhly ime %rame< 9lso yo can see he resls !y *'loraion //'dc= Param("'dc", 4, 1, 45, 1); //'dc1= Param("'dc1", 15, 1, 45, 1);
'dc2= Param("'dc2", 34, 1, 455, 1);//11,2,34,45,2,1>(34) //+#.= 7e%(+,4); 'd= Param("'do", 6?, 1, 455, 1);//2>,2?,1@?,25,111,25(1@?) 'dy= Param("'da", 1, 1, 455, 1);//1,1,1,1 //'dy= Param("'da", 1, 1, 455, 1);//4,1,12,4(1)
+w=Param("'dw", 15, 1, 455, 1);//6,6,12,1?,@(12) +a=Param("'a", 65, 1, 455, 1);//6,6,12,1?,@(12) +!=Param("'w", 36, 1, 455, 1);//6,6,12,1?,@(12) +!a=Param("'wa", 13, 1, 455, 1);//6,6,12,1?,@(12) +!a=7S(13); a!=8&9(A,+!a); +ln=(+!aa!)/2;
Beh1=((+#. 8&9(+#., 'd)) / 8&9(+#., 'dy)) C 155; !eh=TS(Beh1,+!); col = %( !ehD=@ == !ehD=15,colorBle,color+som12); Plo(!eh,"",col,syle#ine); Plo(@,"",colorBlack,syle#ine); Plo(15,"",colorBlack,sy Plo(15,"",colorBlack,syle#ine); le#ine);
A2 = HHA(Beh,155); A4 = ##A(Beh,155); Beh1= TS(BehC(A2A4),+a); !eh1e=TS(Beh1,'dc2); !eh1a=TS(Beh1,+!);
//Plo(!eh1ee, //Plo(!eh1 ee, " ",colorEellow,syle. ",colorEellow,syle.oTile oTile | syle#ine | syleThick); syleThick) ;
//cole = %( !eh1eD=5,color8hie,color+som12);
By =+oFer=+ross( Beh,@);// 9.: +ross(7S(13),45); Sell = Shor=+ross(@,Beh);//9.: +ross(5,7S(13));
+w=Param("'dw", 15, 1, 455, 1);//6,6,12,1?,@(12) +a=Param("'a", 65, 1, 455, 1);//6,6,12,1?,@(12) +!=Param("'w", 36, 1, 455, 1);//6,6,12,1?,@(12) +!a=Param("'wa", 13, 1, 455, 1);//6,6,12,1?,@(12) +!a=7S(13); a!=8&9(A,+!a); +ln=(+!aa!)/2;
Beh1=((+#. 8&9(+#., 'd)) / 8&9(+#., 'dy)) C 155; !eh=TS(Beh1,+!); col = %( !ehD=@ == !ehD=15,colorBle,color+som12); Plo(!eh,"",col,syle#ine); Plo(@,"",colorBlack,syle#ine); Plo(15,"",colorBlack,sy Plo(15,"",colorBlack,syle#ine); le#ine);
A2 = HHA(Beh,155); A4 = ##A(Beh,155); Beh1= TS(BehC(A2A4),+a); !eh1e=TS(Beh1,'dc2); !eh1a=TS(Beh1,+!);
//Plo(!eh1ee, //Plo(!eh1 ee, " ",colorEellow,syle. ",colorEellow,syle.oTile oTile | syle#ine | syleThick); syleThick) ;
//cole = %( !eh1eD=5,color8hie,color+som12);
By =+oFer=+ross( Beh,@);// 9.: +ross(7S(13),45); Sell = Shor=+ross(@,Beh);//9.: +ross(5,7S(13));
PloSha'es( By C sha'eG'9rrow Sell C sha'e:own9rrow, %( By, colorBrighreen, color7ed ) ); PloSha'es( By C sha'eG'Triangle Sell C sha'e:ownTriangle, %( By, colorBrighreen, color7ed ) ); //PloSha'es( By C sha'eHollowSmall+ircle Sell C sha'eHollowSmall+ircle, %( By, color8hie, colorEellow ) ); PloSha'es(%(By,sha'eG'9rrow,sha'e.one),colorreen); PloSha'es(%(By,sha'eHollowG'9rrow,sha'e.one),color8hie); //PloSha'es(%(By,sha'eHollowSmall+ircle,sha'e.one),color8hie);
PloSha'es(%(Sell,sha'e:own9rrow,sha'e.one),color7ed); PloSha'es(%(Sell,sha'eHollow:own9rrow,sha'e.one),color8hie); //PloSha'es(%(Sell,sha'eHollowSmall+ircle,sha'e.one),color8hie);
PloSha'es(%(Shor,sha'e:ownTriangle,sha'e.one),colorEellow); PloSha'es(%(Shor,sha'eHollow:ownTriangle,sha'e.one),color8hie); //PloSha'es(%(Shor,sha'eHollow+ircle,sha'e.one),color8hie);
PloSha'es(%(+oFer,sha'eG'Triangle,sha'e.one),color#ighBle); PloSha'es(%(+oFer,sha'eHollowG'Triangle,sha'e.one),color8hie); //PloSha'es(%(+oFer,sha'eHollow+ircle,sha'e.one),color8hie);
%or( i = 5; i Bar+on; i ) I i%( ByJiK ) I
-GTcolor -GTcolor = Param+olor("-er Param+olor("- er Panel +olor",colorTeal); +olor",colorTeal); .GPcolor = Param+olor("nner Panel G''er",color:arkreen); .:.color = Param+olor("nner Panel #ower",color:ark-liFereen);
Tile+olor = Param+olor("Tile +olor ",colorBlack); Se+harBk+olor(-GTcolor); // color o% oer !order Se+harBkradienill(.GPcolor,.:.color,Tile+olor); // color o% inner 'anel L i%( SellJiK ) I -GTcolor = Param+olor("-er Panel +olor",colorTeal); .GPcolor = Param+olor("nner Panel G''er2",color:ark7ed); .:.color = Param+olor("nner Panel #ower2",colorPlm); Tile+olor = Param+olor("Tile +olor ",colorBlack); Se+harBk+olor(-GTcolor); // color o% oer !order Se+harBkradienill(.GPcolor,.:.color,Tile+olor); // color o% inner 'anel L L
i%(%on==5) I S*+T-.B*.(".ame"); %Se-Ferlay&ode(5); %Selecon("Tahoma", Sas("'heigh")/? ); %SeTe9lign( > );// cener alignmen %SeTe+olor( +olorHSB( 32, 32, 32 ) ); %SeBk&ode(5); // rans'aren %Te-( .ame(), Sas("'widh")/2, Sas("'heigh")/12 ); %Selecon("Tahoma", Sas("'heigh")/1? ); %Te-("" , Sas("'widh")/2, Sas("'heigh")/3 ); %Selecon("Tahoma", Sas("'heigh")/1? ); %Selecon("Tahoma", Sas("'heigh")/4> ); %Te-( "", Sas("'widh")/2, Sas("'heigh")/4 ); S*+T-.*.:();
//&ag$ed &arke Price %SeTe9lign( > );// cener alignmen S=Param("on Si0e",2,11,155,1); %Selecon("Times .ew 7oman", S, 55, Tre ); %SeBk&ode(5); // rans'aren %SeTe+olor( +olorHSB( 32, 32, 32 ) ); Hor=Param("Hori0ona Posiion",>16,1,1255,1); Aer=Param("Aerica Posiion",162,1,?45,1); %Te-(""+, Hor , Aer ); E+=TimerameePrice("+",in:aily,1); ::=Prec(+E+,2); %SeTe9lign( > );// cener alignmen =Prec((::/E+)C155,2); S2=Param("on Si0e2",46,11,155,1); %Selecon("Times .ew 7oman", S2,11, 55, Tre ); %SeBk&ode( colorBlack ); Hor1=Param("Hori0onal Posiion",>16,1,1255,1); Aer1=Param("Aerical Posiion",1??,1,?45,1); %SeTe+olor( +olorHSB( 32, 32, 32 ) ); %Te-(""::" (""M)", Hor1 , Aer136 ); L else II //&ag$ed &arke Price %SeTe9lign( > );// cener alignmen %se=Param("on Si0ee",46,11,155,1); %Selecon("Times .ew 7oman", %se, 55, Tre ); %SeBk&ode( colorold ); %SeTe+olor( Param+olor("+olor",colorold) );
Hora=Param("Hori0onal Posiiona",626,1,1255,1); Aera=Param("Aerical Posiiona",1,1,?45,1); %Te-(""+, Hora , Aera ); E+a=TimerameePrice("+",in:aily,1); ::a=Prec(+E+a,2); %SeTe9lign( > );// cener alignmen a=Prec((::a/E+a)C155,2); S!=Param("on Si0e!",1>,11,155,1); %Selecon("Times .ew 7oman",%s!, 55, Tre ); %SeBk&ode( colorBlack ); %SeTe+olor(Param+olor("+olor",colorEellow) ); %Te-(""::a" ("a"M)", Hora , Aera36 ); S*+T-.*.:(); LL
By=*7em(By,Sell); Sell=*7em(Sell,By); 9ler%( By, "", "BGE N " +, 1 ); 9ler%( Sell, "", "S*## N " +, 2 ); no=Param( "Swing", ?, 1, 66 ); slcol=Param+olor( "+olor", color#ighrey ); res=HHA(H,no); s'=##A(#,no); aFd=%(+D7e%(res,1),1,%(+7e%(s',1),1,5)); aFn=Aale8hen(aFdO=5,aFd,1); sl=%(aFn==1,s',res);
no = -'imi0e("TS#",Param("9 (+hange To -'imise)",15, 1, 66 ,1),1, 66 ,1);
slcol=Param+olor( "+olor", color#ighrey ); res=HHA(H,no); s'=##A(#,no); aFd=%(+D7e%(res,1),1,%(+7e%(s',1),1,5)); aFn=Aale8hen(aFdO=5,aFd,1); dsl=%(aFn==1,s',res); SellPrice=Aale8hen(Shor,+,1); ByPrice=Aale8hen(By,+,1); #ong=li'(By,Sell); Shr=li'(Shor,+oFer); 7ela = .-T #ong 9.: .-T By 9.: .-T shr 9.: .-T Sell 9.: .-T Sell 9.: .-T +oFer; SellS#=Aale8hen(Shor,:TS#,1); ByS#=Aale8hen(By,:TS#,1); By:ierence= ByPrice ByS#; Sell:ierence = SellS# SellPrice;
ar1 = %(By -7 #ong 9.: .-T 7ela 9.: .-T Sell 9.: .-T +oFer, (ByPrice By:ierence), (SellPrice Sell:ierence)); ar2 = %(By -7 #ong 9.: .-T 7ela 9.: .-T Sell 9.: .-T +oFer, (ByPrice (2CBy:ierence)), (SellPrice (2CSell:ierence))); ar4 = %(By -7 #ong 9.: .-T 7ela 9.: .-T Sell 9.: .-T +oFer, (ByPrice (3CBy:ierence)), (SellPrice (3CSell:ierence)));
+lose9*nd = ParamToggle("+lose Posiions *-:", ".o|Ees"); so'reFerse =ParamToggle("Swich To So' 9nd 7eFerse",".o|Ees",5); Trend = 9T7(21) S:eF (+,21); 7ange = 9T7(21) D S:eF (+,21);
no=15; +14=25; +13=2<1; +16=12;
slcol=Param+olor( "+olor", color#ighrey ); res=HHA(H,no); s'=##A(#,no); aFd=%(+D7e%(res,1),1,%(+7e%(s',1),1,5)); aFn=Aale8hen(aFdO=5,aFd,1); dsl=%(aFd==1,s',res);
SellPrice=Aale8hen(Shor,+,1); ByPrice=Aale8hen(By,+,1); #ong=li'(By,Sell); Shr=li'(Shor,+oFer); 7ela = .-T #ong 9.: .-T By 9.: .-T shr 9.: .-T Sell 9.: .-T Sell 9.: .-T +oFer; SellS#=Aale8hen(Shor,:TS#,1); ByS#=Aale8hen(By,:TS#,1); By:ierence= ByPrice ByS#; Sell:ierence = SellS# SellPrice;
//ar1 = %(By -7 #ong 9.: .-T 7ela 9.: .-T Sell 9.: .-T +oFer, (ByPrice By:ierence), (SellPrice Sell:ierence)); //ar2 = %(By -7 #ong 9.: .-T 7ela 9.: .-T Sell 9.: .-T +oFer, (ByPrice (2CBy:ierence)), (SellPrice (2CSell:ierence))); //ar4 = %(By -7 #ong 9.: .-T 7ela 9.: .-T Sell 9.: .-T +oFer, (ByPrice (3CBy:ierence)), (SellPrice (3CSell:ierence))); !yach1 = %((By -7 #ong 9.: .-T 7ela 9.: .-T +oFer 9.: .-T Shor 9.: .-T Shr), H D ar1, 5);
!yach2 = %((By -7 #ong 9.: .-T 7ela 9.: .-T +oFer 9.: .-T Shor 9.: .-T Shr), H D ar2 , 5); !yach4 = %((By -7 #ong 9.: .-T 7ela 9.: .-T +oFer 9.: .-T Shor 9.: .-T Shr), H D ar4, 5);
sellach1 = %((Shor -7 Shr 9.: .-T 7ela 9.: .-T Sell 9.: .-T By 9.: .-T #ong), # ar1 , 5); sellach2 = %((Shor -7 Shr 9.: .-T 7ela 9.: .-T Sell 9.: .-T By 9.: .-T #ong), # ar2, 5); sellach4 = %((Shor -7 Shr 9.: .-T 7ela 9.: .-T Sell 9.: .-T By 9.: .-T #ong), # ar4, 5);
// Gserde$ned 'arameer %or *&9 'eriods
*&9Ty'e
= Param("*&91, T*&92, Q&94", 2, 1, 4, 1);
*&9'rds
= Param("*&9'eriods", , 1, 45, 1);
Sd&9+:
= Param("Sandard &9+:R .o5, Ees1", 1, 5, 1, 1);
Plo%ashion = Param("Bar9rrows1, m'lse Bars2", 2, 1, 2, 1);
// 9llow ser o de$ne 8eekly and &onhly 7i!!on #ocaion and Heigh 87P1 = Param("8eekly 7i!!on #ocaion", 15<6, 1555, 1555, 5<1); 87P2 = Param("8eekly 7i!!on Heigh", 4>><6, 5<551, 655, 5<1);
&7P1 = Param("&onhly 7i!!on #ocaion", 6<2, 1555, 1555, 5<1); &7P2 = Param("&onhly 7i!!on Heigh", 1@@, 5<551, 655, 5<1);
// +om'e *&9 and &9+: Hisogram i%(*&9Ty'e == 1)
I :ay*&9
= *&9(+lose, *&9'rds);
L i% (*&9Ty'e == 2) I :ay*&9
= T*&9(+lose, *&9'rds);
L
i%(*&9Ty'e == 4) I // #ine !elow o !e sed wih Qrik Q&9 // :ay*&9 = QrikQ&9(+, *&9Prds); L
Hisogram
= &9+:() Signal();
// :eermine i% we haFe an m'lse GP, :-8. or .one m'lseG' = 7e%(Hisogram, 1);
:ay*&9 D 7e%(:ay*&9, 1) 9.: Hisogram D
m'lse:own = 7e%(Hisogram, 1);
:ay*&9 7e%(:ay*&9, 1) 9.: Hisogram
m'lse.one
=
(.-T m'lseGP) 9.: (.-T m'lse:own);
// +om'e 8eekly &9+: and deermine wheher rising or %alling // .oe ses "nonsandard" 'arameersO TimerameSe(in8eekly);
i% (Sd&9+: == 5) I &9+:Fal
=
&9+:(6, ?);
SignalFal
=
Signal(6, ?, 6);
&9+:Fal
=
&9+:(12, 2>);
SignalFal
=
Signal(12, 2>, @);
=
&9+:Fal SignalFal;
L else I
L
Hisinw
whrising = Hisinw D 7e%(Hisinw, 1); wh%alling = Hisinw 7e%(Hisinw, 1);
Timerame7esore();
// .ow ge &onhly &9+: Hisogram<<<< TimerameSe(in&onhly); &9+:Fal
=
&9+:(6, ?);
SignalFal
=
Signal(6, ?, 6);
Hisinm
=
&9+:Fal SignalFal;
mhrising = Hisinm D 7e%(Hisinm, 1); mh%alling = Hisinm 7e%(Hisinm, 1);
Timerame7esore();
whrising
= Timerame*'and( whrising, in8eekly, e'and#as );
wh%alling
= Timerame*'and( wh%alling, in8eekly, e'and#as);
mhrising
= Timerame*'and(mhrising, in&onhly, e'and#as);
mh%alling
= Timerame*'and(mh%alling, in&onhly, e'and#as);
kol
= %( whrising, colorreen, %(wh%alling, color7ed,
color#ighrey)); mkol = %( mhrising, colorBle, %(mh%alling, colorEellow, color#ighrey));
// Plo hem allO i% (Plo%ashion == 1) I Plo(+lose, "+lose", colorTeal, syleBar); PloSha'es(sha'eG'9rrow C m'lseG', colorBle, 5, #ow, 12); PloSha'es(sha'e:own9rrow C m'lse:own, color7ed, 5, High, 12); PloSha'es(sha'eSmall+ircle C m'lse.one, color8hie, 5, High, 6); L else I !arkol
=
%(im'lseGP, colorBle, %(im'lse:own, color7ed,
color8hie)); //Plo(+, "+lose", !arkol, syleBar); L
Plo(15, "ri!!on", kol, syle-wnScale|syle9rea|syle.o#a!el, 87P1, 87P2);//8eekly rend
Plo(15, "ri!!on", mkol, syle-wnScale|syle9rea|syle.o#a!el, &7P1, &7P2);
// &onhly Trend
// *'lorer Secion // :eermine i% m'lse sas is !llish, neral or !earish< :is'lay as Te +olmn<
m'lseSae
=
8rie%(m'lseG', "Bl", 8rie%(m'lse:own,
"Bear", ".e"));
// Se he !ackgrond color %or m'lse Sas +olmn m'lse+ol
=
%(m'lseG', colorreen, %(m'lse:own, color7ed,
color#ighrey));
// :eermine 8eekly Trend< :is'lay as Te +olmn 8eeklyTrend "alling",
=
8rie%(whrising, "7ising", 8rie%(wh%alling,
"laO")); 8eekly+ol
=
%(whrising, colorreen, %(wh%alling, color7ed,
color#ighrey));
// :eermine &onhly Trend< :is'lay as Te +olmn &onhlyTrend
=
8rie%(mhrising, "7ising", 8rie%(mh%alling, "alling",
=
%(mhrising, colorreen, %(mh%alling, color7ed,
"laO")); &onhly+ol color#ighrey));
// :eermine how many !ars has he crren sae eised !arsin!ll =
&in(BarsSince(im'lsenone), BarsSince(im'lsedown));
!arsin!ear =
&in(BarsSince(im'lse'), BarsSince(im'lsenone));
!arsinne =
&in(BarsSince(im'lsedown), BarsSince(im'lse'));
// Se a single Faria!le o show nm!er o% !ars in crren sae de'ending 'on
// acal m'lse Sas Bllish, Bearish or .eral !arsinsae = %(m'lseG',!arsin!ll, %(m'lsedown, !arsin!ear,!arsinne));
//9dd+olmn(+lose,"+lose",1<2); // +olmns %or dis'lay in *'lorer //9ddTe+olmn(m'lseSae, "Sas", 1, color8hie, m'lse+ol); //9dd+olmn(!arsinsae, "Bars", 1, color8hie, m'lsecol); //9cion = 8rie%(By, "BGE", 8rie%(Sell, "S*##", " ")); //i=5; //!arsinsaee
=
%(By, Bar+onJiK, %(Sell, Bar+onJiK,!arsinne));
//!ars=BarsSince(%(ByBar+on1),-7( SellBar+on1));
'ls= Param("'ls", 5,5,62,1); &ins = Param("&ins", 5,16,5,25); 'rch = (+ TimerameePrice( "+", in:aily, 1 ))/ TimerameePrice( "+", in:aily, 1 )C155 ; 'rcha= (+7e%(+,>))/7e%(+,>)C155; 'rche= (+7e%(+,2))/7e%(+,1)C155; 'rchk= (+7e%(+,2))7e%(+,1)C15/1; //'rchka=('rchk)/15;
'rchka = (+ TimerameePrice( "+", in:aily, 1 )) +lose;
//:ae() //'rchk= (:ae()7e%(:ae(),1))7e%(:ae(),1); 'rch6=('rche'rch); 'rch>= (+7e%(+,6))/7e%(+,6)C155; 'rch= (+7e%(+,2@))/7e%(+,2@)C155; 'rch?= (+7e%(+,?))/7e%(+,?)C155; 'rch@= (+7e%(+,165))/7e%(+,165)C155; 'rch15= (+7e%(+,263))/7e%(+,262)C155; 'rch11= (+7e%(+,3@5))/7e%(+,3@5)C155; 'rch12= (+7e%(+,46))/7e%(+,46)C155;
'rch14= (+7e%(+,12?4))/7e%(+,12?4)C155;
col=% ((Aolme D 1<26 C *&9( Aolme, 43 )),color7ed,color#ime); //+ol=%(( By, >> , ?4 ), %orma+har, color:e%al, %( 'ls , colorreen, color7ed ));
//iler = 'rch> 4 -7 'rch> 4 ; i%('re'lore==5) Iiler = 'rch D 'ls -7 'rch &ins ; 9dd+olmn('rchka ,"'rF+lose",color:e%al,+ol,colorPlm); 9dd+olmn(+lose,"+lose",1<2,color:e%al, +ol); 9dd+olmn('rch6,"'rFiday", 1<2,color:e%al, +ol); 9dd+olmn('rch,"daily", 1<2,color:e%al, +ol); //iler=5; 9dd+olmn( %( By, >> , ?4 ), "Signal", %orma+har, color:e%al, %( By , colorreen, color7ed ) );
9dd+olmn(Aolme,"Aolme",1<5, color:e%al, % ((Aolme D 1<26 C *&9( Aolme, 43 )),color+som12,color#ime)); 9dd+olmn('rch>,"weekly", 1<2,color:e%al, +ol); 9dd+olmn('rch,"monhly", 1<2,color:e%al, +ol); 9dd+olmn('rch?,"Urly", 1<2,color:e%al, +ol); 9dd+olmn('rch@,"hal%yly", 1<2,color:e%al, +ol); 9dd+olmn('rch15,"yearly", 1<2,color:e%al, +ol); 9dd+olmn('rch11,"woyrly", 1<2,color:e%al, +ol); 9dd+olmn('rch12,"hirdyrly", 1<2,color:e%al, +ol); 9dd+olmn('rch14,"$Feyrly", 1<2,color:e%al, +ol);
L else
I
//iler = SellD2 9.: i4 -7 ByD2 9.: i4 ; 9dd+olmn(7-+(A,1),"7Aol ",1<2, %(7-+(A,1) D 5,color:e%al,colorEellow),m'lsecol);
9dd+olmn(!arsinsae ,"Bars", 1, color8hie, m'lsecol); 'rchka = (+ TimerameePrice( "+", in:aily, 1 )) +lose;
//9dd+olmn(+ + 1 ,"+lose",1<2,color:e%al, +ol)/2; 9dd+olmn('rchka ,"'rF+lose",color:e%al,color8hie, colorBle); //9ddTe+olmn(8eeklyTrend, "8 Trend", 1, color8hie, 8eekly+ol); //9ddTe+olmn(&onhlyTrend, "& Trend", 1, color8hie, &onhly+ol);
//iler = 1;
S*+T-.*.:(); //Seings %or e'loraion
H1 = SelecedAale( TimerameePrice( "H", in:aily, 1 ) ); #1 = SelecedAale( TimerameePrice( "#", in:aily, 1 ) ); +1 = SelecedAale( TimerameePrice( "+", in:aily, 1 ) ); H2 = SelecedAale( TimerameePrice( "H", in:aily, 5 ) ); #2 = SelecedAale( TimerameePrice( "#", in:aily, 5 ) ); -1 = SelecedAale( TimerameePrice( "o'en", in:aily, 5 ) ); 3 = 5; :1 = ( H1 #1 ); :2 = ( H2 #2 ); 1 = :1 C 5<344; 2 = :1 C 5<>>;
4 = :1 C 1<46; i% ( :2 = 1 ) 3 = 1; else i% ( :2 = 2 ) 3 = 2; else 3 = 4;
SP = ( -1 3 );
BP = ( -1 3 );
BP = ( #2 3 );
BPTT = ( BP ( BP C <55>6 ) );//<5516 !rokerage
BPSTP#S = ( BP ( BP C <55?6 ) );
SP = ( H2 3 );
SPTT = ( SP ( SP C <55>6 ) );
SPSTP#S = ( SP ( SP C <55?6 ) );
' = ( H1 #1 +1 ) / 4;
s1 = ( H1 );
r1 = ( #1 );
r2 = SelecedAale( #2 );
s2 = SelecedAale( H2 );
//+-.:T-.
i% (ParamToggle("Tooli' shows", "9ll Aales|-nly Prices")) I ToolTi' = Srorma("-'en MgVnHigh MgVn#ow MgVn+lose Mg (M<1%MM) VnAolme " .mToSr(A, 1), -, H, #, +, SelecedAale(7-+(+, 1))); L
//s'ace = Param("S'ace on +har", 25, 16, 65, 1); //ra'hWS'ace = s'ace; //Se+harBk+olor(Param+olor("Backgrond +olor", colorBlack));
// ================= 7asheedXs original code (wih #ook!ack and Shi% de%al se o his s'ecs) =================
H5 = H; #5 = #; +5 = +; -5 = -;
#ook!ack = Param("#ookBack", 15, 15, 65, 1); // :e%al %or inerday commodiy crrency rading shi% = Param("Shi%", 6, 1, 65, 1); // R 5 = #asAale(+m(1)); 1 = 5 shi%;
H = 7e%(H, shi% 1); # = 7e%(#, shi% 1); H1 = #asAale(7e%(HHA(H, #ook!ack), 1)); #1 = #asAale(7e%(##A(#, #ook!ack), 1));
//Plo(H1, "H1", colorEellow); //Plo(#1, "#1", colorEellow);
H = H5; # = #5; + = +5; - = -5;
' = +ross(H, H1)9.: +m(1) D 1; dn = +ross(#1, #)9.: +m(1) D 1;
//Plo(+, "+lose", %(+m(1) D 1 #ook!ack 9.: +m(1) = 1, colorBle, %(G', colorBrighreen, %(:n, color7ed, %(+ D -, colorreen, color7ed)))), >3); //PloSha'es(sha'e:own9rrow C(+m(1) == 1 1), colorBle);
// ======================= *'loraion and Signal +ode ================= T7*7 = ParamToggle("Trigger ", "+#-S*|HH -7 #-8");
WH1 = +ross(+, H1); W#1 = +ross(#1, +); WH2 = +ross(H, H1); W#2 = +ross(#1, #);
i% (T7*7 == 5) I //By = WH1; //Sell = W#1; L
else I //By = WH2; //Sell = W#2; L
//Trade:is'lay = ParamToggle("7emoFe *ra TradesR", ".o|Ees");
//i%(Trade:is'lay O= 5)I //By = *7em(By, Sell); //Sell = *7em(Sell, By); // THS 8## 7*&-A* *W*SS S.9#S -. 9 +H97T -7 . 9. *WP#-79T-. //L
//iler = By D2 4 == Bar+on1 -7 Sell D44 == Bar+on1; 9cion = 8rie%(By, "BGE", 8rie%(Sell, "S*##", " "));
//9ddTe+olmn(ndsry:(1), "ndsry Secor ", 45<5, colorBle, colorEellow); 9dd+olmn(+, "*nry ", 2<2, color8hie, colorBle); 9ddTe+olmn(9cion, "9cion", ?<5, %(h1, color:arkreen, color:ark7ed), colorEellow); 9dd+olmn(%(WH1, H1, #1), "B7*9Y-GT #*A*#", 4<2, colorEellow, %(WH1, color:arkreen, color:ark7ed));
// 9rrow signals -7 T79:*S //PloSha'es(By Csha'eG'9rrow, colorBrighreen, 5, # /C *.T7ET79#9779E C/, 45); //PloSha'es(Sell Csha'e:own9rrow, color#ighEellow, 5, H, 45); S*+T-.*.:();
S*+T-.B*.("Aolme 9 Price"); PloA9P-Ferlay(Param("#ines", 1555, 155, 1555, 15), Param("8idh", 16, 1, 155, 1), Param+olor("+olor", colorBle), ParamToggle("Side", "#e%|7igh", 1) | 3 CParamToggle("Zorder", "-n o'|Behind", 1));
S*+T-.*.:(); //iler = By -7 Sell;
//9dd+olmn( %( By, >>, 1 ), "By", %orma+har, 1, !kcolor = %( By, 34, 44 ) );
//9dd+olmn( %( Sell, ?4, 1 ), "Sell", %orma+har, 1, !kcolor = %( Sell, 26, 42 ) );
//9dd+olmn( +, "+&P", 1<2, color:e%al, color#ighBle );
//9dd+olmn( BP, "S*## P7+*", 1<2, color:e%al, colorreen );
//9dd+olmn( BPTT, "TT P7+*", 1<2, color:e%al, colorBrown );
//9dd+olmn( BPSTP#S, "STP#S BGE", 1<2, color:e%al, color7ed );
9dd+olmn( ', "PA-T", 1<2, color:e%al, colorEellow );
//9dd+olmn( SPSTP#S, "STP#S S*##", 1<2, color:e%al, color7ed );
//9dd+olmn( SP, "S*## P7+*", 1<2, color:e%al, colorreen );
//9dd+olmn( SPTT, "TT P7+*", 1<2, color:e%al, colorBrown );
//Seings %or e'loraion
iler=By -7 Sell 9.: +oFer -7 Shor; 9dd+olmn( %( By, >> , ?4 ), "Signal", %orma+har, color:e%al, %( By , colorreen, color7ed ) );
//9dd+olmn(+lose,"*nry Price",1<3, color:e%al, %( By , colorreen, color7ed )); 9dd+olmn(dsl,"So' #oss",1<3, color:e%al, %( By , colorreen, color7ed )); 9dd+olmn(ar1,"Targe 1",1<3, color:e%al, %( By , colorreen, color7ed )); 9dd+olmn(ar2,"Targe 2",1<3, color:e%al, %( By , colorreen, color7ed )); 9dd+olmn(ar4,"Targe 4",1<3, color:e%al, %( By , colorreen, color7ed )); 9dd+olmn(Aolme,"Aolme",1<5, color:e%al, % ((Aolme D 1<26 C *&9( Aolme, 43 )),colorBle,colorEellow)); 9dd+olmn( H1, "P7*HH" );
9dd+olmn( #1, "P7*#-8" );
9dd+olmn( :1, "P7*:" );
9dd+olmn( 1, "5<344" );
9dd+olmn( 2, "5<>>" );
9dd+olmn( 4, "1<46" );
9dd+olmn( H2, ":HH" );
9dd+olmn( #2, ":#-8" );
9dd+olmn( :2, "::" );
9dd+olmn( 3, "S*#*+T 9+T" );
9ler%( By , "S-G.: +VV8indowsVV&ediaVVchimes
L //Shor = Sell; //+oFer = By;
//Shor = *7em(Shor, +oFer); //+oFer = *7em(+oFer, Shor);
'Heigh = Sas( "'charheigh" ) ; = Sas( "'charwidh"); #e% = 1155; widh = 415; = 6;
2 = 2?5;
y = 'Heigh; dis = 2C9T7(15); dis1 = 4C9T7(15); i=Bar+on; !ars = i;
i%(message!oard) I %or( i = 5; i Bar+on; i ) I i%( ByJiK ) I // PloTe( "VnBy" #J i K "VnT= " (#JiKC1<556) "VnS#= " (#JiKC5<@@6), i, #J i KdisJiK, colorreen, color8hie );
// Signal :is'lay Panel //
SellPrice=Aale8hen(Sell,+,1); ByPrice=Aale8hen(By,#J i K);
#ong=li'(By,Sell); Shr=li'(Sell,By ); BySo'2 = #JiKC5<@@6; ByTP1 = #JiKC1<55; ByTP2 = #JiKC1<565; ByTP4 = #JiKC1<546;
!yach1 = %((By -7 #ong 9.: .-T 7ela 9.: .-T +oFer 9.: .-T Shor 9.: .-T Shr), H D ByTP4, 5); !yach2 = %((By -7 #ong 9.: .-T 7ela 9.: .-T +oFer 9.: .-T Shor 9.: .-T Shr), H D ByTP2, 5);
!yach4 = %((By -7 #ong 9.: .-T 7ela 9.: .-T +oFer 9.: .-T Shor 9.: .-T Shr), H D ByTP1, 5); %Selecon( "Tahoma", 14, 155 ); %Se-Ferlay&ode( mode = 5 ); %SelecPen( colorBrighreen, 4 ); %SelecSolidBrsh( colorBrighreen); %7ond7ec( , y 1>4, 2, y , , ) ; %SeTe+olor( colorold ); %Te-( ( " Trading Sysem "),4,y1>6); %Te-( (" "),2,y1>5);
%SeBk&ode(1); %Selecon( "9rial", 15, 55, alse ); %SeTe+olor( colorBle );
%SeTe9lign(5); %Selecon( "Tahoma", 14, 155 );
%Te-( 8rie%(#J i K, "By 9!oFe "#J i K,""), 14, y135); %SeTe+olor( colorold ); %Te-( 8rie%(BySo'2, "#ong S# "(BySo'2),""), 14, y125); %SeTe+olor( color8hie ); %Te-( 8rie%(ByTP1, "By TT1 "(ByTP4),""), 14,y 155); %Te-( 8rie%(ByTP2, "By TT2 "(ByTP2),""), 14,y ?5); %Te-( 8rie%(ByTP4, "ByTT4 "(ByTP1),""), 14,y >5); %SeTe+olor( colorAiole ); %Te-( ("+rren P/# " 8rieAal(%(By ,(+ByPrice),(+ByPrice)),2<2)), ??, y22); %Te-( ("By Signal came " (Bar+on!ars 1) C nerFal()/4 " mins ago"), 14, y35) ; %Te- ( ("" 8rie% (!yach1, " :one "ByTP4,"")), 1>5, y155); %Te-
( ("" 8rie% (!yach2, " :one "ByTP2,"")), 1>5, y?5); %Te- ( ("" 8rie% (!yach4, " :one "ByTP1,"")), 1>5, y>5); // *.: o% Signal :is'lay Panel // L i%( SellJiK ) I // PloTe( "Sell" HJ i K "VnT= " (HJiKC5<@@6) "VnS#= " (HJiKC1<5526), i, HJ i Kdis1JiK, color7ed, color8hie );
// Signal :is'lay Panel //
SellPrice=Aale8hen(Sell,+,1);
ByPrice=Aale8hen(By,HJ i K); #ong=li'(By,Sell); Shr=li'(Sell,By ); SellSo'2 = HJiKC1<5526; SellTP1 = HJiKC5<@?; SellTP2 = HJiKC5<@?2; SellTP4 = HJiKC5<@??; sellach1 = %((Shor -7 Shr 9.: .-T 7ela 9.: .-T Sell 9.: .-T By 9.: .-T #ong), # SellTP4 , 5); sellach2 = %((Shor -7 Shr 9.: .-T 7ela 9.: .-T Sell 9.: .-T By 9.: .-T #ong), # SellTP2, 5); sellach4 = %((Shor -7 Shr 9.: .-T 7ela 9.: .-T Sell 9.: .-T By 9.: .-T #ong), # SellTP1, 5);
%Selecon( "Tahoma", 14, 155 ); %Se-Ferlay&ode( mode = 5 ); %SelecPen( color7ed, 4 ); %SelecSolidBrsh( color7ed ); %7ond7ec( , y 1>4, 2, y , , ) ;
%Te-( (" "),2,y1>5);
%SeBk&ode(1); %Selecon( "9rial", 15, 55, alse ); %SeTe+olor( color8hie );
%SeTe9lign(5); %Selecon( "Tahoma", 14, 155 ); %SeTe+olor( colorold ); %Te-( ( " Trading Sysem "),4,y1>6); %SeTe+olor( color8hie ); %Te-( 8rie%(HJ i K, "Sell Below "HJ i K,""), 14, y135); %SeTe+olor( colorold ); %Te-( 8rie%(SellSo'2, "Shor S# "(SellSo'2),""), 14, y125); %SeTe+olor( colorBle ); %Te-( 8rie%(SellTP1, "Shor TT1 "(SellTP4),""), 14, y155); %Te-( 8rie%(SellTP2, "Shor TT2 "(SellTP2),""), 14, y?5); %Te-( 8rie%(SellTP4, "Shor TT4 "(SellTP1),""), 14, y>5); %SeTe+olor( colorold );
%Te-( ("+rren P/# " 8rieAal(%(Sell ,(SellPrice+),(SellPrice+)),2<2)), ??, y22); %Te-( ("sell Signal came " (Bar+on!ars 1) C nerFal()/1 " mins ago"), 14, y35) ; %Te- ( ("" 8rie% (sellach1, " :one "SellTP4,"")), 1>5, y155); %Te- ( ("" 8rie% (sellach2, " :one "SellTP2,"")), 1>5, y?5); %Te- ( ("" 8rie% (sellach4, " :one "SellTP1,"")), 1>5, y>5); // *.: o% Signal :is'lay Panel // LLL
%or( i = 5; i Bar+on; i ) I i%( ByJiK ) I
-GTcolor = Param+olor("-er Panel +olor",colorTeal); .GPcolor = Param+olor("nner Panel G''er",color:arkreen); .:.color = Param+olor("nner Panel #ower",color:ark-liFereen); Tile+olor = Param+olor("Tile +olor ",colorBlack); Se+harBk+olor(-GTcolor); // color o% oer !order Se+harBkradienill(.GPcolor,.:.color,Tile+olor); // color o% inner 'anel L i%( SellJiK ) I -GTcolor = Param+olor("-er Panel +olor",colorTeal); .GPcolor = Param+olor("nner Panel G''er2",color:ark7ed); .:.color = Param+olor("nner Panel #ower2",colorPlm); Tile+olor = Param+olor("Tile +olor ",colorBlack); Se+harBk+olor(-GTcolor); // color o% oer !order Se+harBkradienill(.GPcolor,.:.color,Tile+olor); // color o% inner 'anel L L
S*+T-.B*.("PiFo calc"); 'd = Param("Periods",14,6,133,1); 'ds = 2C'd1;//
(9dsmen %or 8ilders &9)
aa = +lose7e%(+lose,1);
= *&9(&a(5,aa),'ds); dd= *&9((&a(5,5aa)),'ds);
r% = %(+D2,1555,15555);
c1 = Param("G''er #eFel",5,65,@5,1); UU1 =155/(155c1)1; 1 = UU1Cdd; 2 = 1/UU1; %1 = &a(1,2); G# = +lose %1C('ds1)/2; G# = %(G#D+,[oor(G#Cr%),ceil(G#Cr%))/r%;
c2 = Param("*Uili!rim",65,65,65,5); UU2 =155/(155c2)1;// J=1K = dd; && = +lose C('ds1)/2; && = %(&&D+,[oor(&&Cr%),ceil(&&Cr%))/r%;
c4 = Param("#ower #eFel",45,15,65,1); UU4 =155/(155c4)1; 1 = UU4Cdd; 2 = 1/UU4; %4 = &in(1,2); ## = +lose %4C('ds1)/2; ## = %(##D+,[oor(##Cr%),ceil(##Cr%))/r%;
!and = Param("!and widh",3,5,16,5<26); mm = &&!and; mmd = &&!and;
W=+ross( +,##); E=+ross(G#,+);
By1= W ; Sell1= E ;
TimerameSe( in16&ineC2 ); :H=7e%(H,1); :#=7e%(#,1); :+=7e%(+,1);
'd = ( :H :# :+ )/4; sd1 = (2C'd):H; sd2 = 'd (:H :#); sd4 = Sd1 (:H:#); rd1 = (2C'd):#; rd2 = 'd (:H :#); rd4 = rd1 (:H:#);
Timerame7esore();
S*+T-.*.:();
Tile = *ncode+olor(color8hie) "#inkonXs SilFer" " " .ame() " " *ncode+olor(color7ed) nerFal(2)
*ncode+olor(color8hie) " " :ae() " " "Vn"
*ncode+olor(colorEellow) "-'"-" ""Hi"H" ""#o"#" " "+l"+" " "Aol= " 8rieAal(A) // 8rie% ((e4De36) ,*ncode+olor(color#ime) " :irecion #-.",*ncode+olor(color7ed)" :irecion SH-7T") "Vn" 8rie% (Sell , " *WT #-. / 7eFerse Signal a "+"Vn","") 8rie% (By , " *WT SH-7T / 7eFerse Signal a "+"Vn","")
8rie%(Sell , "Toal Pro$ / #oss %or he #as Trade 7s<"(+ByPrice)"","") 8rie%(By , "Toal Pro$ / #oss %or he #as rade 7s<"(SellPrice+)"","") 8rie%(#ong 9.: .-T By,*ncode+olor(color#ime) "Trade #ong *nry 'rice 7s<"(ByPrice)" Tg "G#,"") 8rie%(shr 9.: .-T Sell,*ncode+olor(color7ed) "Trade Shor *nry 'rice 7s<" (SellPrice)" Tg "##,"")"Vn" 8rie%(#ong 9.: .-T By, "+rren Pro$ / #oss 7s<"(+ByPrice)"","") 8rie%(shr 9.: .-T Sell, "+rren Pro$ / #oss 7s<"(SellPrice+)"","") *ncode+olor(colorBrighreen) "Vn 74 " *ncode+olor(color8hie)7:4 *ncode+olor(colorBrighreen) "Vn 72 " *ncode+olor(color8hie)7:2 *ncode+olor(colorBrighreen) "Vn 71 " *ncode+olor(color8hie)7:1 *ncode+olor(colorBrighreen) " GP TT " *ncode+olor(color8hie)G# *ncode+olor(colorBle) "Vn PiFo " *ncode+olor(color8hie)'d *ncode+olor(colorBle) " &:P-.T " *ncode+olor(color8hie)&& *ncode+olor(color7ed) "Vn S1 " *ncode+olor(color8hie)S:1 *ncode+olor(color7ed) " B-T TT " *ncode+olor(color8hie)## *ncode+olor(color7ed) "Vn S2 " *ncode+olor(color8hie)S:2 *ncode+olor(color7ed) "Vn S4 " *ncode+olor(color8hie)S:4;
//i% (*ndAale(By)==1) Say("srong By dear",1); //i% (*ndAale(Sell)==1) Say("srong Sell dear",1);