开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: How to get position info in "points"


 

It sounds like you are looking in the wrong corner.

At any point in time, a "Position" represents the cumulative effect of one or more Trades (Executions) that were caused by one or more Orders for the instrument in the "Position". The attributes you call "open time" and "open price" are actually attributes of the "Execution" not the "Position".

The "Position" only know about sums and averages.

Your client receives real-time order and execution callbacks as the position changes. You could collect and persist at least the executions if you need to know later, how the position changed over time.

闯ü谤驳别苍

?

?

On Thu, Nov 28, 2024 at 01:27 PM, Andy Sanders wrote:

What is the most efficient way to get information about position including the fields below.
?
- open time?
- open price
- unrealized PnL?
?
Request "reqPositions" and "reqPositionsMulti" return these?
?
- reqId
- account
- contract
- avgCost
?
1. Instead of average cost, how do I get price of the stock / option / future when position was opened??
2. How do I get time when it was open??
3. There is a separate request for PnL but even if I get PnL, there are some missing pieces, e.g. I can't calculate the range in points between open and current prices of the asset.??

?

Join [email protected] to automatically receive all group messages.