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

Re: [amibroker] Comparing two or more stocks price movement



PureBytes Links

Trading Reference Links

Is this what you had in mind.

MaxGraph = 10; // as many as you wish to use
startpoint = 10; // the start point of comparision will be 10th bar

price = Close;//current chart opened

//insert your other tickers here
ticker2="^DJI";
ticker3="IBM";
ticker4="MSFT";

tickervalue = 100 * ( price/ValueWhen( Cum(1) == startpoint, price ) - 1
);
Plot(tickervalue,Name(),colorRed,styleLine);

// you can change the ticker below
price = Foreign(ticker2, "C");
ticker2value = 100 * ( price/ValueWhen( Cum(1) == startpoint, price ) -
1 );
Plot(ticker2value,"",colorWhite,styleLine);

// you can change the ticker below
price = Foreign(ticker3, "C");
ticker3value = 100 * ( price/ValueWhen( Cum(1) == startpoint, price ) -
1 );
Plot(ticker3value,"",colorBlue,styleLine);

// you can change the ticker below
price = Foreign(ticker4, "C");
ticker4value = 100 * ( price/ValueWhen( Cum(1) == startpoint, price ) -
1 );
Plot(ticker4value,"",colorYellow,styleLine);

Title="COMPARATIVE OVERLAY"+"\n"+"\n"+EncodeColor(colorRed) +Name()+"
="+WriteVal(tickervalue,1.2)+"\n"+EncodeColor(colorWhite)+ticker2+"
="+WriteVal(ticker2value,1.2)+"\n"+EncodeColor(colorBlue)+ticker3+"
="+WriteVal(ticker3value,1.2)+"\n"+EncodeColor(colorYellow)+ticker4+"
="+WriteVal(ticker4value,1.2);

Anthony
pushshanmugam wrote:

>  Do I have to write a code for comparing two ore more stock/index
> price movement? Or is there any easy way to do this - something
> similar to MSN chart control's compare with or in Medvad
> QuoteTracker's compare with feature?
>
> Pushparaj
>
>
>                    Yahoo! Groups Sponsor
                        ADVERTISEMENT


>
> 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 the Yahoo! Terms of Service.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Your own Online Store Selling our Overstock.
http://us.click.yahoo.com/rZll0B/4ftFAA/46VHAA/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/