self starting a WL strategy before market hours
Author: haytac
Creation Date: 9/6/2012 5:41 PM
profile picture

haytac

#1
Hi,

The user guide says the following about streaming mode:

"Wealth-Lab automatically executes the Strategy when the Streaming data provider adds a new complete bar to the chart (at the end of the selected interval). Fidelity Streaming data is available in Wealth-Lab Pro during market hours only."

Is there a way to self-start a strategy at least once before market hours? For example a timer interrupt?

Thanks!
profile picture

Cone

#2
Self-start? Like loading a Workspace of streaming windows?
profile picture

haytac

#3
It has to happen only once before the market opens. The Wealth Lab application is open 24/7 but the startegy is not yet running. It is like an ability to tell WL that it should run this strategy once before the market opens, say at 6am, and then when the market opens have the streaming begin once per minute.

A related question is for just streaming only. Does one have to start streaming manually by clicking the button on the lower right hand side or is there an automated way to do the same thing? I guess this one fits the way you described it: loading a Workspace of streaming windows.
profile picture

haytac

#4
In a related question: can one have a strategy whose sole purpose is to start another strategy at a given time and then at regular intervals of time? This is probably how the streaming button works but I am not sure if this hook is available to users?
profile picture

Eugene

#5
You can create an addon (living in its own GUI control) and place it under the Tools menu. In its code, it is possible by using Reflection to obtain the list of open MDI children, find only Strategy windows among them, and make a selected Strategy window execute on time.
profile picture

haytac

#6
Thanks! Where can I find detailed information on these topics?
profile picture

Eugene

#7
Nowhere - it's undocumented. I'm just throwing out an idea. Inserting custom items under Wealth-Lab's Tools menu is pretty trivial (this KB article opens up after logging in to the Wiki with a MS123-verified account). As for the more complicated stuff, I'm afraid there's no ready-made example on using System.Reflection to solve related tasks (except what's working in our private solutions).

However, there might be a simpler way. Write an AutoIT script for finding your Strategy window and sending an F5 key to it at 6am. The rest is covered by leaving the Streaming window running 24/7, I assume.
profile picture

haytac

#8
It seems to me that the only input to a strategy is the Bars object. At least it seems this is the only thing I am using in my 1 minute strategy. One way of settling this issue I have is to have a strategy to continuously run and retrieve the Bars object once a minute. Or instigate the retrieval of this object. Or, be notified when the object is refreshed again. Once this notification is there one can re-run the loops in the strategy.
profile picture

Eugene

#9
Why start a strategy before market hours?
profile picture

haytac

#10
Our messages criss-crossed. Thanks. Running Streaming 24/7 would work for me. I could loop during off hours using a DateTime object, when 6AM hits do some house chores, and then release to the part of the strrategy that uses the Bars object as it comes each minute. Still intersted in knowing the answers to the questions posed in the criss crossed message.
profile picture

haytac

#11
Does one need to restart a strategy for it to access the latest Bars object? I would think so because otherwise the Bars object might change during execution of the strategy. Or, if there was a command like "refresh the Bars object and provide its IntraDay bar number". The strrategy could loop on this call returning normally.
profile picture

haytac

#12
Sorry about the multiple copies of the same thing. Really appreciate you being there over the years.
I do not need to start before market hours. The interest is in automating the strategy. From what I learned here I can do the following:
the last run of the day (minute 389) gets the strategy into an infinite loop. This last run runs overnight. It releases at 9:30AM. At 9:31 the strategy is run again because the streaming button was pressed all along. So, all runs take less than a minute except for the last run of the day which runs overnight.
profile picture

haytac

#13
Regarding the suggestion "Inserting custom items under Wealth-Lab's Tools menu" I received the following message:
You must be a verified Wealth-Lab Developer/Pro 6 customer to view this page. Free trial users can not access this content.
How do I sign up for this? I am a Fidelity customer.
profile picture

Eugene

#14
QUOTE:
So, all runs take less than a minute except for the last run of the day which runs overnight.

And what's the problem with this? Why would one care? It's still a total mystery to me what you're talking about.
QUOTE:
How do I sign up for this? I am a Fidelity customer.

Register a new Wiki username (if you don't already have one), then create a support ticket for verification.
profile picture

Cone

#15
QUOTE:
Does one have to start streaming manually by clicking the button on the lower right hand side or is there an automated way to do the same thing?
If you hold the Alt key when clicking the "Stream" button, then it will turn On/Off streaming for all the windows in the Workspace.
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).