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

Re: [amibroker] Setting the start date for "Relative Performance" indicator



PureBytes Links

Trading Reference Links

I modified some part of the code.. it looks good! thanks Terry!
 
 
"INDEX RelStrength";
"Indexes will MATCH at Selected Bar";

BaseStock = "^PSI";
constant = SelectedValue(Foreign(BaseStock,"C"));

/* RelStrength of the Base */
Base = Foreign( BaseStock, "C" )/Foreign( BaseStock, "C" ) *100 / (SelectedValue(Foreign(BaseStock,"C"))/constant);
Plot(Base , BaseStock, colorRed, styleThick); //base is always 100%

mystock = Foreign( Name(), "C" )/Foreign( BaseStock, "C" ) *100 / (SelectedValue(Foreign(Name(),"C"))/constant);
Plot(mystock , Name(), colorBlue, styleThick|styleNoTitle); //mystock is 100% at the selected bar

 
- Wilson

 
On 6/1/05, Terry <MagicTH@xxxxxxxxxxx> wrote:
Try this code. It doesn't have selectable tickers, but it does what you
want:

"INDEX RelStrength";
"Indexes will MATCH at Selected Bar";

constant = SelectedValue(Foreign("^SPC","C"));

/* RelStrength of the NDX */
ndx = Foreign( "^NDX", "C" )/Foreign( "^SPC", "C" ) * 1000 /
(SelectedValue(Foreign("^NDX","C"))/constant);
Plot(ndx ,"^NDX", colorWhite,styleThick);

/* RelStrength of the COMP */
Comp = Foreign( "IWM", "C" )/Foreign( "^SPC", "C" ) * 1000 /
(SelectedValue(Foreign("IWM","C"))/constant);
Plot(Comp ,"IWM",colorBlue,styleThick);

/* RelStrength of the RUT */
Comp = Foreign( "QQQQ", "C" )/Foreign( "^SPC", "C" ) * 1000 /
(SelectedValue(Foreign("QQQQ","C"))/constant);
Plot(Comp ,"QQQQ", colorGreen,styleThick);

/* RelStrength of the RYVYX */
Comp = Foreign( "SMH", "C" )/Foreign( "^SPC", "C" ) * 1000 /
(SelectedValue(Foreign("SMH","C"))/constant);
Plot(Comp ,"SMH", colorViolet,styleThick);

/* RelStrength of the RYVNX
Comp = Foreign( "RYVNX", "C" )/Foreign( "^SPC", "C" ) * 1000 /
(SelectedValue(Foreign("RYVNX","C"))/constant);
Plot(Comp ,"Venture RS",colorRed,styleThick);*/

--
Terry


| -----Original Message-----
| From: amibroker@xxxxxxxxxxxxxxx
| [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of a1ex_douglas
| Sent: Tuesday, May 31, 2005 8:47 AM
| To: amibroker@xxxxxxxxxxxxxxx
| Subject: [amibroker] Setting the start date for "Relative
| Performance" indicator
|
|
| Is there a way to set the start date for the "Relative Performance"
| Indicator?  As it is, it simply resets all securities to "0" at the
| far left-hand side of the screen and allows the relative performance
| to unfold across the screen - but there doesn't appear t obe an easy
| way to elect which date is the first visible date on the screen (&
| thus the first date of the "Relative Performance").
|
| Any ideas?
|
| Many thanks,
| Alex.
|
| alexdouglas@xxxxxxxxx
|
|
|
|
|
|
|
| ------------------------ Yahoo! Groups Sponsor
| --------------------~-->
| What would our lives be like without music, dance, and
| theater? Donate or volunteer in the arts today at Network for
| Good! http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/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
|
|
|

|
|



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



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