Execution delay  [SOLVED]

Questions about MultiCharts and user contributed studies.
brianhclo
Posts: 31
Joined: 31 Mar 2014
Has thanked: 8 times

Execution delay

Postby brianhclo » 17 Nov 2014

Hi Guys,

This morning I ran 2 strategies live and when it is time to execute (I used time based orders) I see the following message highlighted in RED at the bottom of the MC.

"the longest batch of order queues is XX / maximum delay of a processed batch of is 29 seconds."

And that after the trade was executed it is exactly 29 seconds behind. Does anyone know what is the issue that is causing the delay?

29 seconds delay is not really acceptable, I really need this to be fixed somehow.

Thanks so much.

User avatar
TJ
Posts: 7158
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 988 times
Been thanked: 2042 times

Re: Execution delay

Postby TJ » 17 Nov 2014

Would this had to do with the increased volume due to Shanghai-Hong Kong Stock Connect?

brianhclo
Posts: 31
Joined: 31 Mar 2014
Has thanked: 8 times

Re: Execution delay

Postby brianhclo » 17 Nov 2014

I dont think so to be honest. I am trading HSI/HHI.HK and the volume is probably more than an average day but nothing spectacular.

To help me understand the issue. Do you think its due to

1) speed of data feed?
2) computational speed?
3) order transmission speed? (unlikely i think)

User avatar
Henry MultiСharts
Posts: 9066
Joined: 25 Aug 2011
Has thanked: 1256 times
Been thanked: 2911 times

Re: Execution delay

Postby Henry MultiСharts » 17 Nov 2014

We are currently analyzing this case.

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

Re: Execution delay

Postby tony » 18 Nov 2014

I noticed the same message recently. I was not in a trade but noticed it nonetheless. I am running the latest version and build of MC.

User avatar
Alex MultiCharts
Posts: 194
Joined: 09 Aug 2013
Has thanked: 43 times
Been thanked: 76 times

Re: Execution delay

Postby Alex MultiCharts » 19 Dec 2014

I dont think so to be honest. I am trading HSI/HHI.HK and the volume is probably more than an average day but nothing spectacular.

To help me understand the issue. Do you think its due to

1) speed of data feed?
2) computational speed?
3) order transmission speed? (unlikely i think)
In your case the script is calculated using 2 data series, data 1 - 10 seconds, data2 - 1 minute. 10 second bars will wait until the new minute bar is completed, as IOG is not used. And when the market opens, then amount of orders sent by your script might be larger, than usual. To change this behavior, disable Real-time history matching box (go to Strategy Properties -> Backtesting tab) and then a script will be calculated on data series 1 using the updating values from data series 1 and the latest static available values from data series 2. Please follow this link to find more details on how this option is working: http://www.multicharts.com/trading-soft ... y_Matching

In the Log files the developers noticed that you had disconnections from IB and then the data gap was filled. And as the result the 10 second chart was waiting for a new minute bar and then the script was calculated sending the large amount of data packages through the API.
I noticed the same message recently. I was not in a trade but noticed it nonetheless. I am running the latest version and build of MC.
These messages might appear only if you are auto trading. If auto trading is not turned on, then most likely you are referring to another one, saying that you have quotes in queue.

Order batches might be in queue due to several reasons, 2 of them were specified above, but to find out the exact reason of the issue we will need to study each case individually.
To do so, when the issue persists, please send us the following files so that we would be able to investigate the issue:

1. The workspaces where the issue is reproduced.
2. Export of used symbols (without data) from QuoteManager in .qmd archive: https://www.multicharts.com/trading-sof ... rting_Data
3. The exported scripts with all dependant functions that are used on the workspace: https://www.multicharts.com/trading-sof ... ng_Studies
4. The screenshots demonstrating the issue.
5. Step-by-step instruction how to reproduce the issue.
6. MultiCharts Logs: https://www.multicharts.com/trading-sof ... harts_Logs

As soon as we receive the requested files, the engineers will study the case and we will get in touch with you when we have any feedback from them.

Alternatively, please come to our Live Chat Mon-Fri from 6:30 AM to 3 PM EST and demonstrate the issue: http://messenger.providesupport.com/mes ... pport.html

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

Re: Execution delay

Postby tony » 13 Jan 2015

I wanted to reopen this topic. I notice this with auto-trading on with ES as the instrument. It seems to only happen around the cash market open, and perhaps for 15-20 minutes. I too run multiple data series (3 in total). I am not in a trade when I see a red warning that the maximum delay is greater than 10 seconds nor is my signal generating an order.

User avatar
Alex MultiCharts
Posts: 194
Joined: 09 Aug 2013
Has thanked: 43 times
Been thanked: 76 times

