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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
linter warning fix
  • Loading branch information
muhrifqii authored Apr 4, 2021
commit 1114e09fc768a04dc8b04e37910a242c00ca1ffe
3 changes: 2 additions & 1 deletion backtesting/backtesting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 -.1 <= commission < .1, f"commission should be between -10% (e.g. market-maker's rebates) and 10% (fees), 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 😄

assert 0 < margin <= 1, f"margin should be between 0 and 1, is {margin}"
self._data: _Data = data
self._cash = cash
Expand Down