Rank: Member
Groups: Registered, Registered Users Joined: 7/26/2011(UTC) Posts: 21
|
For some of the securities I am analysing, there is no trading om some days due low liquidity. When I calculate eg. MOV (xx, 20, S) I want to use the previous days share price, if there has been no trading on current day. In other words I want to be able calculate the moving average for the last 20 days, where the stock exchange has been open. I do no want to calculate the last 20 trading days as there be several days in between with no trading. I know other softwares, which has a "fill-in" function. But how to do this in Metastock?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 5/13/2005(UTC) Posts: 715 Location: Midwest, USA
Was thanked: 1 time(s) in 1 post(s)
|
Metastock does that automatically. You can adjust the display via TOOLS -- OPTIONS -- CHART OPTIONS, and check "IGNORE WEEKEND DATA".
If you want the 20 day MA not including today, use the REF() function.
MA20:=mov(c,20,s); ref(MA20,-1);
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 7/26/2011(UTC) Posts: 21
|
Thanks for your reply. My problem is that there is no trading sometimes on a Tuesday or Friday even though the stock exchange is open. Unfortunately this is the case with some stocks on the Danish stock exchange. Therefore, if there is no trading I want to use the previous trading days closing price for calculations af eg. moving average. The "IGNORE WEEKEND DATA" can not be used in that connection. It is actually in the Explore I need this. I hope you or another person has a suggestion. And thnaks again for your reply.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Hi Torben
There is one method I know of that might help you produce an MA for the last 20 market-open days rather than for the last 20 days that a security was actually traded. Unfortunately this method does not lend itself to being exploited by an exploration.
The Security() function gives you the ability to call a security and plot it on an index. Not only can you plot the price of the security with missing data but you can plot most indicators based on the price too, including most moving averages. The Security() function will "fill in" the missing data bar prices from the target security something like this - ValueWhen(1, C<>"N/A", C). In other words the Security() function (plotting on an index with all data bars) will plot the last available price of the target security on each bar of the index until there's a new valid price available. The result is that your target security price plot will "flat line" when there is missing data, but the flat-line elements form the missing-bar prices that you need for the SMA data array.
The problem with this ability of the Security() function is that there's no way that i know of to use it to your advantage when exploring a portfolio or folder of securities - it can really only be used by calling one security at a time while using an index as the active chart. I've puzzled over how to use this (Security() function) characteristic in an exploration a number of times and never yet come up with an acceptable solution.
Roy
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 5/13/2005(UTC) Posts: 715 Location: Midwest, USA
Was thanked: 1 time(s) in 1 post(s)
|
Roy - Could the "P" variable interaction be exploited for this?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Hi Johnathan
I don't think so but I'll look at it and come back to you if there's anything new to report.
Roy
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 7/26/2011(UTC) Posts: 21
|
Hi, Thanks for your reply. I will try out the Security function even though I understand that I can not use this correctly in the explorer.
|
|
|
|
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.