SmartQuant Discussion
http://www.smartquant.com/forums/

Ordering of Event Execution
http://www.smartquant.com/forums/viewtopic.php?f=60&t=10980
Page 1 of 1

Author:  degloff [ Thu Aug 06, 2015 10:33 am ]
Post subject:  Ordering of Event Execution

Dear Support

I did not find any documentation of the ordering of timer and event execution.

After some investigation I found out that the timer event is executed before a onBar or onQuote event is fired.
This may be not want you want.

Imagine that you want to calibrate parameters based on the market data up to say 4pm every Monday. We can set up a timer event to do this. However, if a quote comes in at exactly 4pm the standard OQ approach would be to process it in an onQuote event and possibly add it to a list of market data, which is then used by the calibration routine.

However, because the onQuote comes after the timer, the timer set at 4pm does not get that quote, which is not what you want.

I can solve this artificially by adding 1 sec to the timer event, so that I get the quote at 4pm. This however does not work anymore with tick data.

I suggest that somewhere one can set the execution order of the events and the timer. Would you please consider to add this feature in a next release as it would resolve the arbitrariness of event scheduling and adds much more transparency.

Thanks, Daniel

Author:  Dr. Anton Fokin [ Thu Aug 06, 2015 12:34 pm ]
Post subject:  Re: Ordering of Event Execution

Hi,

are you talking about OQ 3.x or 2014? I think it's possible to experiment with OQ 2014 framework and add an option to the EventBus but I don't think it's possible to change OQ 3.x framework to address this issue.

Regards,
Anton

Author:  Dr. Anton Fokin [ Thu Aug 06, 2015 1:04 pm ]
Post subject:  Re: Ordering of Event Execution

Also, why can't you add a millisecond or so to timer datetime to get 4 pm quote and then timer event one millisecond later? You say adding one second doesn't work with tick data. Why so? You don't have data events at all after 4 pm?

Regards,
Anton

Author:  degloff [ Thu Aug 06, 2015 3:12 pm ]
Post subject:  Re: Ordering of Event Execution

Hi Anton

I tried to solve this with OQ 3.x. I think it is ok to add 1ms delay.

Good to know that these things should be possible with OQ 2014. Could you be a bit more specific how it works there because I could not find out without documentation purely from the API calls.

Many thanks

Daniel

Author:  Dr. Anton Fokin [ Thu Aug 06, 2015 4:55 pm ]
Post subject:  Re: Ordering of Event Execution

Hi,

we've just added this feature to OQ 2014, it will be available in the next release.

Framework.EventBus.ReminderOrder = ReminderOrder.Before / After;

Regards,
Anton

Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/