Added support for backtesting fees in base currency#56
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds base-currency fee charging support to Basana’s backtesting fee model, expanding basana.backtesting.fees.Percentage beyond quote-currency-only fees while keeping quote as the default for backward compatibility.
Changes:
- Introduced
FeeCurrencyand added afee_currencyparameter tofees.Percentageto support charging fees in base or quote. - Added unit tests covering base-currency fee charging behavior (including partial fills and minimum fee).
- Updated Sphinx docs and the changelog to document the new capability.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
basana/backtesting/fees.py |
Adds FeeCurrency enum and extends Percentage fee strategy to compute fees in base or quote currency. |
tests/test_backtesting_fees.py |
Adds test cases for base-currency fee calculation across partial fills and minimum-fee behavior. |
docs/backtesting_fees.rst |
Documents the new FeeCurrency API in backtesting fees reference docs. |
CHANGELOG.md |
Notes the new fee_currency parameter feature and default behavior for compatibility. |
Agent-Logs-Url: https://github.com/gbeced/basana/sessions/edf8c93e-edb8-40c9-a6e1-8dff752b1acc Co-authored-by: gbeced <1163917+gbeced@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gbeced/basana/sessions/acf3ac86-53ec-4819-9c1e-0f7c2fe942dd Co-authored-by: gbeced <1163917+gbeced@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gbeced/basana/sessions/acf3ac86-53ec-4819-9c1e-0f7c2fe942dd Co-authored-by: gbeced <1163917+gbeced@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gbeced/basana/sessions/acf3ac86-53ec-4819-9c1e-0f7c2fe942dd Co-authored-by: gbeced <1163917+gbeced@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.