Rank: Newbie
Groups ready for retrieval: 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
|
|
|
|
Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,960
Thanks: 92 times Was thanked: 155 time(s) in 150 post(s)
|
Originally Posted by: jhmathisjr 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.
|
|
|
|
Rank: Newbie
Groups ready for retrieval: 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
|
|
|
|
Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,960
Thanks: 92 times Was thanked: 155 time(s) in 150 post(s)
|
Originally Posted by: jhmathisjr 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 |
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.