JSOG get position size in volume

Created at 05 Dec 2023, 22:40
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
BR

bruce.kristelijn

Joined 07.04.2019

JSOG get position size in volume
05 Dec 2023, 22:40


Is there a way to get the size of a position using it's position id? I am able to open, close and list positions but would love to get the volume of the position since I need this to close the position.

 

Thanks in advance!

 


@bruce.kristelijn
Replies

PanagiotisCharalampous
06 Dec 2023, 06:27

Hi there,

The position's volume is available in ProtoOAPosition.ProtoOATradeData

Best regards,

Panagiotis


@PanagiotisCharalampous

bruce.kristelijn
09 Dec 2023, 10:28 ( Updated at: 10 Dec 2023, 12:02 )

RE: JSOG get position size in volume

PanagiotisCharalampous said: 

Hi there,

The position's volume is available in ProtoOAPosition.ProtoOATradeData

Best regards,

Panagiotis

Thanks but I am unable to find out how to get this precisely? I am using the JSON API and I cannot find what payload to request to get this?

https://help.ctrader.com/open-api/model-messages/#protooaposition

I've looked at this list and haven't found this yet. Can you help me with that? Thanks!


@bruce.kristelijn

bruce.kristelijn
14 Dec 2023, 22:25

I haven't found this out myself and am desperate for some help! If there is anyone that can push me in the right direction that would be very helpfull! 😀


@bruce.kristelijn

PanagiotisCharalampous
15 Dec 2023, 06:11 ( Updated at: 21 Dec 2023, 09:23 )

Hi there,

It's part of the ProtoOAPosition message

Here is the link to the actual message

https://help.ctrader.com/open-api/model-messages/#protooatradedata

Best regards,


@PanagiotisCharalampous

bruce.kristelijn
17 Dec 2023, 19:12 ( Updated at: 21 Dec 2023, 09:23 )

RE: JSOG get position size in volume

PanagiotisCharalampous said: 

Hi there,

It's part of the ProtoOAPosition message

Here is the link to the actual message

https://help.ctrader.com/open-api/model-messages/#protooatradedata

Best regards,

Isn't there an payload ID to use? For eg ProtoOAOrderListByPositionIdReq uses payloadType as ‘2179’. What's that for this message?


@bruce.kristelijn

PanagiotisCharalampous
18 Dec 2023, 07:42 ( Updated at: 21 Dec 2023, 09:23 )

RE: RE: JSOG get position size in volume

bruce.kristelijn said: 

PanagiotisCharalampous said: 

Hi there,

It's part of the ProtoOAPosition message

Here is the link to the actual message

https://help.ctrader.com/open-api/model-messages/#protooatradedata

Best regards,

Isn't there an payload ID to use? For eg ProtoOAOrderListByPositionIdReq uses payloadType as ‘2179’. What's that for this message?

Hi there,

No because this is not a message, it's a data structure(ProtoOATradeData) which is a member of another data structure(ProtoOAPosition), returned by the ProtoOAReconcileRes


@PanagiotisCharalampous

bruce.kristelijn
18 Dec 2023, 18:12 ( Updated at: 21 Dec 2023, 09:23 )

RE: RE: RE: JSOG get position size in volume

PanagiotisCharalampous said: 

bruce.kristelijn said: 

PanagiotisCharalampous said: 

Hi there,

It's part of the ProtoOAPosition message

Here is the link to the actual message

https://help.ctrader.com/open-api/model-messages/#protooatradedata

Best regards,

Isn't there an payload ID to use? For eg ProtoOAOrderListByPositionIdReq uses payloadType as ‘2179’. What's that for this message?

Hi there,

No because this is not a message, it's a data structure(ProtoOATradeData) which is a member of another data structure(ProtoOAPosition), returned by the ProtoOAReconcileRes

Thank you so much!


@bruce.kristelijn

bruce.kristelijn
18 Dec 2023, 18:12 ( Updated at: 21 Dec 2023, 09:23 )

RE: RE: RE: JSOG get position size in volume

PanagiotisCharalampous said: 

bruce.kristelijn said: 

PanagiotisCharalampous said: 

Hi there,

It's part of the ProtoOAPosition message

Here is the link to the actual message

https://help.ctrader.com/open-api/model-messages/#protooatradedata

Best regards,

Isn't there an payload ID to use? For eg ProtoOAOrderListByPositionIdReq uses payloadType as ‘2179’. What's that for this message?

Hi there,

No because this is not a message, it's a data structure(ProtoOATradeData) which is a member of another data structure(ProtoOAPosition), returned by the ProtoOAReconcileRes

Thank you so much!


@bruce.kristelijn