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

[amibroker] Question on VarSet and VarGet for Tomasz and programming gurus



PureBytes Links

Trading Reference Links

Why are you using Graph when plot is much easier and all fits all settings
into a single line

Plot(CCI (ST) , "", iif( cci(st) >= 0, iif( barssince (cross ( cci(st) , 0 )
<=5, colorpalegreen, colorgreen ),  iif( barssince (cross ( 0, cci(st) )
<=5, colorpink, colorred )), stylehistogram );


I think I have the brackets in right places, and the right number of them
:-)

Cheers,
Graham
http://e-wire.net.au/~eb_kavan/

-----Original Message-----
From: Jo [mailto:amibroker@xxxxxxxxxxxxx] 
Sent: Saturday, July 10, 2004 7:55 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Changing histogram bar color

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);




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



 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/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/