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

Fix position closing on contract expiration #1624

Merged
merged 1 commit into from
May 4, 2024

Conversation

rsmb7z
Copy link
Collaborator

@rsmb7z rsmb7z commented May 4, 2024

Pull Request

Fixes following bug when there are only closed positions.

nautilus_trader\\backtest\\matching_engine.pyx:1261: in nautilus_trader.backtest.matching_engine.OrderMatchingEngine.iterate
    ???
nautilus_trader\\backtest\\matching_engine.pyx:1331: in nautilus_trader.backtest.matching_engine.OrderMatchingEngine.iterate
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   ValueError: invalid `PositionSide`, was FLAT

nautilus_trader\\model\\orders\\base.pyx:807: ValueError

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How has this change been tested?

Added test and resolved the exception.

@cjdsellers cjdsellers merged commit 0890280 into develop May 4, 2024
9 checks passed
@cjdsellers cjdsellers deleted the fix_closing_positions branch May 4, 2024 06:08
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.

2 participants