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

[amibroker] backtest daily entry signals with intraday stop-loss orders



PureBytes Links

Trading Reference Links

Hi,

Has anyone of you ever come across the problem of properly 
backtesting stop-loss orders at intraday level in order to get the 
correct High-Low sequence within daily bars?

This is a key point when you want to run reliable backtests on daily 
data with a take-profit level and a stop-loss order. You must know 
which of the two exit orders is hit first and you need intraday data 
for that.

Other softwares have implemented some tools in order to do that (i.e. 
Look-inside-bar for Tradestation or PrecisionTick for TradeNavigator) 
in order to let built-in stops working at lower timeframes and get 
the correct exit level.

Unfortunately with AB if two or more different stops are triggered on 
the very same bar then they are evaluated in this fixed order 
(see http://www.amibroker.com/guide/afl/afl_view.php?id=20):

Fixed Ruin stop (loosing 99.96% of the starting capital)
Max. loss stop
Profit target stop
Trailing stop
N-bar stop

which is a sort of worst-case scenario but it's not properly 
reflecting the real-world and it's particularly misleading if you are 
running stop-level optimization.

The only way I can imagine to sort this out with AB is to use two 
timeframes together - intraday as a base frame and daily via 
TimeFrameSet for my Entry signals. With this technique I can have all 
my signals based on daily indicators and use intraday frame only for 
stops.

Unfortunately this makes the code more complex and the cost of a 
proper intraday database is much higher.

Has anyone of you found other shortcuts to accomplish that?



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

Please note that this group is for discussion between users only.

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