How to place two open orders with opposite sides?

Hi!

Please help me understand, I want to achieve this:

So, I am able to open Long position with posting first buy order.
Then I create Close Long order, and that is fine (like first line on the picture).

But when I create new Open Long for higher amount and lower price, I am receiving errors like:
“Parameter ‘price’ sent when not required.”, or “Parameter ‘TimeInForce’ sent when not required.”.
As I understand it tries to fill this order immediately.

On the second picture are actual settings for the Open Long order. But when I try to place order with settings like that, it fails as described. Where is the trick?

Any ideas how to achieve this? because I see that it can be done :slight_smile:

The above errors should not occur if your scenario is done correctly.

You are either

  • Calling the wrong endpoint.
  • Placing a MARKET order.

I suggest debugging the code and log the API request URL sent to the server.

1 Like

I’ve got it. First to were Limits, but the third was Market order :man_facepalming:. Thank you!