Commissions by Symbol
Author: adrian50697
Creation Date: 8/6/2016 2:45 PM
profile picture

adrian50697

#1
Is there a work around for setting a specific commission for each symbol in a backtest?

I am attempting to simulate slippage costs on 1 min midpoint price data for pairs of futures contracts however Wealth Lab's design which restricts slippage prices to within the low/high range of the bar severely underestimates true slippage in this scenario. Usually I would use the commission settings to reflect slippage however in this particular strategy the hedge ratio is constantly changing and as such a static global commission cost also incorrectly accounts for slippage.
profile picture

Eugene

#2
You can integrate custom commission structure with the help of dedicated API. Check out the Community.Commissions project for the source code of an actual commission library: Home - Community.Commissions

Inside the main point of entry i.e. Calculate() method, check for current bars.Symbol (or other properties) to apply your custom "commission":
CODE:
Please log in to see this code.