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
@@ -54,17 +54,17 @@ class StopLimitOrderRegressionAlgorithm(QCAlgorithm):
if order_event.status == OrderStatus.FILLED:
order: StopLimitOrder = self.transactions.get_order_by_id(order_event.order_id)
if not order.stop_triggered:
raise Exception("StopLimitOrder StopTriggered should haven been set if the order filled.")
raise AssertionError("StopLimitOrder StopTriggered should haven been set if the order filled.")
if order_event.direction == OrderDirection.BUY:
limit_price = self._buy_order_ticket.get(OrderField.LIMIT_PRICE)
if order_event.fill_price > limit_price:
raise Exception(f"Buy stop limit order should have filled with price less than or equal to the limit price {limit_price}. "
raise AssertionError(f"Buy stop limit order should have filled with price less than or equal to the limit price {limit_price}. "
f"Fill price: {order_event.fill_price}")
else:
limit_price = self._sell_order_ticket.get(OrderField.LIMIT_PRICE)
if order_event.fill_price < limit_price:
raise Exception(f"Sell stop limit order should have filled with price greater than or equal to the limit price {limit_price}. "
raise AssertionError(f"Sell stop limit order should have filled with price greater than or equal to the limit price {limit_price}. "
f"Fill price: {order_event.fill_price}")
def is_ready(self):