Skip to content
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

Commission constraints for rebates #300

Merged
merged 3 commits into from
Apr 5, 2021
Merged

Commission constraints for rebates #300

merged 3 commits into from
Apr 5, 2021

Conversation

muhrifqii
Copy link
Contributor

@muhrifqii muhrifqii commented Apr 4, 2021

Fixes #248

@@ -664,7 +664,8 @@ class _Broker:
def __init__(self, *, data, cash, commission, margin,
trade_on_close, hedging, exclusive_orders, index):
assert 0 < cash, f"cash should be >0, is {cash}"
assert 0 <= commission < .1, f"commission should be between 0-10%, is {commission}"
assert -.1 <= commission < .1, (f"commission should be between -10% "
"(e.g. market-maker's rebates) and 10% (fees), is {commission}")
Copy link
Owner

Choose a reason for hiding this comment

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

This string literal should be the f-string. It's what's tripping the CI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah I put on the wrong position, sorry for polluting commit history. It should be squashed 😄

@kernc
Copy link
Owner

kernc commented Apr 5, 2021

Thanks for taking the time to patch this. Hope it serves you well.

@kernc kernc merged commit e3cccdf into kernc:master Apr 5, 2021
Benouare pushed a commit to Benouare/backtesting.py that referenced this pull request Jun 21, 2021
* commission constraints for rebates

* linter warning fix

* assert linter warning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Would it be possible to add a positive commission?
2 participants