Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
Solved:
lastmonth:=Ref(month(),-1);
barsSince(lastmonth<>month())+1
The problem is that the day the condition is true BarsSince()=0 byt when we count (unless you are a computer programmer) then the first day is 1 not 0.
Hope this helps.
wabbit :D
P.S. To prove the difference between the formulas, plot this:
edwin:=If(Month()=1,BarsSince(Month()<>1),
If(Month()=2,BarsSince(Month()<>2),
If(Month()=3,BarsSince(Month()<>3),
If(Month()=4,BarsSince(Month()<>4),
If(Month()=5,BarsSince(Month()<>5),
If(Month()=6,BarsSince(Month()<>6),
If(Month()=7,BarsSince(Month()<>7),
If(Month()=8,BarsSince(Month()<>8),
If(Month()=9,BarsSince(Month()<>9),
If(Month()=10,BarsSince(Month()<>10),
If(Month()=11,BarsSince(Month()<>11),
If(Month()=12,BarsSince(Month()<>12),0))))))))))));
lastmonth:=Ref(Month(),-1);
wabbit:=BarsSince(lastmonth<>Month()) +1;
edwin-wabbit
It should be zero, across the board
|