Rejected orders at market close

Questions about MultiCharts and user contributed studies.
DaveAronow
Posts: 72
Joined: 20 Apr 2014
Has thanked: 9 times
Been thanked: 8 times

Rejected orders at market close

Postby DaveAronow » 15 Mar 2016

I'm finding that certain futures that close early (for example NYBOT Sugar) end up with rejected orders at the close if a position is open. MC tries to submit the order around 10-15 times until it stops.

1. Is there any way to prevent the order submission at the end of the trading day?
2. Is there any way to limit the number of resubmissions of the order to say 3?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Rejected orders at market close

Postby TJ » 15 Mar 2016

I'm finding that certain futures that close early (for example NYBOT Sugar) end up with rejected orders at the close if a position is open. MC tries to submit the order around 10-15 times until it stops.

1. Is there any way to prevent the order submission at the end of the trading day?
2. Is there any way to limit the number of resubmissions of the order to say 3?
Who is your broker?

DaveAronow
Posts: 72
Joined: 20 Apr 2014
Has thanked: 9 times
Been thanked: 8 times

Re: Rejected orders at market close

Postby DaveAronow » 15 Mar 2016

Openecry

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Rejected orders at market close

Postby TJ » 15 Mar 2016

For a 5 min chart on an instrument that closes at 1600.

try this:

Code: Select all


If Time < 1600 then
BEGIN
// -- your BUY/SELL logic here
END;

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Rejected orders at market close

Postby JoshM » 16 Mar 2016

2. Is there any way to limit the number of resubmissions of the order to say 3?
This probably is possible. But how, that depends on what you mean:
- are these 'resubmissions' the number of orders that are triggered per time period (like three order attempts per day max),
- or the number of trades submitted in the current position (so three order submissions per position),
- or the number of times any unfilled order is resubmitted to the broker,
- or are you talking here about the number of times that MultiCharts tries to submit an order before it stops trying?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Rejected orders at market close

Postby TJ » 16 Mar 2016

::
2. Is there any way to limit the number of resubmissions of the order to say 3?
Probably you have a coding error. eg. improper use of IOG.

DaveAronow
Posts: 72
Joined: 20 Apr 2014
Has thanked: 9 times
Been thanked: 8 times

Re: Rejected orders at market close

Postby DaveAronow » 16 Mar 2016

I wouldn't rule out a coding error -- that said what happens is an order is submitted at the market close (or one second after due to normal bar building lag) and it gets rejected. MC then tries to re-submit the order for around 15 seconds (it re-submits about 15 times in that span) and then stops.

This is different than the issue I found the other day when I messed up mapping contracts and was off on the multiplier for FCOJ futures. That order was rejected (MC was sending 122.15 when the price at the broker was 1.2215 -- this was my fault). However MC just kept trying to resubmit the rejected order (literally over 200 times) until I was able to shut off the automation.

Is there any way to just limit the re-submits, whether they are due to a coding error or something else? Specifically per Josh's post I want to limit the number of times the same order is attempted to be transmitted.

DaveAronow
Posts: 72
Joined: 20 Apr 2014
Has thanked: 9 times
Been thanked: 8 times

Re: Rejected orders at market close

Postby DaveAronow » 16 Mar 2016

Found a registry key named AT_MaxRejectsLimit which is set to 100. Can MC support confirm if I reduce this to say 10 it will stop re-submitting rejected orders after 10 tries?

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

Re: Rejected orders at market close

Postby Henry MultiСharts » 19 Apr 2016

Found a registry key named AT_MaxRejectsLimit which is set to 100. Can MC support confirm if I reduce this to say 10 it will stop re-submitting rejected orders after 10 tries?
Hello DaveAronow,

This value can be configured in Format->Strategy Properties->Auto trading tab->"Stop auto trading after N rejected orders".

DaveAronow
Posts: 72
Joined: 20 Apr 2014
Has thanked: 9 times
Been thanked: 8 times

Re: Rejected orders at market close

Postby DaveAronow » 19 Apr 2016

When this happens I don't want it to stop autotrading just stop resubmitting the same order. Any way to stop resubmitting it without disabling autotrading?

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

Re: Rejected orders at market close

Postby Henry MultiСharts » 20 Apr 2016

When this happens I don't want it to stop autotrading just stop resubmitting the same order. Any way to stop resubmitting it without disabling autotrading?
There is neither such option, nor access to order statuses from the PowerLanguage. The only thing that I can suggest is limiting the order generation in your code based on a time based criteria, similar to what was already suggested above by TJ.


Return to “MultiCharts”