Giter Club home page Giter Club logo

Comments (7)

raul-gherman avatar raul-gherman commented on September 3, 2024 1

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.

amusleh-spotware-com avatar amusleh-spotware-com commented on September 3, 2024

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.

Vasile-Peste avatar Vasile-Peste commented on September 3, 2024

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.

raul-gherman avatar raul-gherman commented on September 3, 2024

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.

Vasile-Peste avatar Vasile-Peste commented on September 3, 2024

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.

amusleh-spotware-com avatar amusleh-spotware-com commented on September 3, 2024

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.

Vasile-Peste avatar Vasile-Peste commented on September 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.