Strategy execution time lag from real time
Author: krewtrades
Creation Date: 1/17/2013 4:35 PM
profile picture

krewtrades

#1
I have a problem.

I have 200 stocks, 3 strategy and 1-min streaming data from IQfeed. I try to make online stocks scanner for special graphics patterns.

If strategy scan 200 stocks at once, execution time exceed 1 min and strategy have a lag with real time. I separate 200 stocks to 10 sets with 20 stocks in each. In result I have 30 strategy executions. Usually strategies finished at time, but some strategies can’t update by time (some can’t execute by time) and Next Run time lag from real time for 2, then 3, then 10 minutes.

How can I resolve this problem?

How I can set Next Runt time = actual time = 1 min?

Thanks!

P.S. Internet connection, CPU and RAM use less than 50%

Sorry for bad English.
profile picture

krewtrades

#2
Next Runt time = actual time + 1 min
profile picture

Eugene

#3
Sounds like your Strategy takes too much time to run with regard to selected bar scale? In other words, its execution time may get to or even exceed 1 minute? If this is the case, we'd like to suggest that you examine its code for bottlenecks and optimize it using all means available (logic optimization, performance profiling etc)

Wealth-Lab strategy performance profiling
http://www.wealth-lab.com/Forum/Posts/Wealth-Lab-strategy-performance-profiling-29988
profile picture

Cone

#4
When trading live, make sure to minimize resources:

1. Only load the data that you need. Make sure you're not loading months of data when you need only 2 weeks, for example.

2. Strategy execution is usually very fast (milliseconds) but all the post processing of trades in Performance visualizers can add 'seconds' to each execution. Create a Workspace of Strategy Windows with the minimum amount of Visualizers. When trading, you probably need only a Trades view for reference.
profile picture

Eugene

#5
Robert, I think that krewtrades runs his Strategies in the SM, hence 'Next Run time'. If this is the case, performance visualizers are not a factor as they're not processed by the SM.
profile picture

krewtrades

#6
Yes, I run it all at strategy monitor on streaming data. I load only 2000 bars of history. There is no way to set next run time for strategy?
profile picture

krewtrades

#7
Or can I set that strategy runs one time in two minutes (using 1-min scale)?
profile picture

Cone

#8
Intraday strategies execute whenever a new bar arrives. If you want to run every 2 minutes, then change the Activation Settings to use a 2-minute bar interval.

You do not want to "skip bars" to run the strategy every other bar on a 1-min scale. You would miss alerts and would quickly cause your system to get out of sync with reality.
profile picture

krewtrades

#9
Can I manually set strategy next run time in code? (next run = actual time + 1 min)
profile picture

Eugene

#10
No.
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).