How to get Account Equity

Created at 28 Apr 2020, 04:46
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!
BO

bodhisvaha.forex

Joined 21.04.2020

How to get Account Equity
28 Apr 2020, 04:46


Hello

 

I want to get Account Equity value with Open API, but there is only Balance in ProtoOATrader of ProtoOATraderRes and there is not Equity.

 

 

Is there the way to get Equity with Open API? Thank you


@bodhisvaha.forex
Replies

PanagiotisCharalampous
28 Apr 2020, 08:21

Hi bodhisvaha.forex,

Equity is not provided by the API. You need to calculate it yourself using the balance and the P&L of the open positions.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

namth0712
04 Aug 2020, 07:54

Hi Panagiotis,

How can I get "the balance and the P&L of the open positions". Thank you


@namth0712

PanagiotisCharalampous
04 Aug 2020, 08:25

Hi namth0712,

The balance is available in ProtoOATrader.balance. The P&L of each position needs to be calculated using the position's entry price and the current symbol bid/ask price.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

opusensemble
14 Aug 2021, 03:20

RE:

Hi Panagiotis; 

What method would be recommended if one wants to get the P&L updating in real time?

Thank you, 
opus

PanagiotisCharalampous said:

Hi namth0712,

The balance is available in ProtoOATrader.balance. The P&L of each position needs to be calculated using the position's entry price and the current symbol bid/ask price.

Best Regards,

Panagiotis 

Join us on Telegram

 

 


@opusensemble

amusleh
16 Aug 2021, 08:10

RE: RE:

opusensemble said:

Hi Panagiotis; 

What method would be recommended if one wants to get the P&L updating in real time?

Thank you, 
opus

PanagiotisCharalampous said:

Hi namth0712,

The balance is available in ProtoOATrader.balance. The P&L of each position needs to be calculated using the position's entry price and the current symbol bid/ask price.

Best Regards,

Panagiotis 

Join us on Telegram

 

 

Hi,

You should use ExecutionEvent to get every trade operation on user account, and also you must subscribe to each position symbol so you will be able to calculate the real time tick value of each symbol for calculating P&L.

We have complete examples of this on our .NET library for Open API: GitHub - spotware/OpenAPI.Net: Spotware Open API .NET Rx library

Try our ASP.NET core or WPF samples.

We can't develop a sample for all programming languages but we will try to do at least for some of the most popular ones.

And I recommend you to read the tutorials on our new Open API documentation: Open API (spotware.github.io)

 


@amusleh