[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] ColorBars



PureBytes Links

Trading Reference Links

Stephane,

Barcolor simply works, it just the formula is wrong.

Your
> barcolor = IIF( buy, 4, 0 );
> graph0barcolor = ValueWhen( barcolor != 0, barcolor );

assigns always 4 to graph0barcolor.

You should just use simply:
graph0barcolor = IIF( buy, 4, 1 );

( Full example here:
buy = cross( macd(), 0 );
graph0=close; graph0style=64;
graph0barcolor = IIF( buy, 4, 1 );
)


Best regards,
Tomasz Janeczko
===============
AmiBroker - the comprehensive share manager.
http://www.amibroker.com


----- Original Message -----
From: "Stephane Carrasset" <nenapacwanfr@xxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Sunday, September 09, 2001 11:11 PM
Subject: [amibroker] (unknown)


> 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 */
>
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>