in Search

How do I find the High value of a Low day?

Last post 03-05-2009, 17:14 by wabbit. 2 replies.
Sort Posts: Previous Next
  •  03-05-2009, 12:48 29108

    How do I find the High value of a Low day?

    Hi,
     I am trying to find the high value of a low occurred within the last 5 periods

    { LowPeriod will contain  how many periods ago the low occurred }
    LowPeriod     := llvbars(C,5);


    { CurHigh should  contain the High value of  the bar that presented the Lowest value}
    CurHigh       := ref(H, LowPeriod);


    This should work, but I am given an error message that the ref() function  can accept the Period value just as a constant, not as a variable. How can I solve this in a different way?

    Thanks in advance
    Renato
  •  03-05-2009, 13:49 29111 in reply to 29108

    Re: How do I find the High value of a Low day?

    Hi,

    You can solve your problem by using the variable REF function found in the forum DLL

    CurHigh:= ExtFml( "Forum.Ref", H, LowPeriod);

    You can freely download the latest version from the download section:
    http://forum.equis.com/files/3018/programming_files/entry19695.aspx

    Best regards,
    Bulli
  •  03-05-2009, 17:14 29112 in reply to 29111

    Re: How do I find the High value of a Low day?

    I think you might find the ValueWhen() function will work faster than the external function call:

    { LowPeriod will contain  how many periods ago the low occurred }
    LowPeriod     := llvbars(C,5);

    { CurHigh should  contain the High value of  the bar that presented the Lowest value}
    CurHigh       := ValueWhen(1, LowPeriod=0, H);


    Hope this helps.

    wabbit Big Smile [:D]



    "The question of whether a computer can think is no more interesting than the question of whether a submarine can swim."
    Edsgar W. Dijkstra

     

    MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC C, 11 PRO w/QC & MDK
    For custom MetaStock programming : http://www.wabbit.com.au
    My SkyPE status :
    My SkyPE account : wabbit.com.au

View as RSS news feed in XML