In Amibroker backtest, if I select, say, 0.1% commission in backtestest setting, is that for 0.1% of entry trade plus 0.1% of exit trade?
Harry from Australia
...or is backtester only allowing for 0.1% for whole trade?
@harryzehnwirth commissions are calculated for every operation/order (buy, sell, short or cover).
In such a way the expenses are properly accounted also when you scale in/out, and you have multiple operations/orders before squaring the position.
You can verify it quickly with a snippet like this one below, that will open and close a position on a single bar using the BuyPrice == SellPrice, so there is no gain or loss on the traded instrument, and the only loss is actually due to the commissions.
SetOption("InitialEquity", 100000 ); // set initial equity = 100K maxpos = 1; // maximum number of open positions SetOption( "MaxOpenPositions", maxpos ); SetPositionSize( 100, spsShares ); // number of shares/contracts per trade // SetOption("CommissionMode", 2); // $ per trade // SetOption("CommissionAmount", 5); // SetOption("CommissionMode", 1); // percent SetOption("CommissionAmount", 0.1); // SetOption("AllowSameBarExit", True); Buy = 1; Sell = 1; BuyPrice = SellPrice = Avg;
Apply it to the *Current Symbol / 1 Recent bar, and do a Backtest.
You'll see that the loss will amount to 2 * your commissions.
Thank you again Beppe