If you don't get it working using stops, you can try ExRemSpan. From the user 
guide:

"This function makes easy writing exits after a fixed number of bars, for 
example if you want to sell always 5 bars after the buy you should now use 
combination of ExRemSpan and Ref(). It will work even if initial buy array has 
lots of redundant signals"

http://www.amibroker.com/guide/afl/afl_view.php?id=50

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

Mike

--- 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