Will trade be submitted at the next 1-minute cycle or immediately?
Author: ronc
Creation Date: 4/23/2020 12:58 AM
profile picture

ronc

#1
I am running a strategy on 1-minute bars under Strategy Monitor. I want the strategy, at each bar, to:
1. Get the current/latest bar.
2. Determine trade (e.g. close, open long, etc.).
3. Immediately submit that trade.

WLP User Guide, p. 32, says:
QUOTE:
Strategies are executed only when a new complete bar interval is received. Alerts and indicator calculations are based on the last complete bar interval only.


Does this mean that my step 3 (trade) will be submitted immediately (when the strategy generates the alert), or will there be a 1-minute delay and the trade will be submiited at the next 1-minute cycle, i.e. the next time the Strategy Monitor "wakes up"? (A lot can happen in that 1 minute...)

Thanks.
profile picture

Cone

#2
QUOTE:
the trade will be submiited at the next 1-minute cycle,
Of course not. Here's what happens:

1. Bar is added at the end of interval
2. Strategy is Executed
3. Alerts (if any) are generated
4. If you Auto-Place alerts, orders are placed

Ideally, all that happens in several milliseconds - and for sure does it in milliseconds in a Streaming chart. For the least delay, use streaming charts. (And, if you use many streaming charts, make sure to create a trading workspace with strategy windows that have minimal visualizers loaded - you probably only need the Trade visualizer.)

Now, streaming charts become impractical when you need to monitor more than, say, 15 or 20 symbols. That's where the Strategy Monitor can be useful. The difference from a streaming chart, timing-wise, is that there is a delay for the bar to be created at the server and sent to Wealth-Lab. And, more symbols, more delay. Unfortunately, this delay is probably no less than 5 seconds for 1-minute charts, and, it could be as much or more than 30 seconds to process 100 symbols. Frankly, this performance is disappointing to the point of making it impractical for 1 or 2-minute intervals. However, this may change soon with the introduction of a new Fidelity streaming provider. (Assuming you're Fidelity WL Pro customer.)

Another disadvantage not to overlook to using the S. Monitor for many symbols: You must have your DataSet updated and the S. Monitor running before the market opens. If you miss the open, it's the S. Monitor can't "catch up" and will overrun the timeline while performing the static data update initialization.

Finally, when using the S. Monitor make sure your local clock is synchronized to market time.

profile picture

ronc

#3
Thanks Cone. 2 follow-up questions:

1. To clarify about updating the DataSet before the market opens, must that be a manual process or can it be automatic? If I have a strategy (using 1-minute bars) that I want to run every day, do I need to manually update the Dataset after each trading day to avoid the update delay at the beginning of the next day? If possible I would like to automate everything.

2. My test strategy just downloads the latest 1-minute bars for 5 symbols in a dataset and writes those latest bar values to a text file. When I run this under the Strategy Monitor during trading hours (after doing a manual update via Data Manager) it takes almost a full minute for it to execute. In the Action column in Strategy Monitor I observe that the update for each individual symbol takes roughly on the order of 10 seconds. This is not due to a network connection problem; my Internet speed is 228 Mbps down / 11 Mbps up. I am wondering whether this could be due to the Strategy Activation Settings / Data Range. Since I am only using the most recent bar, should "Data Range" be set to 1 bar, or is that settling irrelevant since the data was previously update via Data Manager?

Thanks!
profile picture

Eugene

#4
Answered by the Wealth-Lab User Guide > Data > Data Manager > Update Data > Automated Data Updates.
profile picture

Cone

#5
1. As Eugene suggested, set up Automated Data Updates for the Fidelity provider. I recommend that Fidelity updates be performed after 5am the next morning to get all the previous day's corrections - especially for Daily data. If you're not concerned about Daily data, you can safely update your intraday DataSet immediately after the market closes.

Note:
Wealth-Lab has to be running for the Auto-Update to function, but I also highly recommend the you restart WLPro each day before the market session opens.

2.
QUOTE:
it takes almost a full minute for it to execute.
The 5 updates should certainly all occur within 10 seconds of the end of interval. Could it be that you're loading and processing "All Data". 1-min data files are HUGE and you should never load All intraday data for real-time operations. In the Activation Settings (or in a chart) only load the data that you require for indicators and active positions to be processed.
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).