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

[amibroker] Re: Can you have more than two colors on a ribbon?



PureBytes Links

Trading Reference Links

There may be several ways to do this.

A simple way would be to create 4 ribbons, giving each a different 
height. Then the 4 conditions would appear in its own ribbon.

Here is some sample code for 2 ribbons. Yahoo might split the code 
lines, but you should get this to work easily.

//two ribbons for up down signals
up5x20 = EMA(Close,5)>EMA(Close,20); down5x20 = NOT up5x20;
Plot( 10, /* defines the height of the ribbon in percent */
	"Ribbon", IIf( up5x20, colorGreen, IIf( down5x20, colorRed, 
0 )), /* choose color */
	styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );

up3x10 = EMA(Close,3)>EMA(Close,10); down3x10 = NOT up3x10;
//Plot( Close, "Price", colorBlue, styleCandle );
Plot( 20, /* defines the height of the ribbon in percent */
	"Ribbon", IIf( up3x10, colorGreen, IIf( down3x10, colorRed, 
0 )), /* choose color */
	styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );


--- In amibroker@xxxxxxxxxxxxxxx, "theoldchartreader" 
<theoldchartreader@xxxx> wrote:
> Hi,
> I have four conds that I would like to color code using the 
> ribbon,can this be done?
> 
> 
> thank you,
> Dennis


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/