API Support Forum
OEC API > API Support > GF COM API: Determining if Position was Placed as a Spread
Author Topic: GF COM API: Determining if Position was Placed as a Spread
(3 messages, Page 1 of 1)
Moderators: VPfau
RWare2020
Posts: 206
Joined: Feb 11, 2020


Posted: Apr 14, 2023 @ 12:18 PM             Msg. 1 of 3
Is there a way for me to determine inside of the account's AvgPositions dictionary if a position was part of a futures spread?

I have checked the compound type as well as the contract kind for any sort of indication of spread and everything comes back as Kind_Futures or Compound_Unknown.

The symbol that comes back on the contract has no indication of it being part of a spread either.

I have checked:
position->Contract
position->Contract->BaseContract
position->PositionContract
position->Contract->ParentContract
position->PositionContract->BaseContract

It appears that the parent contract of the position has the same id for spread positions that come back which is what is what I have been using to determine if they were part of the same spread. That does not carry across the close and can no longer be used.

Thanks
Edited by RWare2020 on Apr 14, 2023 12:21 PM
JSmith5611
Posts: 187
Joined:


Posted: Apr 18, 2023 @ 11:42 AM             Msg. 2 of 3
Positions are not associated with spreads, only with individual legs. That's how the exchange works.
Jason Smith
RWare2020
Posts: 206
Joined: Feb 11, 2020


Posted: Apr 19, 2023 @ 09:51 AM             Msg. 3 of 3
It seems weird to me that the spread is placed with a spread contract symbol/id, but when the position comes back, it has no idea about what it was placed as. There's no way I can piece it together by checking some legs or something of the position contract or anything?

Thanks.