Skip to content

Fix simulation edge cases in slippage, controls, and metrics#325

Open
pandashark wants to merge 1 commit intostefan-jansen:mainfrom
pandashark:bugfix/simulation-edge-cases
Open

Fix simulation edge cases in slippage, controls, and metrics#325
pandashark wants to merge 1 commit intostefan-jansen:mainfrom
pandashark:bugfix/simulation-edge-cases

Conversation

@pandashark
Copy link

Summary

Closes #321

  • Fix order.limit truthiness check in fill_price_worse_than_limit_price
  • Fix Positions metric calling ledger.positions property as method
  • Fix validate_order_params style truthiness check
  • Fix _can_order_asset auto_close_date truthiness check
  • Fix AssetDateBounds.validate start_date/end_date truthiness checks
  • Fix MaxOrderSize/MaxPositionSize validation truthiness checks

All changes follow the pattern already used correctly in Order.check_order_triggers: if self.stop is not None:.

Test plan

  • All existing tests pass
  • flake8 passes on modified files
  • Verify limit orders with price=0.0 are handled correctly
  • Verify Positions metric works in minute-emission mode

- Fix order.limit truthiness check in fill_price_worse_than_limit_price
- Fix Positions metric calling ledger.positions property as method
- Fix validate_order_params style truthiness check
- Fix _can_order_asset auto_close_date truthiness check
- Fix AssetDateBounds.validate start_date/end_date truthiness checks
- Fix MaxOrderSize/MaxPositionSize validation truthiness checks
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.

Simulation edge cases: truthiness checks and property-vs-method bug

1 participant