Identifying Opening Fills in VeighNa Lock Mode
Summary
This forum exchange discusses how to identify opening executions in VeighNa when an order is sent in lock mode. In that mode, a closing action may be represented as an opposite-direction opening trade, so checking the trade’s offset in the trade callback may not reliably distinguish an entry from an exit.
The reply offers two approaches: infer entry status from the strategy’s position when the trade callback runs, or record opening orders in the order callback and match later trades to those orders by order identifier. The first is presented as suitable for simpler cases, while order-to-trade tracking is suggested for more complex ones. The exchange provides example logic, but no tests or discussion of edge cases such as partial fills, callback timing, or position updates. A follow-up question about whether order reports preserve the original offset is left unanswered, so the reliability of that assumption is unresolved.
Key ideas
- In lock mode, a closing action may appear as an opposite-direction opening trade.
- Trade offset alone may therefore fail to identify whether a fill opened a position.
- One suggested approach checks the strategy position in the trade callback.
- Another approach records opening orders and matches fills using their order identifiers.
- The discussion does not resolve whether order reports retain the original offset.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.