Skip to content
All library documents

Retrieving Original Futures Entry Prices from CTP Positions

Article vn.py community

Summary

The forum exchange addresses how to obtain a futures position's actual opening price through the CTP interface. One user explains that the previous-day position price shown in their data is the settlement price, which complicates calculation of true profit and loss for a stop-loss feature. They ask whether CTP provides the original entry price directly rather than requiring the application to track fills itself.

A respondent says the interface provides the value and points to the vn.py CTP adapter's investor-position response handler. The suggested approach is to modify the PositionData price field assignment so it uses the original opening price. This is a short implementation pointer, not a complete code sample or a detailed explanation of position aggregation, multiple fills, or exchange-specific semantics. The advice therefore identifies where to investigate in the adapter, but implementation details should be checked against the relevant vn.py and CTP versions.

Key ideas

  • The reported previous-day position price may represent settlement rather than original entry price.
  • The respondent says CTP exposes the original opening price through its position query interface.
  • The suggested modification is in the vn.py CTP investor-position response handler.
  • The post does not explain how to handle aggregated entries or version-specific differences.

Tags

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