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?

Thanks in advance if anyone could render an assistance.
- Roy
|
|
|
|
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<------------------------------------------------
|
|
|
|
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.