Either define multiple-tiered commission table (where commission depends on value/price/n umber of shares or whatever else), or add commission directly to trade price http://www.amibroker.com/guide/h_backtest.html (scroll to controlling trade price)
Thank you very much for the quick response, Tomasz.
The trade price option makes sense to me. The commission table I think would not work as well for this, unless you can define for each symbol which tier to use regardless of value/price/number of shares. But I don't think you can... And even if you could, I would need more than five different commission rates.
Anyway, I think I should be able to work with option 2. So thank you for that!
I have, as an experiment, added a six cent spread to the entry price in this way for entries (adding to the buy price, subtracting from the short price). Now if I compare that with using a $0.06 commission per share in the regular way, I get a different result. Both outcomes are less than the results without commission, but not the same. What could possibly explain this? Should it not come down to the same thing?
by adding 0.06 to price you may be exceeding High and AmiBroker won't allow that by default (use How do I debug my formula? to find out) - you would need to use SetOption() function to disable price bound checking
the same with sell side / subtracting from price / hitting the Low
your code may be using ApplyStops (then it is exiting at stop level and your code that adds to price is not used)
different prices may cause different trade sizes to be taken (if you are using position size based on % of equity)