ProtoOASubscribeForTradingEventsReq

Created at 23 Apr 2017, 05:26
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!
YC

ycomp

Joined 16.10.2013

ProtoOASubscribeForTradingEventsReq
23 Apr 2017, 05:26


1. What does ProtoOASubscribeForTradingEventsReq/Res do? What happens after?

2. Can it be used to get real-time position information?

 

 


@ycomp
Replies

Spotware
24 Apr 2017, 12:01

Hi ycomp,

ProtoOASubscribeForTradingEventsReq is used to subscribe to trading events like order filling, canceling, closing etc. It can not be used to receive position information. If you need position information you can do it through Accounts API.


@Spotware

ycomp
24 Apr 2017, 13:56

RE:

Spotware said:

Hi ycomp,

ProtoOASubscribeForTradingEventsReq is used to subscribe to trading events like order filling, canceling, closing etc. It can not be used to receive position information. If you need position information you can do it through Accounts API.

is there any kind of connections per second limit with the Accounts API? or can I hit it as much as I want? 

 


@ycomp

Spotware
24 Apr 2017, 14:25

Yes the limit is1 request per 2 seconds.


@Spotware

ycomp
04 May 2017, 05:27

does this limit apply to the Trading API also?

I never had any problems before creating and closing a bunch of trades one after another, since I started using the trading api.

but today I'm continually getting a socket closed from the trading API - the accounts API works fine from the same program with the same credentials.


@ycomp

ycomp
04 May 2017, 05:27

RE:

ycomp said:

does this limit apply to the Trading API also?

I never had any problems before creating and closing a bunch of trades one after another, since I started using the trading api.

but today I'm continually getting a socket closed from the trading API - the accounts API works fine from the same program with the same credentials.

on a pepperstone demo account


@ycomp

ycomp
04 May 2017, 05:33

ok, i think it is just I cleared out my logging and these things are more visible now. So seems to still work, just I'm wondering what causes the socket closed (I'm using java) errors - is it that I'm making too many requests too quickly?


@ycomp

Spotware
04 May 2017, 09:20

Hi ycomp,

Do you send a heartbeat to the server every 10 seconds as described here https://connect.spotware.com/docs/frequently-asked-questions ?

 


@Spotware

ycomp
04 May 2017, 10:12

RE:

Spotware said:

Hi ycomp,

Do you send a heartbeat to the server every 10 seconds as described here https://connect.spotware.com/docs/frequently-asked-questions ?

 

no, I send a ping request approx. every 5 seconds, unless in the last 5 seconds i've transmitted some other message (if my code is working correctly)

is that not sufficient?


@ycomp