Simultaneous Limit Orders

Questions about MultiCharts and user contributed studies.
deltastrike
Posts: 15
Joined: 11 Nov 2014
Has thanked: 5 times

Simultaneous Limit Orders

Postby deltastrike » 13 Aug 2015

It appears that I cannot have two simultaneous limit orders. When trying to submit one for the buy and one for the sell side, MC seems to be taking them sequentially. Here's an example of my code:

Code: Select all

If currentbar > 1 then begin
buy 1 contract next bar y limit;
sellshort 1 contract next bar x limit;
end;
When the next bar opens only the buy order will appear, and if/when filled the sell order will be submitted and cancelled instantly.

Any ideas?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Simultaneous Limit Orders

Postby Henry MultiСharts » 13 Aug 2015

Hello deltastrike,

We have tested this code on our end and it successfully submits both orders at broker at the same time as expected. First of all you need to check if an order is not being generated or it is being declined by broker.
In MultiCharts go to File -> New -> Order and position tracker window->Orders tab. Check if both orders were generated and their State. If the order is Rejected then go to Logs tab to check the reason for that. If the order is not generated - please verify the order generation logic by outputting the variables and conditions involved in order generation. Here is a sample code for that: 
https://www.multicharts.com/trading-sof ... t_Executed


Return to “MultiCharts”