Skip to content

Would it be possible to add a positive commission? #248

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

Closed
AlgoQ opened this issue Feb 11, 2021 · 5 comments · Fixed by #300
Closed

Would it be possible to add a positive commission? #248

AlgoQ opened this issue Feb 11, 2021 · 5 comments · Fixed by #300
Labels
enhancement New feature or request

Comments

@AlgoQ
Copy link

AlgoQ commented Feb 11, 2021

I'm trying to backtest a limit orders based strategy on a crypto exchange named bybit. The problem is that you get rebates when you use limit orders. But I see I can't enter positive commissions (-0.00025). Would it be possible to change this?

AssertionError: commission should be between 0-10%, is -0.00025
@kernc kernc added the enhancement New feature or request label Feb 12, 2021
@kernc
Copy link
Owner

kernc commented Feb 12, 2021

For now, why not amend the line:

assert 0 <= commission < .1, f"commission should be between 0-10%, is {commission}"

in you own copy, and try it out.

Do report if anything breaks.

@AlgoQ
Copy link
Author

AlgoQ commented Feb 19, 2021

Thanks!

@AlgoQ AlgoQ closed this as completed Feb 19, 2021
@kernc
Copy link
Owner

kernc commented Feb 20, 2021

Did you solve it? Does it work?

@kernc kernc reopened this Feb 20, 2021
@AlgoQ
Copy link
Author

AlgoQ commented Feb 20, 2021

Yeah I changed the line to this and everything worked afterwards, with the results I was expecting.

 assert -0.1 <= commission < .1, f"commission should be between -10% -> 10%, is {commission}" 

@kernc
Copy link
Owner

kernc commented Feb 24, 2021

If you PR it with text ... between -10% (e.g. market-maker's rebates) and 10% (fees), I'll accept it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants