Replies

vasile.peste
31 Dec 2023, 08:15 ( Updated at: 31 Dec 2023, 09:21 )

Redacted

 

It is working as expected now, for future devs, please make sure that keys exists before getting them with the native Json API of .NET

We were trying to always get “clientMsgId” which is not specified in Events, and leaded to exceptions being thrown!


@vasile.peste

vasile.peste
23 Dec 2023, 05:07 ( Updated at: 31 Dec 2023, 08:50 )

RE: RE: RE: WebSocket Spots Subscription Not Working

Redacted


@vasile.peste

vasile.peste
22 Dec 2023, 08:36

RE: WebSocket Spots Subscription Not Working

PanagiotisCharalampous said: 

Hi Vasile,

Is it possible to provide us with a complete log of exchanged messages or at least a more expanded one?

Best regards,

Panagiotis

 

It seems the issue doesn't affect only Spot events but also Execution events!

I can provide an easier way to reproduce:

  1. Connect to the WebSocket server
  2. Authenticate the application and the trading account
  3. Place a limit/stop order
  4. Cancel it from the Web terminal or any other client
  5. The Execution event is not sent to the WebSocket connection

 

If it's useful, we are using the FTMO broker. If you cannot reproduce, we will provide more detailed logs as requested

If you can reproduce it, it's clear that it becomes an urgent issue…

Thank you!


@vasile.peste

vasile.peste
25 Nov 2023, 10:14 ( Updated at: 26 Nov 2023, 07:27 )

Not working

Same, I cannot connect

 

wss://live.ctraderapi.com:5036

You can test quickly here

https://www.piesocket.com/websocket-tester

The server closes the connection and throws a SSL error


@vasile.peste

vasile.peste
20 May 2023, 22:54

RE:

olehmalkov said:

Hi,
We are trying to place an order via API using node.js and get the following error:
Unknown payload type – 2142.
At the same time we are sure that there are no problems with authorization and it’s completed successfully, as we receive the actual account balance.

The code we are using is below:

const myOrder = await myAccount.placeOrder({
    symbol: "EURUSD",
    direction: MidaOrderDirection.SELL,
    volume: 1
});

Has anyone experienced the same issue and can share any ideas how to fix it?

Thank you

Hello, this errors occurs when you don't give Trading permissions to your trading accounts


@vasile.peste

vasile.peste
30 Jul 2022, 20:20 ( Updated at: 21 Dec 2023, 09:22 )

Hi, I know it's about Python, but I just want to show how easy this could be using JavaScript/Mida.

You can check it here https://www.mida.org, there is a small community behind if you need help


@vasile.peste

vasile.peste
30 Jul 2022, 20:15

RE:

giuseppesciacovelli9 said:

Buongiorno,

per un trader, in generale, e per me in particolare andare ad integrare tante linee di codice e farle funzionare sta risultando un pò arduo. Non ci potreste semplificare ulteriormente la vita? Come? Dando il programma già funzionante solo da mettere le credenziali poi uno da Excel si porta i dati dove vuole. Quali dati? Prezzi Bid ed Ask, data orario (ora, minuti e secondi), Commissioni del Broker, Margini, ecc. ecc.

Scusate ma non si può conoscere tutto in modo approfondito. Grazie per il tempo che mi dedicherete per la risposta.

Giuseppe S. (Vs. affezionato sostenitore).

Ciao Giuseppe, qui dovresti parlare in Inglese altrimenti nessuno ti aiuterà, detto questo, sono d'accordo che determinate implementazioni siano difficili anche per un programmatore esperto. E risolvere molti problemi, anche semplici, diventa più un problema ingegneristico che va fuori dal trading.

Detto questo, puoi dare un'occhiata a questo engine che ho creato, se ti basta ricavare I prezzi, con Mida puoi farlo usando pochissime linee di codice, https://www.mida.org


@vasile.peste

vasile.peste
06 Dec 2021, 09:37

RE:

dudegrowth said:

Hi,

I've been trying for 2 days now and i'm not being lucky in trying some github repos that already made nodejs version of open api v2.

I've tried this library which at first part it looked to me that i found the solution i was searching for but still im not able to do anything with it because in first part when i try to connect with it it fails. https://github.com/Reiryoku-Technologies/Mida.

Did you found any solution regard that?

Hi, the Mida framework you tried is still under development, under the hood it's using cTrader Layer for Node.js which is a library allowing you to use Open API v2. Let me know if it solves your problem!


@vasile.peste

vasile.peste
08 Jul 2021, 00:05 ( Updated at: 08 Jul 2021, 00:06 )

Hi, a way (not tested) for retrieving the last price of a symbol is requesting the latest ticks of the symbol.

Steps:

  1. Send a ProtoOAGetTickDataReq request (https://spotware.github.io/open-api-docs/messages/#protooagettickdatareq) setting "toTimestamp" to the actual date, and "fromTimestamp" to some time before the actual date (maybe 3-4 days before is a good choice to avoid getting zero ticks because of weekends).
  2. Get the latest tick by timestamp and then get its price. This should be the last symbol BID/ASK price (depending on which quotation type you requested in step 1).

@vasile.peste