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

Notification

Icon
Error

Options
Go to last post Go to first unread
ArmyofTheLostToys  
#1 Posted : Saturday, November 3, 2007 5:01:29 AM(UTC)
ArmyofTheLostToys

Rank: Member

Groups: Registered, Registered Users
Joined: 2/23/2006(UTC)
Posts: 11

Hello Metastocker’s

Wonder if someone can tell me if this is possible:

I have created an indicator via the MDK which will determine (using dow theory) if the security is trending up or down. The indicator will return only the security’s closing value where the trend changes. Example:

The security starts at 10 (01-Jan-07), up trend until close reaches 50 (31-Mar-07) then down trend until close reaches 20 (30-Jun-07), then up trend until close reaches 60 (31-Aug-07).

Ideally I would like the indicator to draw a straight line from 10 (01-Jan-07) to 50 (31-Mar-07) to 20 (30-Jun-07) to 60 (31-Aug-07).

Currently I am getting a line from 10 (01-Jan-07) down to 0 until the 31-Mar-07 then up to 50, then back down to zero until the 30-Jun-07 then up to 20, then back to zero then up to 60 on the 31-Aug-07.

That make sense?

Almost need to assign psResultRec->psResultArray->pfValue a NULL value so that it's not plotted on the chart????

Thanks,

Shaun

Branden Russell  
#2 Posted : Monday, November 5, 2007 8:15:48 AM(UTC)
Branden Russell

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/28/2005(UTC)
Posts: 276
Location: Salt Lake City, UT

The array of values you return to MetaStock must have the same number of points as the one you were given.
You can return 10 for every day from 01-Jan-07 until 30-Mar-07 and then 50 until 29-Jun-07, etc.
That will give you a straight line from one value to the next.

ArmyofTheLostToys  
#3 Posted : Monday, November 5, 2007 8:22:26 AM(UTC)
ArmyofTheLostToys

Rank: Member

Groups: Registered, Registered Users
Joined: 2/23/2006(UTC)
Posts: 11

thanks branden, i was hoping for a line from 10 to 50, not one that stayed at 10 until 30th mar that then spiked up to 50. does that mean it cant be done? other than maybe manually calculating it.

Branden Russell  
#4 Posted : Monday, November 5, 2007 8:39:44 AM(UTC)
Branden Russell

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/28/2005(UTC)
Posts: 276
Location: Salt Lake City, UT

Just to clear up what I said earlier, though it doesn't affect the answer for you:
You can start your data after the start date of what is passed in.
You can also end your data before the end date of what is passed in.
You do that by setting first and last valid on the result.

More for you:
Unfortunately though, there isn't any concept of an NA or another way to skip dates inbetween the values you want to return.
So your choices are to calculate the slope yourself, in your DLL, or to have a step look and return 10's, then 50's, etc.

ArmyofTheLostToys  
#5 Posted : Monday, November 5, 2007 8:45:30 AM(UTC)
ArmyofTheLostToys

Rank: Member

Groups: Registered, Registered Users
Joined: 2/23/2006(UTC)
Posts: 11

ok groovy, thanks for the help.
Branden Russell  
#6 Posted : Monday, November 5, 2007 8:58:34 AM(UTC)
Branden Russell

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/28/2005(UTC)
Posts: 276
Location: Salt Lake City, UT

You're welcome. Good luck.
Users browsing this topic
Guest (Hidden)
Similar Topics
Indicator plotting percentage price is above or below a moving average (MetaStock)
by Black Swan 6/3/2011 1:14:13 AM(UTC)
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.