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

Re: [amibroker] Re: AFL - Month() function



PureBytes Links

Trading Reference Links

Thanks to all who responded ... this is a great board helping each other.

Ara
  ----- Original Message ----- 
  From: Mark Jarvis 
  To: amibroker@xxxxxxxxxxxxxxx 
  Sent: Saturday, January 13, 2007 10:00 PM
  Subject: Re: [amibroker] Re: AFL - Month() function


  Hi,

  ref(month(),-1) doesn't return the previous month value.  It returns the previous bars value of month.

  So, assume these are your dates

  Date       Month()
  31/Dec   12
  1/Jan      1
  2/Jan      1
  3/Jan      1
  4/Jan      1
  5/Jan      1 

  So, if your current bar is 4/Jan, then month and ref(month(),-1) will be the same.  Only on the first day of the month will the values be different.



  On 14/01/07, trb0428 <tombrowne34@xxxxxxxxxxx> wrote:
    Hi Ara,

    I have tried this with the same results that you report....not sure 
    why it does not work....the help says that it returns an array...but 
    I think it means to say that it is an array holding the same number 
    in every position. You could do something like this as a possible 
    work-around:

    my_month = Month();
    Plot(mm,"this month",colorWhite);
    Plot(mm-1,"last month",colorGreen);

    best regards,
    Tom

    --- In amibroker@xxxxxxxxxxxxxxx, "Ara Kaloustian" <ara1@xxx> wrote:
    >
    > I am having problems with using:
    > 
    > _TRACE(" Month " + Month() + " Last month " + Ref(Month(),-1));
    > 
    > Used above statement in 2 different indicators, after fresh reboot.
    > 
    > Both Month() and Ref(Month(),-1) give the same result. Correct 
    result for Month(), but incorrect for Ref(Month(),-1).
    > 
    > Would someone test this on your system? / or point out any eror you 
    see.
    > 
    > 
    > 
    > Thanks
    > 
    > Ara
    >




   
Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.10/625 - Release Date: 1/13/2007 5:40 PM