question b is not clear what you are trying to color.
Is this what you meant?

RelStrength1 = EMA(Close,5) / Foreign("^GSPC","close");
RelStrength2 = EMA(Close,5) / Foreign("^Vix","close");
RelStren1 = RelStrength1 / Sum(RelStrength1,10);
RelStren2 = RelStrength2 / Sum(RelStrength2,10);
Color1 = IIf(RelStren1 > Ref(RelStren1 ,-1),colorBlue,colorYellow);
Color2 = IIf(RelStren2 > Ref(RelStren2 ,-1),colorBrightGreen,colorDarkRed);
Plot(RelStren1,"RS1", ColorBlue /*Color1*/ ,1);
  
// Replace ColorBlue 
/*Color1*/   above with Color1 if you want both lines to be color referenced
Plot(RelStren2,"RS2",Color2 ,4);

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]On Behalf Of frankwal
Sent: Sunday, September 17, 2006 4:15 PM
To: [email protected]
Subject: [amibroker] Relative Strength with color

I have AB for 2 months

Here is a Relative strength indicator .....

/* Relative Strength Comparison with Relative Strength Moving Average

compare to SP 500
compare to Vix - Volatility

Normalize
Plot

*/

RelStrength1 = EMA(Close,5) / Foreign("^GSPC","close");
RelStrength2 = EMA(Close,5) / Foreign("^Vix","close");

RelStren1 = RelStrength1 / Sum(RelStrength1,10);
RelStren2 = RelStrength2 / Sum(RelStrength2,10);

Plot(RelStren1,"RS1",colorBlue,5);
Plot(RelStren2,"RS1",colorGreen,5);

a
It works
Is this good & efficient syntax
can it be reduced

b
can the plot color be changed ;
eg. if Plot(today) > plot(yesterday) then green else red

__._,_.___

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






SPONSORED LINKS
Software support Small business finance Business finance online
Business finance training Business finance course

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to