PureBytes Links
Trading Reference Links
|
I'm trying to refine a CCI indicator by changing the bar color after
the 5th bar above or below the 0 line. The indicator is almost
complete but I'm stuck on changing the histogram bar color.
Basics are;
if barcount since cross above 0 line < 6, barcolor = palegreen else
barcolor = green
if barcount since cross below 0 line < 6, barcolor = pink else
barcolor = red
AFL code so far is:
/* Woodie's CCI V3*/
//Standard CCI
ST = 21;
//Turbo CCI
T = 8;
MaxGraph = 5;
LSMA25 = LinearReg( Close, 25 );
LSMA45 = LinearReg( Close, 45 );
//Plot Standard CCI
Graph2 = CCI (ST);
Uptrend = 1; Downtrend = -1;
//Color bars Green > 0, Red < 0
Graph2BarColor = IIf (Graph2 > uptrend, colorGreen, IIf (Graph2 <
downtrend,4,6));
Graph4 = Graph2;
Graph4Style = 4;
//Plots Turbo CCI
Plot(CCI (T),"Turbo",colorYellow,styleLine);
Plot(2,"ribbon", IIf (C>LSMA25,
colorGreen,colorRed),styleArea|styleNoLabel, 1, 1000 );
// Plot range lines
Plot(200,"",colorRed);
Plot(-200,"",colorRed);
Plot(100,"",colorBlue);
Plot(-100,"",colorBlue);
PlotGrid(50,colorBlack);
PlotGrid(-50,colorBlack);
PlotGrid(150,colorBlack);
PlotGrid(-150,colorBlack);
Title = " " + Name () + " " + FullName() + " " + "CCI period" + "
=" + WriteVal(ST);
------------------------ Yahoo! Groups Sponsor --------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|