[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CloseM Function



PureBytes Links

Trading Reference Links

At 10:04 PM -0500 3/24/98, Peter Gibson wrote:

>Has anyone used the CloseM function in Build 21 of TS 4.0?
>
>I took a look at the on-line documentation - it does not explain how to
>use CloseM.  I tried using CloseM(Date[1]) expecting to get the close of
>the month from the date 1 bar ago.  Although PowerEditor gives the
>'Excellent!' result the value returned by the statement is 0.
>
>Anyone know how to get this to work?


The code in the EasyLanguage code for the function explains how to use it
pretty clearly. (Attached below.)

Bob Fulks


{ *******************************************************************

   Function     : CloseM

   Last Edit    : 10/3/96

   Provided By  : Omega Research, Inc. (c) Copyright 1996

      Returns the Close of the Month based on Daily or Weekly
      Data. Returns a -1 when not on Daily or Weekly Data or
      when not available. Input allows you to specify which
      Month. CloseM(0) returns Close for current Month.
      CloseM(1) returns Close of 1 Month ago. You may refer
      up to a maximum of 50 Months ago.

********************************************************************}
Inputs: MonthAgo(Numeric);
Array: CloseArray[50](-1);

If DataCompression < 4 then begin
   If Month(Date) <> Month(Date[1]) then begin
      for Value1=50 downto 1 begin
         CloseArray[Value1]=CloseArray[Value1-1];
      end;
      CloseArray[0]=Close[1];
   End;
   If MonthAgo<=50 and MonthAgo>0 then CloseM=CloseArray[MonthAgo-1];
   If MonthAgo=0 then CloseM=Close;
End;