API Support Forum
OEC API > Order Execution > Getting real time position value
Author Topic: Getting real time position value
(2 messages, Page 1 of 1)
Moderators: VPfau
AKucinskas7573
Posts: 1
Joined: May 19, 2020


Posted: Dec 21, 2020 @ 12:40 PM             Msg. 1 of 2
I need to get actual position (Volume) for the contract at Client.Orders.OrderFilled event.
I was using old API, which used to return the position with order.Account.AvgPositions[fill.Contract].Net.Volume
But with most recent API it does not return a correct actual position.
Looks like DetailedPositions returns correct value, but I am not sure.
What would be the best way to get actual position, including overnight?
My app is used by the IB and it has many subaccounts.
SRuscak
Posts: 50
Joined: Aug 24, 2017


Posted: Jan 06, 2021 @ 12:12 PM             Msg. 2 of 2
One change in GFAPI is that you need to subscribe to the contracts in the position in order to get an accurate position. Perhaps this is the issue?

Here is a sample for doing so: https://gainfutures.com/GFAPI/html/de577afb-edad-4021-a3cc-1fd943896903.htm