I don't know the reason for your results. But, you might try simplifying by just checking if the bars have the same DateNum, Day, DayOfWeek, DayOfYear or DaysSince1900.
One thing to verify before going ahead is whether or not your backtest would work using today as your last in range date. Will it still work when there is no tomorrow's bar to check against?
Mike
--- In amibroker@xxxxxxxxxps.com, Nick Willemse <nick.willemse@...> wrote:
>
> Ok, I'll post some progress i've made:
>
> I decided to look ahead at the time of the next bar, take the
> difference, and if it's not equal to my timeframe (which is 5 min
> bars) then we must be at the last bar of the session so i set sell to
> 1. Here's the statement:
>
> Cover = (Ref(TimeNum(),1) - Ref(TimeNum(),0)) > 40000 ;
>
> But I get strange results on every 55 minutes. The difference is 500
> until 8:55 or 9:55 or 10:55, then the difference jumps to 4500. Why
> could this be?
>
> Remember this is backtest only, hence forward looking.
>
> Nick
>
> On Jul 13, 2009, at 11:47 AM, Nick Willemse wrote:
>
> > Hi Everyone,
> >
> > I'm trying to backtest a strategy and have 5 min data. Some days
> > are holidays and the closing time for the day is different on
> > holidays. How can I exit the trade if i am in one on the last bar
> > of the trade ? TradeStation you just add SetExitOnClose. ANything
> > similar in AB?
> >
> > Thanks in advance
> > Nick
>