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

Notification

Icon
Error

Options
Go to last post Go to first unread
julianc  
#1 Posted : Wednesday, November 11, 2015 1:28:27 AM(UTC)
julianc

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 11/11/2015(UTC)
Posts: 3

Hello,

I need to fill in a table for all the months of the year with ROC% calculating price % changes from the first trading day of the month until the last trading day of the month, for several consecutive years.

How to do this in Explorer?

Beginner Metastock programmer willing to learn.

Thank you in advance,

Julian

 

 

 

 

 

 

Edited by user Wednesday, November 11, 2015 1:30:27 AM(UTC)  | Reason: Not specified

julianc  
#2 Posted : Wednesday, November 11, 2015 1:26:21 PM(UTC)
julianc

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 11/11/2015(UTC)
Posts: 3

 

By the way, I tried formulas like

Ref(ROC(C,21,%),-231)

Ref(ROC(C,19,%),-210), etc. up to December

but I did not get the real results.

Trading days in USA change monthly from 19 (February) to sometimes 23 and I do not know how to program by using the 'month' and 'year' formulas.

 

 

 

 

 

 

MS Support  
#3 Posted : Thursday, November 12, 2015 5:24:48 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,955

Thanks: 91 times
Was thanked: 155 time(s) in 150 post(s)
You could try the following formula to see if this helps. The value represented is basically always a month behind (so over the November price points you would see October's Monthly Rate of Change) {1 Month Ago Rate of Change Using Daily Data} X:=ValueWhen(2,ROC(Month(),1,$) <> 0,C);{First Day of Month Close} Y:=ValueWhen(1,ROC(Month(),1,$) <> 0,Ref(C,-1));{Last Day of Month Close} ((X-Y) / X) * 100 {2 Month Ago Rate of Change Using Daily Data} X:=ValueWhen(4,ROC(Month(),1,$) <> 0,C);{First Day of Month Close} Y:=ValueWhen(3,ROC(Month(),1,$) <> 0,Ref(C,-1));{Last Day of Month Close} ((X-Y) / X) * 100 {3 Month Ago Rate of Change Using Daily Data} X:=ValueWhen(6,ROC(Month(),1,$) <> 0,C);{First Day of Month Close} Y:=ValueWhen(5,ROC(Month(),1,$) <> 0,Ref(C,-1));{Last Day of Month Close} ((X-Y) / X) * 100 The Explorer is designed primarily to give you a value over a specific date. There is an "Inspect" button in the exploration report that also lets you see the historical values (depending on if using Load Minimum Records or Loading X number of Records). You could use up to 12 columns in the explorer, modifying the above formula to look back additional months. You would just keep adding +2 to each ValueWhen statement
julianc  
#4 Posted : Sunday, November 15, 2015 8:05:50 PM(UTC)
julianc

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 11/11/2015(UTC)
Posts: 3

Hello there,

I took my time, counted every trading day, and came up with these formulas for years when there are 252 trading days in USA.

Jan         Ref(ROC(C,19,%),-232)           20 trading days,19 to calculate on

                                                           252 trading days – 20 trading days for Jan = 232 to push ROC back

Feb        Ref(ROC(C,18,%),-213)

 

March  Ref(ROC(C,21,%),-191)

 

April       Ref(ROC(C,20,%),-170)

 

May       Ref(ROC(C,19,%),-150)

 

June      Ref(ROC(C,21,%),-128)

 

July        Ref(ROC(C,21,%),-106)

 

Aug        Ref(ROC(C,20,%),-85)

 

Sep        Ref(ROC(C,20,%),-64)

 

Oct         Ref(ROC(C,21,%),-43)

 

Nov        Ref(ROC(C,21,%),-23)

 

Dec        ROC(C,21,%)

One has to bear in mind that the number of trading days always changes monthly and sometimes yearly.

252 trading days in 2010, but only 250 in 2012.

I started in The Explorer but it can also be done in Expert Advisor.

Steve Achelis is great!

And ‘MS Support’ is great too.

 

Thank you for helping.

 

 

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.