Get StopLoss and TakeProfit for Deals

Created at 17 Jul 2020, 11:06
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!
BE

BenjaminR

Joined 12.06.2019

Get StopLoss and TakeProfit for Deals
17 Jul 2020, 11:06


Hi, 

I need to process the closed deals (History) with StopLoss and TakeProfit. These  are not stored in ProtoOADeal class.

msgFactory.CreateDealsListRequest(_accountID, startDate.ToUnixTimeMilliseconds(), now.ToUnixTimeMilliseconds());

As I see the ProtoOAOrder class contains, but I do not know how to get the orders list. 

Thanks,

Beri


@BenjaminR
Replies

PanagiotisCharalampous
17 Jul 2020, 11:16

Hi BenjaminR,

Historical orders are not available via the Open API. You can only retrieve the pending orders.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

olegchubukov
11 Sep 2021, 21:46

RE:

PanagiotisCharalampous said:

Hi BenjaminR,

Historical orders are not available via the Open API. You can only retrieve the pending orders.

Best Regards,

Panagiotis 

Join us on Telegram

 

Hi, Panagiotis

Is this still true that there is no way to retrieve historical orders?

How can I then calculate statistic for a certain period?


@olegchubukov

olegchubukov
11 Sep 2021, 21:52 ( Updated at: 11 Sep 2021, 21:54 )

 

 


@olegchubukov

PanagiotisCharalampous
13 Sep 2021, 09:56

Hi olegchubukov,

No you cannot retrieve historical orders. What kind of statistics would you like to calculate that require you retrieve historical orders?

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

olegchubukov
13 Sep 2021, 10:13

RE:

PanagiotisCharalampous said:

Hi olegchubukov,

No you cannot retrieve historical orders. What kind of statistics would you like to calculate that require you retrieve historical orders?

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

For example, create a list with closed trades showing close time, pips and so on.

10.09.2021 09:19:58 #NZDJPY -66 PIPs
11.09.2021 09:21:47 #EURJPY +38 PIPs
12.09.2021 10:26:44 #EURJPY +20 PIPs
13.09.2021 10:50:52 #NZDUSD +20 PIPs
14.09.2021 15:17:52 #EURJPY 0 PIPs


@olegchubukov

PanagiotisCharalampous
13 Sep 2021, 10:24

Hi olegchubukov,

Closed trades have nothing to do with historical orders. They can be retrieved using ProtoOADealListReq

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

olegchubukov
13 Sep 2021, 10:59 ( Updated at: 21 Dec 2023, 09:22 )

RE:

PanagiotisCharalampous said:

Hi olegchubukov,

Closed trades have nothing to do with historical orders. They can be retrieved using ProtoOADealListReq

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

Well, that's what I tried before I asked and got nothing in the deals field. Tried for accountId: 22723160, accountNumber: 3561073

The request is to pick up deals 10 days back from now

 

Result. Deals lsit is empty

 

Positions in cTrader


@olegchubukov

PanagiotisCharalampous
13 Sep 2021, 13:36

Hi olegchubukov,

There must be something wrong in your messages. Please provide us with the following.

1) Send us your token as well as client id and secret at community@spotware.com to check further.

2) Please provide a full screenshot of cTrader where the broker and account number are visible.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous