PureBytes Links
Trading Reference Links
|
Hi,
Bar color is a Joke !?
if buy is binary "0" or "1", when buy is 1 , I just want to color the
bar.
all the bar have the same color
/* Colourized price bars drawn here */
graph0 = close;
graph0style = 128;
barcolor = IIF( buy, 4, 0 );
graph0barcolor = ValueWhen( barcolor != 0, barcolor );
Sc
/*Gann HiLo3*/
pds=3;
Hl=IIf(CLOSE>Ref(Ma(H,pds),-1),
/*then*/ 1,
/*else*/ IIf(CLOSE<Ref(Ma(L,pds),-1),
/*then*/ -1,
/*else*/ 0));
Hv=ValueWhen(HL != 0,HL,1);
Hilo3=IIf(Hv=-1,
/*then*/Ma(H,pds),
/*else*/Ma(L,pds));
/*Gann HiLo20*/
pds=20;
Hl=IIf(CLOSE>Ref(Ma(H,pds),-1),
/*then*/ 1,
/*else*/ IIf(CLOSE<Ref(Ma(L,pds),-1),
/*then*/ -1,
/*else*/ 0));
Hv=ValueWhen(HL != 0,HL,1);
Hilo20=IIf(Hv=-1,
/*then*/Ma(H,pds),
/*else*/Ma(L,pds));
/*Gann HiLo50*/
pds=50;
Hl=IIf(CLOSE>Ref(Ma(H,pds),-1),
/*then*/ 1,
/*else*/ IIf(CLOSE<Ref(Ma(L,pds),-1),
/*then*/ -1,
/*else*/ 0));
Hv=ValueWhen(HL != 0,HL,1);
Hilo50=IIf(Hv=-1,
/*then*/Ma(H,pds),
/*else*/Ma(L,pds));
Trend=Hilo20>Hilo50;
Retrace=c<hilo3 and H< Ref(H,-1)
AND L< Ref(L,-1);
Entry= Trend AND retrace ;
Buy=Ref(Entry,-1) AND H>(Ref(H,-1)*1.0025);
Buy=buy==1 and ref(buy,-1)==0;
/*stoploss*/
Red=cross(hilo3,c);
StopLoss1= valuewhen(buy ,
LLV(L,peakbars(red,1,1)+1));
StopLoss2= valuewhen(buy ,
LLV(L,peakbars(red,1,2)+1));
Stoploss=max(stoploss1,stoploss2) *0.99;
Entryprice=iif(Buy,close,0);
Risk= IIf(Entryprice!=0,(entryprice-stoploss)
/stoploss,0)*100;
Buy=Buy!=0 and risk!=0 and Risk<12;
graph1=Buy;
/* Colourized price bars drawn here */
|