Add python syntax check (#8651)
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled

* Add python syntax check

* Fix some python regression algorithms

* Fixing more bugs
This commit is contained in:
Martin-Molinero
2025-03-28 10:36:26 -03:00
committed by GitHub
parent 581e87809b
commit 513ced31d7
155 changed files with 667 additions and 587 deletions
@@ -37,16 +37,16 @@ class NakedCallStrategyAlgorithm(OptionStrategyFactoryMethodsBaseAlgorithm):
def assert_strategy_position_group(self, position_group: IPositionGroup, option_symbol: Symbol):
positions = list(position_group.positions)
if len(positions) != 1:
raise Exception(f"Expected position group to have 1 positions. Actual: {len(positions)}")
raise AssertionError(f"Expected position group to have 1 positions. Actual: {len(positions)}")
option_position = [position for position in positions if position.symbol.security_type == SecurityType.OPTION][0]
if option_position.symbol.id.option_right != OptionRight.CALL:
raise Exception(f"Expected option position to be a call. Actual: {option_position.symbol.id.option_right}")
raise AssertionError(f"Expected option position to be a call. Actual: {option_position.symbol.id.option_right}")
expected_option_position_quantity = -2
if option_position.quantity != expected_option_position_quantity:
raise Exception(f"Expected option position quantity to be {expected_option_position_quantity}. Actual: {option_position.quantity}")
raise AssertionError(f"Expected option position quantity to be {expected_option_position_quantity}. Actual: {option_position.quantity}")
def liquidate_strategy(self):
# We can liquidate by selling the strategy