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

RE: [amibroker] Re: Candel Color



PureBytes Links

Trading Reference Links

Here is some code that I created to mimic as close as possible the Candle
colors that Stockcharts implements on their website.

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo
%g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) )
));

GC = C >= Ref(C,-1) AND C >= O;
BC = C >= Ref(C,-1) AND C < O;
RC = C < Ref(C,-1) AND C <= O;
OC = C < Ref(C,-1) AND C > O;
CandleColor = IIf(GC,27, IIf(BC,16,IIf(RC,32,44)));

// 25 orange  29 bright blue 33 tan 36 light blue 37 blue grey
// 41 orange yellow 44 blue green

Plot( C, "Close", CandleColor, styleNoTitle | ParamStyle("Style") |
GetPriceStyle() ); 
_SECTION_END();

/*
Rule # 1: 
"Hollow White Candle(painted as Green - found out that a white candle on a
white background just doesn't work well - duh!)"
Close today >= Close yesterday and Close today >= Open
C >= Ref(C,-1) AND C >= O

Rule # 2:  
"Filled Red Candle"    
Close today <= Close yesterday  
C < Ref(C,-1) AND C <= O

Rule # 3:  
"Black Candle"  Opens bullishly but closes bearishly
Close today >= Close yesterday and closes today lower than the open.  
C >= Ref(C,-1) AND C < O

Rule # 4:  
"Hollow Red Candle"  Opens bearishly but closes bullishly.
Open today below yesterdays close and closes today higher than the open.  
C < Ref(C,-1) AND C > O

*/

Dave
MarketMonk777

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of gnader_2000
Sent: Thursday, December 29, 2005 6:25 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Candel Color

Great! that is what I needed - the only thing I seem to be able to
change on the candels is the outline color using this type of code - I
will switch to bars and hopefully move on with my project.

Again - thanks,

George

--- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxxx> wrote:
>
> Just define the colours you want with a variable
> barcolour = iif( c>ma(c,20), colorgreen, colorred);
> plot( c, "", barcolour, stylebar );
> 
> With candles you need to check the infill of the candle as selected in
> peferences.
> You can have solid, hollow up ordown etc. Sometimes only the tails and
> outline chanes colour from the AFL, you will need to experiment. I
> find bars easier to modify colours from AFL.
> 
> --
> Cheers
> Graham
> AB-Write >< Professional AFL Writing Service
> Yes, I write AFL code to your requirements
> http://e-wire.net.au/~eb_kavan/ab_write.htm
> 
> 
> 
> On 12/30/05, gnader_2000 <zepplin@xxxx> wrote:
> > Great - thanks. I should have been said that I want to have the
> > candels color change once it is above or below an MA and as long as it
> > is say below the MA I want it to stay that color.
> >
> > Thanks again - appreciate it
> >
> >
> > --- In amibroker@xxxxxxxxxxxxxxx, K Lalchand <klal25@xxxx> wrote:
> > >
> > > Click on "Preferences"  --> "Colors"
> > >
> > > gnader_2000 <zepplin@xxxx> wrote:          Anyone know how I can
> > change the default candel stick colors?
> > >
> > >   Thanks,
> > >
> > >   George
>







Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links



 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/
 

Attachment: Description: Binary data