Topics
Replies
Spotware
30 Mar 2017, 15:31
1) in the docs it says "volume" is required, what value should I specify for volume to signify that the entire position should be closed? 0 doesn't work.
Yes, indeed. The volume is required. Apologies for the previous answer.
2) Heartbeat.
You do not need to aknowledge heartbeat receipt to the server. The server just lets you know that it is alive, in case your application needs this info. In a similar way, You will need to send a heartbeat to the server that your application is alive so the server keeps the connection open.
@Spotware
Spotware
30 Mar 2017, 12:10
RE: RE: RE:
mindbreaker said:
Spotware said:
ycomp said:
how should I handle the situation where my program:
1. sends a market order request
2. connection drops
3. market order filled
4. response message missed (because not connected)
5. reconnected
so now on the server will be an open trade, that my program doesn't know was opened
You can get an account's history at any time, including orders, positions and deals through Accounts API.
https://connect.spotware.com/docs/api-reference/accounts-apiBut in ConnectApi 2s refresh request interval exist (2 secomds in forex reality is eternity) !!!
Yes this is true for subsequent requests, but what ycomp desrcibes is a rare scenario which will not happen every less than two seconds.
@Spotware
Spotware
30 Mar 2017, 12:06
Hi mindbreaker,
Get the latest code from GitHub. Heartbeat issue is solved
And why there no queue for message ? When i hit cople buttons in short time application will crash.
The example's purpose is to demonstrate how to construct, send and receive a FIX message therefore it was kept as simple as possible. It does not have any practical use therefore there is no need to implement queueing or other mechanisms that would complicate the sample.
@Spotware
Spotware
30 Mar 2017, 11:42
RE:
ycomp said:
how should I handle the situation where my program:
1. sends a market order request
2. connection drops
3. market order filled
4. response message missed (because not connected)
5. reconnected
so now on the server will be an open trade, that my program doesn't know was opened
You can get an account's history at any time, including orders, positions and deals through Accounts API.
https://connect.spotware.com/docs/api-reference/accounts-api
@Spotware
Spotware
30 Mar 2017, 10:46
RE: RE:
ycomp said:
Spotware said:
Hi ycomp,
1) what is this heartbeat thing? I assume I can ignore using it if I ping the servers routinely?
Heartbeat is used to keep the communication link alive while there is no activity from the client side. Preferably use heartbeat.just to confirm.. if I use heartbeat, then I don't need to ping at all ?
Yes, for maithaining a live communication, sending heartbeats is adequate.
@Spotware
Spotware
30 Mar 2017, 09:43
Hi ycomp,
1) what is this heartbeat thing? I assume I can ignore using it if I ping the servers routinely?
Heartbeat is used to keep the communication link alive while there is no activity from the client side. Preferably use heartbeat.
2) and what is a positionId ? like in ProtoOACreateOrderReq ?
The position ID is used when you want the order not to create a new position but merge the deals into an existing position. If for example you create a BUY position of €1000 EURUSD and then send another order request of €1000 EURUSD with direction BUY and pass the open position's ID, then the position will become €2000 BUY, instead of having two separate positions.
3) how can I convert an orderID into a positionID so that I can call ProtoOAClosePositionReq
When orders are executed, the positionID is returned. See ProtoOAExecutionEvent
@Spotware
Spotware
29 Mar 2017, 17:17
Hi mindbreaker,
The forum exists mostly for community members to help each other. Therefore if you want to get speedy answers from the community, you need to be as clear as possible, else noone will be able to help you. Spotware staff usually intervenes only when some questions are very specific and cannot be answered by the community. Our specialists are currently occupied building and maintaining wonderful software therefore it might take some time to take an answer from them, especially when they don't have enough information to understand the problem.
Regarding the sample using SSL it will come soon but we can not provide a date.
@Spotware
Spotware
31 Mar 2017, 10:02
Hi ycomp,
Currently you cannot determine bedorehand if a symbol is tradable or not. When orders are send for a symbol in non tradable hours, you will receive a rejection message with error code MARKET_CLOSED. Please see https://connect.spotware.com/docs/api-reference/developer-library/common-model-messages
@Spotware