Skip to content

ENH: Add Backtest(spread=), change Backtest(commission=) #839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 21, 2025

Conversation

kernc
Copy link
Owner

@kernc kernc commented Dec 13, 2022

commission= is now applied twice as common with brokers. spread= takes the role commission= had previously.

Fixes #149
Fixes #113
Fixes #1183
Closes #662
Closes #1006
Closes #1119

`commission=` is now applied twice as common with brokers.
`spread=` takes the role `commission=` had previously.
@kernc kernc force-pushed the spread-commission branch from 4249ce3 to cd5ae83 Compare December 13, 2022 14:20
@casper-hansen
Copy link

Looking forward to this one, it will enable this library to more accurately account for fees, especially with the commission tuple!

@casper-hansen
Copy link

@kernc when do you expect to merge this into the main branch and create a new release?

Comment on lines +734 to +735
def _commission_func(self, order_size, price):
return self._commission_fixed + abs(order_size) * price * self._commission_relative
Copy link
Owner Author

@kernc kernc Feb 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this cover all sorts of commission cases?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base case is solved I would say.

Nice to have:
In cryptocurrency exchanges, your commissions tend to be reduced over a rolling 30-day period if you create enough volume.

It would be handy if you could create a scaling commission feature based on the transaction volume. It would also be handy if it can be split into maker/taker.

image

@nohype
Copy link

nohype commented Dec 15, 2023

Hi! First thanks @kernc thanks for building this project. I've been using it for a short while and it's awesome at what it does so far.

Is there any prognosis as to when this would be merged?

@kernc kernc force-pushed the master branch 5 times, most recently from 428c361 to 0ce6cab Compare January 21, 2025 07:25
@kernc kernc merged commit c0a266c into master Jan 21, 2025
4 checks passed
@kernc kernc deleted the spread-commission branch February 19, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants