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 <[EMAIL PROTECTED]> 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 [email protected] <amibroker%40yahoogroups.com>, "Ara
Kaloustian" <[EMAIL PROTECTED]> 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
>

Reply via email to