What happens when Execute takes longer than the time interval?
Author: kmc234
Creation Date: 11/21/2018 7:49 PM
profile picture

kmc234

#1
Hi,

I would like to know what happens in Wealth Lab Pro when running the Execute method takes longer than the time interval (say 1 minute).

Does it skip the Execute method on the next minute bar, or as many bars as the extra time from the first call needs? Or do Execute method calls start backing up and falling behind?

I want to write a system that does its "thinking" in another thread in the background, and drops off the result for the Execute method to access when the thinking is done. That way, the Execute method only has to do a few simple things like track price and submit orders. Is this possible?

Thanks!
profile picture

Eugene

#2
Hi,

Off the top of my head, you get "Time's up" in Strategy Monitor. If run across multiple streaming Strategy windows or doing a data update, a BarsLockedException. To avoid it you might employ a trick like this.

The main question is: what's your objective? What goal are you trying to reach with this? You're not doing it out of passion for programming, isn't it. ;) Why not optimize the performance of the long-running strategy instead?
profile picture

kmc234

#3
I must admit, I feel frustration working with Wealth Lab Pro. I now have second and tick level data from IQFeed (gotta pay extra $94 / mo), and I SHOULD be able to get my day-trading strategy working.

The strategy is actually not that processor intensive, but it does need to review large groups of data to recognize patterns. It might not run quickly enough to fit inside a 2 second or a 5 second window.

I honestly don't see why WL Pro has to be structured this way. It's just C#, right? Why can we just spawn a thread, give it access to some shared memory, and trigger a callback when it's done?

Once again, one minute is simply too long to wait. I'm NOT doing HFT, but in one minute the price can (and does) change dramatically. It makes a HUGE difference to my strategy, and I would not consider it merely "slippage". It's the difference between lots of profit and taking some losses in many cases.

I wish I could provide the amazing backtesting framework of WealthLab pro (you guys have done a great job!) with the customizability that writing your own app and calling an API gives from solutions like what Interactive Brokers provide. They just give you a web API and you write the program you want. The only reason I don't go with them is because WealthLab backtesting solutions are so robust.

Please help. I just want to do what a normal application would allow, which is to take advantage of multiple processor and spawn a new worker thread.
profile picture

Cone

#4
Each Strategy Monitor item runs on its own thread. Try splitting your large groups of symbols into smaller ones and see if you get better results.
profile picture

Eugene

#5
Right, but Strategy Monitor runs on 1-minute intervals and up. So tick- or second-based data (such as by IQFeed) won't be useful in the SM (as noted in previous discussion).

If your strategy doesn't run quickly enough in a 2 to 5 second window, try switching to the first appropriate higher bar scale.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).