Login Page - Create Account

Support Board


Date/Time: Wed, 01 May 2024 19:12:39 +0000



Post From: Automated Strategy/Study - Processing Each Tick Considerations

[2018-06-13 21:40:18]
User281933 - Posts: 4
I am trying to design an automated strategy so that it will not start to lag in busy markets (when the ticks are coming in very fast). I am trying to understand/map out the logical sequence of events (and related considerations/limitations) that happen in Sierra to a strategy during a busy market (e.g. ES at news time). I have looked into the documentation, but I still can’t get it straight in my head how best to design the strategy to cope with fast moving markets.

I would be grateful if anyone can contribute to my understanding of the best methods to mitigate lag in the strategy. If the information is available in the documentation, or has been addressed previously, then I apologise, but would appreciate a pointer to the appropriate location.

Requirements, Assumptions and Context
Assume that the Strategy must be executed on each tick (e.g. it’s a short term strategy).

Assume that there are a few indicators that need to be updated and also some calculations to do on level II data.

Assume that there is no lag in the datafeed, other than the natural lag/jitter from the Exchange to the computer location through the internet (due to distance considerations).

Assume that the computer has suffient CPU cores, memory and disk spped for the majority of calculations - we are concentrating on what happens when the market gets busy and the ticks are starting to come in too fast to allow the relevant calculations to be carried out for each tick.

Conceptually, each time a new tick comes in and the strategy performs a typical number of calculations. A simple assumption is that each of these strategy loops takes a certain (average) amount of time to perform. That means that there is a certain amount of ticks that can be calculated each second, and if the ticks start to come in faster that that, then something has to give - which one of the scenarios below happens, or does something else happen?

Scenario 1: The application diligently calls the strategy for each tick that comes in, and the strategy diligently performs the same (average) set of calculations, so the strategy starts to lag. Any orders submitted by the strategy while in a state of lag will likely not be applicable.

Scenario 2: The application diligently calls the strategy for each tick that comes in, but the strategy is designed for this, and performs some sort of quick test on each tick to check how long it’s been since the last tick (or something similar) - if it’s it too short a time, then the strategy performs a subset of calculations - thus (hopefully) not falling behind.

Scenario 3: The application knows if the strategy is falling behind and skips data, or signals somewhere (where the strategy can check) that there is a processing lag.

I not looking for code or anything, just the logical progression or options available so I can design appropriately

Regards,

Kieran