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

Notification

Icon
Error

Options
Go to last post Go to first unread
jhmathisjr  
#1 Posted : Friday, March 24, 2023 3:14:20 AM(UTC)
jhmathisjr

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2022(UTC)
Posts: 4
Location: VA

Hello,

Need assistance in writing a formula for a MACD Crossover on a Weekly basis. In other words, a MACD crossover as it occurs on a Weekly chart

Thanks

MS Support  
#2 Posted : Friday, March 24, 2023 2:12:02 PM(UTC)
MS Support

Rank: Advanced Member

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

Thanks: 85 times
Was thanked: 154 time(s) in 150 post(s)
Originally Posted by: jhmathisjr Go to Quoted Post

Hello,

Need assistance in writing a formula for a MACD Crossover on a Weekly basis. In other words, a MACD crossover as it occurs on a Weekly chart

Thanks

Hello,

The MetaStock formula language calculates on the interval of the chart. So if you are looking at a Weekly chart, a formula plotted on this chart would be operating off weekly values.

The basic formula for MACD crossing its (9 period exponential) signal line (using the built-in MACD function) is:

{Cross Up}

Code:
Cross(MACD(),Mov(MACD(),9,E))

{Cross Down}

Code:
Cross(Mov(MACD(),9,E),MACD())

Things get a bit more complicated if you want to calculate a Weekly MACD from Daily data, which essentially requires "compressing" the data programmatically. Such formulas can vary in complexity, accounting for holidays, differing end-of-week dates, etc.

jhmathisjr  
#3 Posted : Friday, March 24, 2023 3:11:41 PM(UTC)
jhmathisjr

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2022(UTC)
Posts: 4
Location: VA

Hello, Thanks for your reply - so here's what I'm wanting to do, write an exploration that executes the following: - Detect securities in which the MACD has previously crossed on a WEEKLY basis and - Detect from these securities when a MACD crossover has occurred on a DAILY basis (I know the formula for this) Thanks
MS Support  
#4 Posted : Monday, March 27, 2023 3:18:46 PM(UTC)
MS Support

Rank: Advanced Member

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

Thanks: 85 times
Was thanked: 154 time(s) in 150 post(s)

Originally Posted by: jhmathisjr Go to Quoted Post
Hello, Thanks for your reply - so here's what I'm wanting to do, write an exploration that executes the following: - Detect securities in which the MACD has previously crossed on a WEEKLY basis and - Detect from these securities when a MACD crossover has occurred on a DAILY basis (I know the formula for this) Thanks

You can run an exploration on the Weekly interval using the same formula, but if you want to have it all in one report using Daily data, then the formula gets more complicated as mentioned. Others have discussed this on the forum in the past, you can check out topics like https://forum.metastock.com/posts/m170829-Using-both-daily-and-weekly-data-in-one-exploration for some examples.

If that does not suffice and you are unable to get further help here, you can always request custom formula work via https://www.metastock.com/customer/resources/formulas/customformulaform.aspx

Users browsing this topic
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.