in Search

Indicator Plotting

Last post 11-05-2007, 8:58 by Branden Russell. 5 replies.
Sort Posts: Previous Next
  •  11-03-2007, 5:01 25676

    Indicator Plotting

    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

  •  11-05-2007, 8:15 25685 in reply to 25676

    Re: Indicator Plotting

    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.


    Equis International, Inc.
    A Thomson Reuters Company
    90 S. 400 W Suite 620
    SLC, UT 84101
  •  11-05-2007, 8:22 25687 in reply to 25685

    Re: Indicator Plotting

    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.

  •  11-05-2007, 8:39 25688 in reply to 25687

    Re: Indicator Plotting

    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.


    Equis International, Inc.
    A Thomson Reuters Company
    90 S. 400 W Suite 620
    SLC, UT 84101
  •  11-05-2007, 8:45 25689 in reply to 25688

    Re: Indicator Plotting

    ok groovy, thanks for the help.
  •  11-05-2007, 8:58 25690 in reply to 25689

    Re: Indicator Plotting

    You're welcome. Good luck.

    Equis International, Inc.
    A Thomson Reuters Company
    90 S. 400 W Suite 620
    SLC, UT 84101
View as RSS news feed in XML