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

FuturesContract - Add missing margin and fee parameters to Python #2112

Open
stefansimik opened this issue Dec 14, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@stefansimik
Copy link

The Python implementation of FuturesContract is missing several important parameters that exist in its Rust/PyO3 counterpart. This creates an inconsistency between the two implementations that should be addressed.

Current State:
The Python FuturesContract class does not include the following parameters that are present in the PyO3 version:

  • margin_init
  • margin_maint
  • maker_fee
  • taker_fee

These parameters are defined and accessible in the PyO3 implementation at nautilus_trader/core/nautilus_pyo3/model/FuturesContract.py, but cannot be set when constructing a FuturesContract using the Python implementation.

CleanShot_2024-12-13_at_23 29 572x

Impact:
This inconsistency means that margin and fee information cannot be properly initialized for futures contracts when using the Python implementation, which could affect margin calculations and fee modeling in trading strategies.

Notes from Discord:

  • Similar discrepancies exist in at least 4 other instrument implementations
  • This relates to the broader discussion about margin and fee modeling in the system
@stefansimik stefansimik added the bug Something isn't working label Dec 14, 2024
@stefansimik stefansimik changed the title Add missing margin and fee parameters to Python FuturesContract FuturesContract - Add missing margin and fee parameters to Python Dec 14, 2024
@cjdsellers cjdsellers self-assigned this Dec 14, 2024
@cjdsellers
Copy link
Member

Hi @stefansimik

Thanks for raising the issue.

Per the Discord discussion, these were left off when we intended to redesign the margin and fee modeling - but for now I agree we should align the Python and Rust implementations, and add these missing params.

@cjdsellers cjdsellers moved this to In progress in NautilusTrader Kanban Board Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In progress
Development

No branches or pull requests

2 participants