[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

Try this.. thanks to Thomas Zmuck/Anthony Faragasso, I edited the formula a bit
 

// MultiCharts
// Multiple charts normalized to left edge
// K Close 8/2/02
// support code from Thomas Zmuck/Anthony Faragasso
//
// Define the funds or indexes you want on the chart here
//

Stock1 = "^SPC"; //change to the 1st stock that you want to compare with
Stock2 = "^NDX"; //change to the 2nd stock that you want to compare with
Stock3 = "^IWM"; //change to the 3rd stock that you want to compare
Stock4 = "QQQQ"; //change to the 4th stock that you want to compare

Fn1=Foreign(Stock1,"C");
Fn2=Foreign(Stock2,"C");
Fn3=Foreign(Stock3,"C");
Fn4=Foreign(Stock4,"C");
//

barvisible = Status("barvisible");

//firstvisiblebar = barvisible AND NOT Ref( barvisible, -1 );
FVB = barvisible AND NOT Ref( barvisible, -1 );

//closevisible = ValueWhen(FVB,C) ;
CVB = ValueWhen(FVB,C) ;
//Plot( Close, "Price", colorBlack );
//Plot( CVB, "closeVisible", colorRed );

Pt1=100*(Fn1/ValueWhen(FVB,Fn1)-1);
Pt2=100*(Fn2/ValueWhen(FVB,Fn2)-1);
Pt3=100*(Fn3/ValueWhen(FVB,Fn3)-1);
Pt4=100*(Fn4/ValueWhen(FVB,Fn4)-1);

Price=C;
PtBase=100*(Price/CVB-1);

Plot(PtBase, Name(), colorBlue, styleThick);
Plot(Pt1, Stock1, colorRed, styleThick);
Plot(Pt2, Stock2, colorOrange, styleThick);
Plot(Pt3, Stock3, colorGreen, styleThick);
Plot(Pt4, Stock4, colorBlack, styleThick);

 

- Wilson

On 5/31/05, a1ex_douglas <a1ex_douglas@xxxxxxxxx> wrote:
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







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