Orders not submitting on start of new trading session

Questions about MultiCharts and user contributed studies.
wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Orders not submitting on start of new trading session

Postby wilkinsw » 24 Apr 2015

Hi,

I've just migrated from Pats to CQG.

With Pats: everyday I had to restart MC just before the 2300gmt (1800et) session restart for my Globex symbols (a Pats requirement). At the restart all charts with live autotrading enabled would submit orders as expected.

With CQG: I don't have to perform a platform restart just before 2300gmt (yay!). BUT, orders are not getting submitted once the respective Globex symbols commence trading. To resolve i have to go through all live charts and turn autotrading off/on .

What is it that I'm missing here? This sounds like a newbie question.

More detail:

at the session close my OPT is showing orders get cancelled. Then orders attempt to get submitted and are rejected ("can't submit when markets are closed").

I use DAY orders. But I don't see why that should stop new DAY orders being submitted at the restart.

Do I need to change my instrument session time settings??

Thanks for your help!!

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: Orders not submitting on start of new trading session

Postby wilkinsw » 27 Apr 2015

I spoke to Multicharts today on this issue and am still confused.

Can Multicharts please provide some literature (here if possible) specifying the the rules of order auto-submission once the market is closed and preopen.

In another thread I read Andrew saying that orders won't be submitted if outside the QM stated sessions. I don't find this. My signals make an attempt to submit orders at 171500.xxxx (ie just after the close of Nymex), resulting in subsequent rejections, despite my QM setting stating that 1715ct is the close. So why does this happen?

If I code the strategy to not submit an order if time=closing time, will this mean that, finally orders will get submitted at the 1800ct restart? (as a result of not triggering rejections at 171500.xxxx).


Seperately, is it possible to submit order approx 10mins before the 1800 restart (during premarket), automatically? Would...." if computer time = xxxxxxx then recalclastbarafter(1).... submit orders " work?

Many thanks.

tony
Posts: 420
Joined: 14 Jun 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Re: Orders not submitting on start of new trading session

Postby tony » 27 Apr 2015

Shouldn't you be using GTC orders since you are not closing out the position? At least it sounds like you are not closing out the position at the end of day. I had a similar situation a while ago and can't fully remember the details but limit and stop orders (OCO bracketed) would cancel at the open (after the cash close) and resubmit so I lost my line queue on the LMT order. I was also using IB at the time, but no longer. Now I go flat at the cash close.

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: Orders not submitting on start of new trading session

Postby wilkinsw » 27 Apr 2015

Do you know what, I have no idea why I overlooked that!! Will try it, I'm sure you're right.

If Henry or Andrew, in the meantime, could kindly advise on why orders get resubmitted (having been cancelled at the close because they are DAY orders!) when the market is closed (between 1715ct and 1800ct). Or advise if this is expected behavior, Id be very appreciative.

Also please advise on: does recalclastbarafter(x) allow the submission of orders premarket (eg 1750ct), once autotrading is turned on? This is of particular interest as currently I'm often bombarding the CQG gateway with orders in the first second of trade (1800ct) and hitting a max orders per second limit (and getting rejections).

Thanks.

tony
Posts: 420
Joined: 14 Jun 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Re: Orders not submitting on start of new trading session

Postby tony » 27 Apr 2015

From my knowledge of recalclastbarafter() from what I understand and I use it in my own script, is it will recalculate your script after a set time. I'm stating the obvious. But I believe it doesn't know nor care about market hours, it's literally just doing what it's told, calculate the script after X seconds. In fast moving markets it's likely overkill but in slower moving markets it's not. I have it set to 5 seconds trading ES and likely don't even need it. With ZB I do need it though.

Forgot to add, recalclastbarafter() is a max time that can elapse before a script calculation. It's not a speed bump if you will that will limit how often a script is calculated. For example if there is a price change, the clock starts counting and if another price trades even the same price, the script is recalculated and the clock starts counting again. Now if time is exceeded (met) before a trade in the market, the script recalcs because of recalclastbarafter() but the prior recalcs of the script would have occurred because of a trade in the market (assuming you are using IOG=True mode).

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

