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

[Metastockusers] RE:Re: Re: RE:Bar Count since certain date


  • To: <Metastockusers@xxxxxxxxxxxxxxx>
  • Subject: [Metastockusers] RE:Re: Re: RE:Bar Count since certain date
  • From: "SR" <raftsp@xxxxxxxxx>
  • Date: Fri, 3 Jan 2003 05:05:58 -0800
  • In-reply-to: <1041582108.460.47025.m12@xxxxxxxxxxxxxxx>

PureBytes Links

Trading Reference Links


It was pointed out that the previous version failed near the months turning
points.
I tried to fix that and also tried to fix the years turning points bug.
The newer version is this:

{BarsSinceDate}

d:=Input("Day",1,31,1);
m:=Input("Month",1,12,1);
y:=Input("Year",1920,2030,2002);

cond1:= d<DayOfMonth() AND m=Month() AND y=Year();{normal situation}
cond2:= d>DayOfMonth() AND m+1 =Month() AND y=Year();{change of month}
cond3:= d>DayOfMonth() AND m=12 AND y+1=Year();{change of year}

count:=BarsSince(cond1 OR cond2 OR cond3);
count:=count + Cum(If(count=0,1,0));
count


Please test it, especially near the end of months and years or near the
start of the next ones.
If you see any bug then please let me know.

Sorry for the inconvenience.

Spyros





To unsubscribe from this group, send an email to:
Metastockusers-unsubscribe@xxxxxxxxxxx

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/