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

[amibroker] Incorrect behaviour in ApplyStop for trailing stops



PureBytes Links

Trading Reference Links

Hi,

It seems that trailing stops are 'trailed' on the current bar. this 
is wrong. The trailing stop should be calculated on the previous bar 
and should be fixed on the current bar. Otherwise a trailing stop for 
a long position is activated on a day the market is going up a lot 
which is an incorrect behaviour.

I use this code :

Buy = UpIndic ;
Sell=0;
ApplyStop( 2, 2, TrailStopAmountUp, 1,True );

The problem is that for TrailingStops AB uses the high of the day to 
set the stop. So when using 

ExitAtStop = 1 - check High-Low prices and exit intraday on price 
equal to stop level on the same bar when stop was triggered

one get stoped out incorrectly on an up day when the net change for 
the day is more that the trailingstop amount. That is not a logical 
behaviour. The trailing stop for the day should be defined using the 
highest high since the buy but without including the current day.

I can't get this to work even when using a volatile trailing amount 
as it seems that the trailing stop is calculated on the day before 
the current bar but trailed on the current bar. It should not be 
trailed on the current bar. It should remain fixe on the current bar 
and trailed on the next day.

Can you fixe that or is there a workaround for this?

Regards,
Olivier


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

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

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

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

For other support material please check also:
http://www.amibroker.com/support.html

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