Mike and Benton: 

Thanks for the suggestions.

Benton: your suggestion still gives me the strange results - that was one of 
the combinations I tried. I think/agree it should work, but it doesn't appear 
to!


Mike: I managed to get your suggestion to work with a small tweek, which was 
this:


Buy = ExRemSpan( Buy, 15 );
Sell = Ref( Buy, -14 );

In other words, had to stop buy signal for one day longer than sell signal.  
(Not sure why, one of those "out by one" errors that often plague any computer 
code).


Of course, my backtest results are still showing "#Bars held" figures of 16 up 
to 20.  However, it appears to me that it is in fact exiting after 14 bars, but 
the "#bars held" column in the backtest results screen seems to be calculated 
by subtracting the sell date from the buy date which of course includes weekend 
days as "bars" ... different from the meaning of bars within AFL.


Thanks again

Jeff



--- In [email protected], "jeffarcherjr" <jeffarche...@...> wrote:
>
> Hi Everyone:
> 
> I'm having a problem implementing (or more likely understanding) an nBar stop.
> 
> I want to enter a trade and always exit fifteen days later. I think the 
> following code should do this:
> 
> ApplyStop(stopTypeNBar,1,15,0,False);
> 
> However, when I look at the back test results, there are some trades that 
> stay open much longer (as long as 60 days in one test).  As far as I can 
> tell, if there are other buy signals within the 15 days then the bar count 
> resets to zero.  However, I can't find any combination of parameters for the 
> ApplyStop that seems to stop this.
> 
> Any suggestions?
> 
> Thanks
> 
> Jeff
>


Reply via email to