Re: Orders not submitting on start of new trading session

Postby Henry MultiСharts » 27 Apr 2015

Do you know what, I have no idea why I overlooked that!! Will try it, I'm sure you're right.

If Henry or Andrew, in the meantime, could kindly advise on why orders get resubmitted (having been cancelled at the close because they are DAY orders!) when the market is closed (between 1715ct and 1800ct). Or advise if this is expected behavior, Id be very appreciative.
The orders can be resubmitted only if they are generated by the code. MultiCharts does only what the code tells it to do. It does not manage the orders without the code. MultiCharts also has not idea about market being open or closed. If you do not want to have the orders generated - you need to limit it from your code.
Also please advise on: does recalclastbarafter(x) allow the submission of orders premarket (eg 1750ct), once autotrading is turned on? This is of particular interest as currently I'm often bombarding the CQG gateway with orders in the first second of trade (1800ct) and hitting a max orders per second limit (and getting rejections).
Orders can be sent to broker on recalclastbarafter calculation only if IOG is enabled.

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: Orders not submitting on start of new trading session

Postby wilkinsw » 27 Apr 2015

Orders can be sent to broker on recalclastbarafter calculation only if IOG is enabled.
Why is it, say in the middle of a 60min bar, with IOG=off: If I turn autotrading ON, orders get submitted immediately. The code doesn't wait until the first tick of the next bar.

So why would it not do the same with IOG=off, 10mins before the market opens? Instead no orders are submitted and instead it waits for the first tick after the open?

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

Re: Orders not submitting on start of new trading session

Postby Henry MultiСharts » 30 Apr 2015

Orders can be sent to broker on recalclastbarafter calculation only if IOG is enabled.
Why is it, say in the middle of a 60min bar, with IOG=off: If I turn autotrading ON, orders get submitted immediately. The code doesn't wait until the first tick of the next bar.
Orders are sent upon start of auto trading if they were generated on the last closed bar - that is expected behavior.
So why would it not do the same with IOG=off, 10mins before the market opens? Instead no orders are submitted and instead it waits for the first tick after the open?
Upon start of auto trading the signal is recalculated, while when auto trading is running with IOG=off, the signal is calculated on bar close only.

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: Orders not submitting on start of new trading session

Postby wilkinsw » 30 Apr 2015

Orders are sent upon start of auto trading if they were generated on the last closed bar - that is expected behavior.
But this isn't always the case. Take the close of Soybeans just now. For my system, orders were working into the close (conditions were valid to be working entry orders). I performed a MC reboot. Turned off auto trading. Cancelled the orders and turned auto trading back on. No orders were submitted (because the market was closed??). Why is this?

What is the system waiting for? A tick? Or for the market to open as defined by the symbol definitions? What is the specific reason why an order can't be submitted in this situation? That is my question.

What might be the work arounds (so that orders are submitted when the market is in its "premarket" state), would be my next one.

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

Re: Orders not submitting on start of new trading session

Postby Henry MultiСharts » 04 May 2015

Orders are sent upon start of auto trading if they were generated on the last closed bar - that is expected behavior.
But this isn't always the case. Take the close of Soybeans just now. For my system, orders were working into the close (conditions were valid to be working entry orders). I performed a MC reboot. Turned off auto trading. Cancelled the orders and turned auto trading back on. No orders were submitted (because the market was closed??). Why is this?

What is the system waiting for? A tick? Or for the market to open as defined by the symbol definitions? What is the specific reason why an order can't be submitted in this situation? That is my question.

What might be the work arounds (so that orders are submitted when the market is in its "premarket" state), would be my next one.
wilkinsw,

Please add output to your code to see whether code should place orders or the conditions for order generation are not met. Here is an example how to do that.


Return to “MultiCharts”