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

[amibroker] Re: Problem with nBar trailing stop



PureBytes Links

Trading Reference Links

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