Skip to content
All library documents

Checking Order Fill Status in VeighNa Strategy Callbacks

Article vn.py community

Summary

This VeighNa forum discussion explains how to determine whether a tracked order has filled completely. For CTA strategies, the replies point to the order-update callback and checking the order object’s status against the all-traded state. A reported NameError is resolved by importing the status enumeration. Trade callbacks can also be associated with an order identifier, with order details retrieved for a status check.

The discussion distinguishes CTA strategies from the portfolio StrategyTemplate: according to the replies, that template lacks the same order and trade callbacks, so a strategy can query order state through its available order lookup method during bar updates. The examples cover submitted, unfilled, partially filled, fully filled, cancelled, and rejected states. These are implementation notes rather than a trading method, and the forum does not provide independent verification across platform versions. Callback availability and lookup behavior should be checked against the installed VeighNa version and the specific backtest or live-trading engine.

Key ideas

  • In CTA strategies, order status updates can be handled through the order callback.
  • The order object exposes a status that can be compared with the fully filled state.
  • The status enumeration must be imported before using its values.
  • The portfolio strategy template described in the thread does not provide the same callbacks.
  • That template can check order state through an order lookup during bar processing.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.