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
34 stars 3 forks source link

Off quotes error and trades being opened #5

Closed enzoferey closed 7 months ago

enzoferey commented 9 months ago

Hi! 😁

We are seeing a series of ERR_OFF_QUOTES error responses when placing trades. Since we only make market orders, as far as we have read, this error can only happen because of the slippage limit being exceeded. Is that correct?

Then, even though we are getting this error response back, trades are still being placed with slippage beyond our limits set when making the call via the options.slippage. We have checked the specifications of the symbols we trade and they are not set to SYMBOL_TRADE_EXECUTION_MARKET execution mode, so we are a bit lost on this one. Shouldn't the trades not be opened in this case?

Thank you for your help 🙏🏻

metaapi commented 8 months ago

Hello, please provide a minimalistic code example and step-by-step instructions demonstrating how to reproduce the issue. Please do not include any tokens or secrets into it. If you decide to include secrets in it please share the code example via support chat instead.

enzoferey commented 8 months ago

There is really nothing special to the call, that's why we didn't include it. We are just calling:

const response = await metaApiConnection.createMarketBuyOrder(
  tradeSymbol,
  positionSize,
  undefined,
  undefined,
  {
    clientId,
    slippage: slippagePoints,
  },
);

Finally, in order to create the metaApiConnection, we are using:

import MetaApi from "metaapi.cloud-sdk/node";

// Get MetaTrader account
const metaApi = new MetaApi.default(METAAPI_TOKEN);
const account = await metaApi.metatraderAccountApi.getAccount(METAAPI_ACCOUNT_ID);

// Wait until accont is deployed and connected to broker
await account.deploy();
await account.waitConnected();

// Get connection instance
const metaApiConnection = account.getStreamingConnection();

// Wait until connection is established
await metaApiStreamingConnectionInstance.connect();

// Synchronize local copy of the account state with the broker state
await metaApiStreamingConnectionInstance.waitSynchronized();

return metaApiConnection;

Just standard steps from your examples.

enzoferey commented 7 months ago

Hey @metaapi, any updates?

metaapi commented 7 months ago

I think it is better to contact support via online chat regarding the above because this issue is not related to SDK. Please mention the link to this ticket when you contact support so that they can assist you faster.

enzoferey commented 7 months ago

@metaapi we did contact support via online chat but we never got an answer, that's why we opened the issue here. It has been over 2 months and we still don't know if it's an SDK issue or an issue with MetaApi not passing properly the parameters to the underlying broker or a combination of wrong parameters + symbol characteristics. With all respect, it has been over 2 months at this point and it seems you don't really care giving support to your paying customers. How can we proceed?

On top of that, you have made the SDK closed source without further notice, so now running MetaApi is a complete blackbox and we cannot pin point ourselves if there is any issue on the logic.