logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
royttm  
#1 Posted : Tuesday, May 11, 2010 2:31:07 AM(UTC)
royttm

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 3/27/2006(UTC)
Posts: 41
Location: Singapore

Dear friends, Is there a possibility of creating a % Price Performance on the left hand side of the Metastock chart like the way stockcharts do? How can I do that? UserPostedImage Thanks in advance if anyone could render an assistance. - Roy
royttm  
#2 Posted : Wednesday, June 23, 2010 9:15:20 AM(UTC)
royttm

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 3/27/2006(UTC)
Posts: 41
Location: Singapore

Finally, after much exploring, I've come out something similar.
The code for Indicator is as follows:

Code for Indicator:

-----------------------8<------------------------------------------------
{ User inputs }
Periods:=Input("Weeks: [1]13, [2]26, [3]52, [4]User-defined",1,156,52);

Index:=Security("D:\Metastock Data\Indices\^GSPC",C);

{Index % Performance}
IndexDataArray:=Index;
IndexValueatPeriod:=LastValue(Ref(IndexDataArray,-Periods+1));
IndexPerformance:=((Index- IndexValueatPeriod)/IndexValueatPeriod)*100;

{Data % Performance}
DataArray:=C;
DataValueatPeriod:=LastValue(Ref(DataArray,-Periods+1));
DataPerformance:=((C- DataValueatPeriod)/DataValueatPeriod)*100;

{Plot Index & Data % Performance wrt Period ago}
IndexPerformance;
DataPerformance

-----------------------8<------------------------------------------------
royttm  
#3 Posted : Thursday, June 24, 2010 8:47:48 AM(UTC)
royttm

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 3/27/2006(UTC)
Posts: 41
Location: Singapore

In order to explore stock with % Price Performance (both 52 & 13 week) that are stronger than the index (S&P500), I use the following code:

----------------8<---------------
Column A:
Periods:=52;
Index:=Security("D:\Metastock Data\Indices\^GSPC",C);
ROC(Mov((C/Index),Periods,S),1,%)

Column B:
Periods:=13;
Index:=Security("D:\Metastock Data\Indices\^GSPC",C);
ROC(Mov((C/Index),Periods,S),1,%)

Filter Column:
colA>0 AND colB>0

----------------8<---------------

Note: In Explorer Editor, Options is set to "Weekly" instead of "Daily"
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.