Comments (7)
than the proper request, I guess, is to include clientMsgId (on backend side) in ProtoOAExecutionEvent that is dispatched (still, not sure how easy or hard it is to keep track -- once again, on backend side)
from openapi-proto-messages.
Hi,
Here is our response for each of you abovementioned points:
- We will create a new request for getting a position deals
- Leverage will be added on next version
- Wrong. Schedule + holidays + tradingMode fully determine trading possibilities. Nothing must be done on our side
- We will a request for getting a deal closing/opening deals
- You can use Spot event to get latest tick of a symbol
- We can't provide the real time P&L, because it will consume lots of resource on our side, you have to calculate it by yourself and we have a tutorial for it on API documentation
- To track rejected/missed deals you can use ProtoOAOrder.closingOrder, the closePositionDetail only appears in case of a successful closing deal
- In order to correctly identify responses, client must use unique ProtoMessage.clientMsgId for every request, sent to server. response (even error) will always contain same clientMsgId. identification ussing label, comment, etc - is bad design
from openapi-proto-messages.
Alright, regarding the last point. I would like to make an example.
I send two asynchronous order requests for EURUSD and XAUUSD symbols.
I get two events,
First one
{
payloadType: 'PROTO_OA_ORDER_ERROR_EVENT',
ctidTraderAccountId: 'xxx',
errorCode: 'INVALID_VOLUME' orderId: null,
positionId: null,
description: 'Trading is not available: Market is closed.'
}
Second one
{
payloadType: 'PROTO_OA_ORDER_ERROR_EVENT',
ctidTraderAccountId: 'xxx',
errorCode: 'TIMEOUT_ERROR' orderId: null,
positionId: null,
description: 'Trading is not available: Market is closed.'
}
How to associate each error response to the respective order request? How do I know if timeout is for EURUSD request or XAUUSD request?
from openapi-proto-messages.
hey @Vasile-Peste you can use clientMsgId (at ProtoMessage level) -- if you set its value at request level, you will receive the same value at reply level, thus knowing exactly which reply was sent for which request
from openapi-proto-messages.
hey @Vasile-Peste you can use clientMsgId (at ProtoMessage level) -- if you set its value at request level, you will receive the same value at reply level, thus knowing exactly which reply was sent for which request
The example I made is not about request reply: it's about events, more precisely ProtoOAExecutionEvent, and they do not contain the clientMsgId of your request. I have just printed the server event after performing the order request, it's clear that the clientMsgId is not defined in the event.
from openapi-proto-messages.
Alright, regarding the last point. I would like to make an example.
I send two asynchronous order requests for EURUSD and XAUUSD symbols. I get two events,
First one
{ payloadType: 'PROTO_OA_ORDER_ERROR_EVENT', ctidTraderAccountId: 'xxx', errorCode: 'INVALID_VOLUME' orderId: null, positionId: null, description: 'Trading is not available: Market is closed.' }
Second one
{ payloadType: 'PROTO_OA_ORDER_ERROR_EVENT', ctidTraderAccountId: 'xxx', errorCode: 'TIMEOUT_ERROR' orderId: null, positionId: null, description: 'Trading is not available: Market is closed.' }
How to associate each error response to the respective order request? How do I know if timeout is for EURUSD request or XAUUSD request?
Hi,
The PROTO_OA_ORDER_ERROR_EVENT returns the client message ID, here is an example:
payloadType: 2132
payload: "\022\022TRADING_BAD_VOLUME(\362\366\224\010::Order volume 1.00 is smaller than group minVolume=1000.00."
clientMsgId: "dsfdsf"
I send a new order request with invalid volume amount, and I received back the above response which has my client message ID.
from openapi-proto-messages.
Clear! You are right, my bad cause I parse only the payload of incoming messages. Thank you for your patience, I'm looking forward to see your updates.
from openapi-proto-messages.
Related Issues (10)
- Node.js usage HOT 2
- Tag new version HOT 4
- Provide clientId and clientSecret for testing HOT 1
- ProtoOaOrderErrorEvent should populate orderId and / or positionId HOT 4
- ProtoOACtidTraderAccount.ctidTraderAccountId data type is uint64, but everywhere else ctidTraderAccountId is int64
- OpenApiMessages.proto: ProtoOATraderLogoutReq -> ProtoOAAccountLogoutReq
- P&L calculation pseudo-code correction HOT 1
- Request for retrieving orders by position id HOT 1
- API Request HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openapi-proto-messages.