Forum

What happens if a market order gets partially executed using ORDER_FILLING_RETURN?

Hi all. What happens if a market order gets partially executed using ORDER_FILLING_RETURN? Suposing my buy market order had 10 volume and the first level of ask price has only 5 volume. Does the market order will buy 5 in first ask price and the rest on following available ask prices until complete

Market Order consuming book to fill the total volume

Hello! What is the best way to send a market order and ensure that the order is done successfully, even if order volume needs to consume several levels of price of the book? I am using orders ORDER_TYPE_BUY/ORDER_TYPE_SELL , action TRADE_ACTION_DEAL and filling ORDER_FILLING_FOK , because I want to

Error when closing positions at the end of the day: 10036 - TRADE_RETCODE_POSITION_CLOSED

Hello guys! I've been racking my brain for days with errors that I'm having to close positions at the end of the day by time if I am still positioned. I already searched the forum and Google and I didn't find anything to solve it. I have always used this logic for years and it has always worked, but