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

[amibroker] Re: Problem with nBar trailing stop



PureBytes Links

Trading Reference Links

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 amibroker@xxxxxxxxxxxxxxx, "jeffarcherjr" <jeffarcherjr@xxx> 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
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

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