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

RE: [amibroker] Gradient Coloring



PureBytes Links

Trading Reference Links

Figured it out.  Was using ColorHSB instead of ColorRGB function.  Here is
the code for my 1 Day Percentage Loss Exploration.

For those who do not get the attachments, I will post it over at the
Amibroker-AFL yahoo group in the files section under the TC2005 Related
folder.

Have a great weekend.

Dave
MarketMonk777 

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of marketmonk777
Sent: Saturday, July 15, 2006 12:19 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Gradient Coloring

Hi folks,

I have a neat TradeStation RadarScreen indicator that I am trying to
duplicate with Amibroker.  I like to display were today's close ends up in
relation to today's trading range as well as the 21 day period and 52 week
period.  But I have the cell change from Red (0%) to Green (100%).  

I am close but it's not quite what I want as with AB and the ColorHSB
function it displays too many colors in between Red and Green and isn't a
Gradient between just those two colors.

If anyone can think of a way to do this please let me know.

Here is the code for determining the % range over today, 21 days, 250 days
and displaying those values as well as changing of the background cell in an
Exploration Results window.


//  % of 1 Day, 21 Day, and 250 Day Range
P1TR = ( (C - L) / (H - L) ) * 100 ;
// formula to
calculate the close % of today's range
AddColumn(P1TR, "% 1DR", 3.1,  colorBlack,
ColorHSB(P1TR,255,255), 50);						//
Display the % of today's range
that the close was at

HH = HHV(H,21);
// Highest High over last 21 days
LL = LLV(Low,21);
// Lowest Low over last 21 days
P21DR = ( (Close - LL) / (HH - LL) ) * 100;
// Calculate
where the close is in relation to this 21 day range AddColumn(P21DR,
"%21DR", 3.1, colorBlack,
ColorHSB(P21DR,255,255), 60);					// Display
this value (% of 21 Day
Range)

HH250 = HHV(H,250);
// Highest High over last 250 days
LL250 = LLV(L,250);
// Lowest Low over last 250 days
P250DR = ( (Close - LL250) / (HH250 - LL250) ) * 100;
//
Calculate where the close is in relation to this 250 day range
AddColumn(P250DR, "%250DR", 3.1, colorWhite,
ColorHSB(P250DR,255,255), 60);					// Display
this value (% of 250 Day
Range)

// Display various trading range values
AddColumn(H-L, "T R", 2.2, colorWhite, colorDarkRed,50);
//
adds a column for today's range
AddColumn(ATR(5), "5d ATR ", 2.2, colorWhite,
colorDarkRed,60);
// adds a column for 5 day ATR
AddColumn(ATR(21), "21d ATR", 2.2, colorWhite,
colorDarkRed,60);
// adds a column for 21 day ATR


I plan to work on this but thought I would post what I have tried so far.

Regards,

Dave
MarketMonk777





------------------------ Yahoo! Groups Sponsor --------------------~--> See
what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/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