Re: Execution delay

Postby Alex MultiCharts » 13 Jan 2015

Hello tony,


If you have this issue reproduced, please follow the instructions specified in my previous post.

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

Re: Execution delay

Postby tony » 13 Jan 2015

Naive question on my part Alex, but what exactly is an "orders queue?" I understand the concept of an order I submit being "in the queue" but in the example noted on this topic my signal is generating no orders. I was curious what exactly an "orders queue" is defined as in the eyes of MultiCharts. Thank you -

User avatar
Alex MultiCharts
Posts: 194
Joined: 09 Aug 2013
Has thanked: 43 times
Been thanked: 76 times

Re: Execution delay

Postby Alex MultiCharts » 14 Jan 2015

Hello tony,

These are not the orders that are in a queue, these are batches of orders, that can be empty. And even if no orders are sent and no position is opened, the empty batches of orders are sent at every calculation of the script (for example, for keeping alive an active price order). If you are using IOG, it will be happen more often.
These empty packages cannot be avoided, as this is how MC is working through the API when auto-trading. These are the packages that are necessary for broker plug-in to work correctly in MultiCharts when auto-trading.

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

Re: Execution delay

Postby tony » 13 Apr 2015

I wanted to open this topic again and see if anyone else notices any problems with a delay based on a batch of orders queue.

I know it's not my machine. My machine is very powerful in regards to processor, memory, etc. And I only run one workspace, one chart and just a handful of indicators. And my signal is not overly long in terms of lines of code / calculations to be performed. I trade ES and notice it happens more when (a) cash markets open and or (b) volume picks up. When I trade ZB I do not see this happen.

I spoke with Rithmic about it, and they felt it was not anything on their end. Any orders they receive are processed with no delay was their feedback.

Anyone have any problems with this? Thank You -

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: Execution delay

Postby MAtricks » 13 Apr 2015

I have seen this when I'm placing many resting orders in the market at one time.

Its hard to get the whole picture with your written examples. Do you have an example piece of execution code and a workspace which you can post?

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

Re: Execution delay

Postby tony » 13 Apr 2015

I've seen it only with ES and with two different signals, so I don't believe it has anything to do with the signal I use. Seems like it is with a certain securities that trade in very high volume/frequency. With ZB for example I have not seen it happen. It's predominantly at the cash market open and when there is a big move in price with a lot of trades happening (in the market, not trades in my system).

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

Re: Execution delay

Postby tony » 13 Apr 2015

Not sure if this is related or not, but I have noticed two instances where there was a delay in my signal generated trade filling (I buy or sell on entry at market) of 2-3 seconds. Each of those instances there was also a delay of 5 seconds of my OCO order being generated.

My signal is such that immediately upon entry I generate an OCO order and this usually happens within 100-200 milliseconds of my initial fill (buy, sell short) order. But I also use recalclastbarafter(5) in case the broker doesn't report back for some reason when I fill or if the market is moving slow.

So each instance where I was delayed in filling my buy or sell short entry (at market, not a limit order so the fill should be instantaneous), there was also a delay in my OCO order being generated.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: Execution delay

Postby MAtricks » 13 Apr 2015

It is not a general problem with ZB or ES. I have rithmic and see no related issues on my end.

-Make sure you're updated completely. An old version had this exact problem.
-Check your code. I'd suggest posting an example form of it. The problem most likely lies here.

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

Re: Execution delay

Postby tony » 13 Apr 2015

It is not a general problem with ZB or ES. I have rithmic and see no related issues on my end.

-Make sure you're updated completely. An old version had this exact problem.
-Check your code. I'd suggest posting an example form of it. The problem most likely lies here.
Do you run a scalping system that calculates on every single tick? I'm using 5 min. bars and IOG=true so I am likely generating a lot of "orders" even though the majority of these "orders" are defined further above in this post, as not actual trades.

I do have the most current version of MC installed.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 279 times

Re: Execution delay

Postby MAtricks » 13 Apr 2015

I run a variety of systems. I'm 99% sure this problem lies within your code. Write up a working example so we can analyze it.

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

Re: Execution delay

Postby tony » 13 Apr 2015

I'm going to give Rithmic another shot at why there is a delay. I sent them order numbers so see if they may be able to see anything on their end. If they don't then I'll post some code. Thanks for taking the time to share your feedback.

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

Re: Execution delay

Postby tony » 14 Apr 2015

I sent my log files to MC and it appears I was sending empty batches of orders causing this queue. I'll confirm tomorrow when cash markets open which is when I typically see this problem arise, if that was the fix. It makes sense.

