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?
Rejected orders at market close
-
- Posts: 72
- Joined: 20 Apr 2014
- Has thanked: 9 times
- Been thanked: 8 times
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Rejected orders at market close
Who is your broker?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?
-
- Posts: 72
- Joined: 20 Apr 2014
- Has thanked: 9 times
- Been thanked: 8 times
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Rejected orders at market close
For a 5 min chart on an instrument that closes at 1600.
try this:
try this:
Code: Select all
If Time < 1600 then
BEGIN
// -- your BUY/SELL logic here
END;
- 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
This probably is possible. But how, that depends on what you mean:2. Is there any way to limit the number of resubmissions of the order to say 3?
- 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?
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Rejected orders at market close
Probably you have a coding error. eg. improper use of IOG.::
2. Is there any way to limit the number of resubmissions of the order to say 3?
-
- Posts: 72
- Joined: 20 Apr 2014
- Has thanked: 9 times
- Been thanked: 8 times
Re: Rejected orders at market close
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.
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.
-
- Posts: 72
- Joined: 20 Apr 2014
- Has thanked: 9 times
- Been thanked: 8 times
Re: Rejected orders at market close
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?
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Rejected orders at market close
Hello DaveAronow,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?
This value can be configured in Format->Strategy Properties->Auto trading tab->"Stop auto trading after N rejected orders".
-
- Posts: 72
- Joined: 20 Apr 2014
- Has thanked: 9 times
- Been thanked: 8 times
Re: Rejected orders at market close
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?
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Rejected orders at market close
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.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?