Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid parameters when close or delete position #21

Closed
apoutchika opened this issue Sep 20, 2021 · 1 comment
Closed

Invalid parameters when close or delete position #21

apoutchika opened this issue Sep 20, 2021 · 1 comment

Comments

@apoutchika
Copy link

Hello,

I can not close a position after open it :

  x.positions.map((pos) => {
    x.Socket.send
      .tradeTransaction({
        order: pos.order,
        type: TYPE_FIELD.DELETE,
      })
      .then(console.log)
      .catch(console.error);
  });

I have this error :

{
  reason: { code: 'EX000', explain: 'Invalid parameters' },
  transaction: {
    command: 'tradeTransaction',
    type: 'Socket',
    request: {
      json: '{"command":"tradeTransaction","arguments":{"tradeTransInfo":{"customComment":"x163211469666300080","order":304233558,"type":4}},"customTag":"tradeTransaction_163211469666300080"}',
      arguments: [Object],
      sent: [Time]
    },
    response: { status: false, received: [Time], json: [Object] },
    transactionId: '163211469666300080',
    createdAt: Time { unit: [Array], UTCTimestamp: 1632114696663 },
    status: 3,
    transactionPromise: { resolve: null, reject: null },
    urgent: true
  }
}

I have the same error with CLOSE type.

Thank you for you'r help 🙏

@peterszombati
Copy link
Owner

peterszombati commented Sep 21, 2021

Hi @apoutchika try this

        x.Socket.send.tradeTransaction({
          order: number,
          type: TYPE_FIELD.CLOSE,
          volume: number, // volume in lot
          symbol: string, // position symbol
          price: 1, // it doesnt matter but required :)
        })

also please try solve these kind of issues by yourself with reading docs. for me I did same :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants