backtesting.py icon indicating copy to clipboard operation
backtesting.py copied to clipboard

Minimum commission per trade

Open tankorsmash opened this issue 5 years ago • 5 comments

Say I've got a 1.00$ minimum commission + 1% per trade, it doesn't appear to be possible to account for that, beyond just using a the commission=0.01 and ignoring the 1 dollar minimum.

Is such a thing possible?

Additional info

  • Backtesting version: 0.2.0

tankorsmash avatar Jul 19 '20 03:07 tankorsmash

Not possible. This would require an extra parameter, and we have nearly too many of those already, so I'm somewhat disinclined, more leaning to rule-of-thumb/ballpark estimations in that case.

Besides ignoring, I guess you can do accounting for (i.e. slightly increase commission rate for all trades, e.g. commission=.0125).

Do you make many trades where commissions sum to less than the minimum? In that case the relative commission model is completely flawed. But so might be your strategy ... :thinking:

kernc avatar Jul 19 '20 10:07 kernc

Not possible. This would require an extra parameter, and we have nearly too many of those already, so I'm somewhat disinclined, more leaning to rule-of-thumb/ballpark estimations in that case.

Besides ignoring, I guess you can do accounting for (i.e. slightly increase commission rate for all trades, e.g. commission=.0125).

Do you make many trades where commissions sum to less than the minimum? In that case the relative commission model is completely flawed. But so might be your strategy ... 🤔

This issue is important for the whole repository. Most exchanges for stocks and futures charge a dollar commission, not a percentage like cryptocurrency. I think it's worth potentially adding a minimum commission nominated dollars/euros/etc.

Also, consider that this adds flexibility and enables more accurate backtesting. image

casper-hansen avatar Jan 16 '23 17:01 casper-hansen

I have trouble to understand this phrase

Note, if you wish to account for bid-ask spread, you can approximate doing so by increasing the commission, e.g. set it to 0.0002 for commission-less forex trading where the average spread is roughly 0.2‰ of asking price.

if you set to 0.0002 then it would be 0.02 not 0.2%

0.2% would be 0.002 am i wrong?

makovez avatar Jan 21 '23 11:01 makovez

@makovez Notice the symbol in "0.2 " is per mille, not per cent. :wink:

kernc avatar Jan 21 '23 17:01 kernc

Ops sorry. Never seen that symbol before. Now makes sense. Thanks.

so usually commission is around 0.02% of buy price?

makovez avatar Jan 21 '23 18:01 makovez