The fix was a registry edit, which I'd rather not post here in case someone randomly starts editing their registry. If this was the fix though, I'll update and anyone is welcome to PM me if they want to know where / how to edit the registry if they have a similar problem.

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

Re: Execution delay  [SOLVED]

Postby tony » 15 Apr 2015

That was the fix and thanks to the MC team, once again for figuring this out. If anyone is running a scalping system, trading an instrument like ES that generates a lot of script calculations, then you need to make sure you are not sending batch queues causing order delays. The fix for me, was to make sure empty batches were not being sent / processed. You are welcome to PM me for how to update the registry if you are dealing with this issue. Thank you MC!

escamillo
Posts: 202
Joined: 25 Mar 2011
Has thanked: 23 times
Been thanked: 56 times

Re: Execution delay

Postby escamillo » 04 Mar 2016

Thanks Tony.

Can MultiCharts please post the fix. I am seeing this issue now.

MC64 Version 9.1 Release (Build 12010)
Last edited by escamillo on 04 Mar 2016, edited 1 time in total.

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

Re: Execution delay

Postby tony » 04 Mar 2016

Thanks Tony.

Can MultiCharts please post the fix. I am seeing this issue now.
If you want to PM me I will send you what MC sent me in regards to the required registry edit.

escamillo
Posts: 202
Joined: 25 Mar 2011
Has thanked: 23 times
Been thanked: 56 times

Re: Execution delay

Postby escamillo » 04 Mar 2016

Thanks Tony.

Can MultiCharts please post the fix. I am seeing this issue now.
If you want to PM me I will send you what MC sent me in regards to the required registry edit.
Thanks very very much Tony. The info in your PM and a reboot seem to have taken care of things. Really appreciate it.

wilkinsw
Posts: 511
Joined: 21 Apr 2013
Has thanked: 130 times
Been thanked: 84 times

Re: Execution delay

Postby wilkinsw » 21 May 2018

Hi,

I'm seeing this issue when testing a range of IOG signals that I'm running on paper trader.

I've been so careful to make sure script calculation is as infrequent as possible, yet I'm suffering big order queues.

What is the disadvantage of the redistry edit that stops empty batches? Surely there must be one else it would be the default behaviour, no?

Thanks.
big queues.PNG
big queues.PNG (178.88 KiB) Viewed 1675 times

hughesfleming
Posts: 229
Joined: 22 Apr 2014
Has thanked: 56 times
Been thanked: 58 times

Re: Execution delay

Postby hughesfleming » 21 May 2018

I would like to know the answer to this as well. I am seeing this at the open in Multicharts when Portfolio Trader is entering orders.


regards,


Alex

User avatar
Anna MultiCharts
Posts: 405
Joined: 14 Jul 2017
Has thanked: 28 times
Been thanked: 103 times

Re: Execution delay

Postby Anna MultiCharts » 23 May 2018

Hello, wilkinsw and hughesfleming!

The batches of orders/order queue indication can appear due to a high number of strategy calculations and events. For example if there are a lot of charts auto trading/IOG enabled on fast markets/lots of order modifications/rejects, etc.
All these events are being logged by default which takes some of PC resources and may prevent MultiCharts from processing them in the platform that is why a queue is generated.

Enabling the fast logging mode or completely disabling order logging are possible solutions for this case. I’ll provide the relevant instructions below, but before you opt for any of them please make sure that:
1) you anti-virus/firewall is disabled and not doing any scans while MultiCharts is auto trading.
2) all MultiCharts processes are added to the white/trusted list.
3) your Windows or other apps are not downloading and installing any updates while MC is running. It would be best to disable all unnecessary apps running in the background to free the resources for MultiCharts/auto trading.

After this is done try enabling Fast Tracing logging mode for starters.
To enable Fast Tracing:
1. Please, close MultiCharts and make sure no processes are running in Task Manager -> Details Tab -> Description column -> click on the column name to sort all processes by Description -> no MultiCharts processes should be listed there.
2. Click Windows Start button -> type regedit -> click Enter.
3. Go to the following path for MultiCharts 64-bit: HKEY_CURRENT_USER\Software\TS Support\BugSlayer.
4. Right-click on the space on the right-side of the registry window -> New -> String Value -> “FastTrace\Enabled” is the name of the value -> right-click on it -> Modify -> type True -> click Ok.

If the issue is reproduced with Fast Tracing, then you can completely disable all trading logs.
The only side effect of it is that we won't be able to study any order related issues in case they arise.
If you need to try that as well down this registry path Computer\HKEY_CURRENT_USER\Software\TS Support\BugSlayer\your version of MultiCharts \TradingServer set the Trace\Enable key to False.


Return to “MultiCharts”