in Search

HiLo between dates with single date input not plotting correctly

Last post 02-04-2009, 10:57 by aksh. 2 replies.
Sort Posts: Previous Next
  •  02-02-2009, 6:23 28759

    HiLo between dates with single date input not plotting correctly

    Hi Wabbit,

    Need your help here. What's wrong with the following code? It's not plotting the high/low between the entered dates but plots the highest/lowest points on the chart.

    -------------------------------------------------------------------------------------------------

     {Date Inputs}

    fmDate:=Input("Start yyyymmdd (0=last trade)",0,20201231,20060101);
    toDate:=Input("End yyyymmdd (0=last trade)",0,20201231,0);

     {Period between dates}
    period:=ExtFml("Forum.DateRange", fmDate, toDate);

     {High/Low}

    hi:=Highest(ValueWhen(1,period,H));

    lo:=Lowest(ValueWhen(1,period,L));

    hi;lo

    -------------------------------------------------------------------------------------------------

    aksh

  •  02-02-2009, 20:14 28767 in reply to 28759

    Re: HiLo between dates with single date input not plotting correctly

    Hi aksh,

     

    Wabbit is away until tomorrow at the earliest and will answer your question when he returns however this code should give you the results you are chasing.

     

    perd1:=Input("Day",1,31,1);
    perd2:=Input("Month",1,12,1);
    perd3:=Input("Year",1900,2199,2006);
    perd4:=
    ValueWhen(1,(DayOfMonth()>=perd1 AND Month()=perd2 AND Year()=perd3),LastValue(Cum(1))-Cum(1));
    perdHigh:=ExtFml("Forum.HHV",H,perd4);
    perdLow:=ExtFml("Forum.LLV",L,perd4);
    perdHigh;
    perdLow;

     

    It is derived from code provided by *pp in post #24274 the link below.

     

    Exploration to find out rising stock referencing a particular date

     

    Cheers,

    oz

  •  02-04-2009, 10:57 28780 in reply to 28767

    Re: HiLo between dates with single date input not plotting correctly

    Thanks oz. I was actually trying to use Wabbit's single date input code for plotting Hi/Lo between any two intermediate dates entered by the user. It's not happening. I'm getting the highest/lowest points on the chart.

    aksh

View as RSS news feed in XML