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

[amibroker] customizing stop backtesting logic



PureBytes Links

Trading Reference Links

Hi,

I am tryng to deal with some slippage inconsistency between
backtesting and automatic trading, and I would like to have control on
the stop profit logic of the backtester.

I would like to exit trades only when the price has been higher/lower
than the stop profit price, to ensure the order would be certainly be
filled also in real trading.

The Backtester object has a method called handlstops to be used at low
level backtesting to apply stops, but it is has only 1 parameter(the
bar) so I assume it doesn´t give access to the stop logic.
I did not find any afl code using it, so I am not sure in which order
it should be called.

The problem could be solved by looping over the signal objects and
changing the price of the signal having reason=2 (profit) but I would
like to know if there is another way to do it.

Right now I have just added a custom backtest metric taking into
account the slippage in the net profit, backtesting the system using a
stop 1 tick higher, and subtracting it from the profitable trades, but
the equity etc. are still calculated according the internal AB stop logic.

I assume the built in AB applystop logic is that and order is filled
if the price is ">= stoplimit", all I would like to do it is to switch
it to ">stoplimit", but I would like to know if it is possible to
control this behavior in any case even if it the stop profit logic is
already ">stoplimit", also for stop loss for example, without having
to modify directly the signal or trade objects.
 
Thanks

Ly





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/