Slow to Generate Order

Questions about MultiCharts and user contributed studies.
shane1800
Posts: 84
Joined: 28 Feb 2014
Has thanked: 5 times
Been thanked: 5 times

Slow to Generate Order

Postby shane1800 » 17 Jun 2016

Hello,

I'm using Rithmic for futures broker and for data. I'm using PT on 5 minute charts my trades are generated about 20-30 seconds after the bar. So for instance 12:00:30. Does anyone have this happen and have idea on how to troubleshoot?

This maybe happening for only one of my strategies which is very simple. I need to get more trades in to see. But other strategies do not have this issue and go in at 12:00:01.

Thanks for looking.
Attachments
Screen Shot 2016-06-15 at 1.12.11 PM.png
(13.21 KiB) Downloaded 795 times

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

Re: Slow to Generate Order

Postby TJ » 17 Jun 2016

Hello,

I'm using Rithmic for futures broker and for data. I'm using PT on 5 minute charts my trades are generated about 20-30 seconds after the bar. So for instance 12:00:30. Does anyone have this happen and have idea on how to troubleshoot?

This maybe happening for only one of my strategies which is very simple. I need to get more trades in to see. But other strategies do not have this issue and go in at 12:00:01.

Thanks for looking.
If this is happening to only one strategy but not the others,
then you have to investigate this strategy in detail.

What is the instrument? is it liquid?

What is your chart resolution?

Have you tried this strategy on different instruments?
Do they have the same behavior?

Are you using BarStatus in your code?

Where is your computer?
A local computer? or a remote shared server at a hosted location?

shane1800
Posts: 84
Joined: 28 Feb 2014
Has thanked: 5 times
Been thanked: 5 times

Re: Slow to Generate Order

Postby shane1800 » 17 Jun 2016

If this is happening to only one strategy but not the others,
then you have to investigate this strategy in detail. >> I WILL TAKE A LOOK CLOSER, NEED TO GATHER MORE DATA

What is the instrument? is it liquid? >> GASOLINE FUTURES, LIQUID

What is your chart resolution? >> 5 MIN

Have you tried this strategy on different instruments? >> NO, NOT ABLE TO TRADE OTHER INSTRUMENTS
Do they have the same behavior?

Are you using BarStatus in your code? >> NO

Where is your computer? >> IN AURORA CME
A local computer? or a remote shared server at a hosted location?

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

Re: Slow to Generate Order

Postby JoshM » 18 Jun 2016

I'm using Rithmic for futures broker and for data. I'm using PT on 5 minute charts my trades are generated about 20-30 seconds after the bar. So for instance 12:00:30. Does anyone have this happen and have idea on how to troubleshoot?

This maybe happening for only one of my strategies which is very simple. I need to get more trades in to see. But other strategies do not have this issue and go in at 12:00:01.
Looking at the screenshot I don't think it's caused by Rithmic since the time when the order generated was already late, and that's MultiCharts' doing. It can also be caused by the data feed, but then it's still MultiCharts waiting on the data before calculating the script.

I also figure from your description that the strategy calculates on bar close. In that case, it's likely not due to the strategy's code. After all, if the strategy calculates once with every 5-minute bar, it can't submit orders at 12:00:30. (Assuming the instrument has plenty of price updates.)

I don't know how active gasoline futures trade at 12:00 in the time zone you use, but the best bet would probably be that the 12:00:00 bar didn't close until 12:00:20 because there wasn't an incoming tick in the mean time.

If you want a strategy to submit an order at 12:00:01 regardless of whether there was a tick at 12:00:00 or 12:00:01, you can enable IntrabarOrderGeneration with RecalcLastBarAfter() to have the strategy calculate with every second. That way you can submit an order regardless of whether there was an incoming tick at 12:00:00 or whether the tick that closed the price bar was only received at 12:00:20. In other words, those two keywords make your script more independent from incoming real-time ticks, and that allows for making the strategy much more quicker.

This approach does require rewriting your strategy code, and doesn't work with all strategies. For example, if your strategy relies on the price of the last 20 trades, then calculating the strategy every second doesn't change that value and so the script can't be made quicker -- it would still have to wait then till the next tick arrives.

shane1800
Posts: 84
Joined: 28 Feb 2014
Has thanked: 5 times
Been thanked: 5 times

Re: Slow to Generate Order

Postby shane1800 » 18 Jun 2016

That is very helpful thank you!

I will watch for the ticks and see if this happens because of available trades and so forth...


Return to “MultiCharts”