metaapi / metaapi-javascript-sdk

Browser and node.js javascript SDK for MetaApi, a professional cloud forex trading API for MetaTrader platform which supports both MetaTrader MetaTrader 5 and MetaTrader 4. Free usage tier available.
https://metaapi.cloud
Other
30 stars 3 forks source link

Websocket client request of type trade timed out. #6

Closed Vultwo closed 6 months ago

Vultwo commented 8 months ago

Hi,

I am getting the following error when trying to open a trade using connection.createMarketOrder():

TimeoutError: MetaApi websocket client request ... of type trade timed out. Please make sure your account is connected to broker before retrying your request.

Even though I am getting the "trade timed out" error / exception, the trade is executed. I initialize the connection once and keep the connection stored as a global variable for easy access across my classes. Is there a function to check wether the connection is alive or not? I couldn't find one in the docs.

I am using the RPC API and I am also getting a lot of these errors that seem to resolve themselves but they are polluting my logs:

Failed to subscribe TimeoutError: MetaApi websocket client request ... of type subscribe timed out.

Should I be using the streaming API instead and is there a way to disable the MetaApi logs?

metaapi commented 6 months ago

Hello, is this issue still actual?

Vultwo commented 6 months ago

Hi, I am not using the SDK anymore so consider this issue closed. Other people might still face this issue though.