Save data through script in Strategy Monitor
Author: vnarra
Creation Date: 9/7/2020 7:59 PM
profile picture

vnarra

#1
I have the following code below to save data to local folder. I point the strategy to a data set (contains only @esu20 from IQfeed) and run the backtest and the data for the symbols in the data set for the requested duration gets saved.
Now, I try to save data every minute by adding this script to strategy monitor and choose 1m in scale settings and activate the strategy. Strategy runs but data is not saved to file. If I de-activate the strategy, right click and run the strategy by clicking "Run this strategy now", the file is saved. What am I doing wrong when I run the script through strategy monitor that it is not saved?

Any help is appreciated.

CODE:
Please log in to see this code.
profile picture

Eugene

#2
Hi,

Hmm, File I/O shouldn't be disabled in the SM. Will it save the data correctly if you run the same script in a Streaming Strategy window?
profile picture

Cone

#3
First, make sure that you've defined your symbols in the Market Manager. If you don't, the default market session will 0930-1600, so the S. Monitor won't be running right now.

Second, thanks for reminding me that people trade other markets. This week, there'll be a new IQFeed upgrade that feeds "Streaming Bars" to the Strategy Monitor instead of requiring a history request every interval. We need to make sure that the Streaming Bars will be subscribed to the correct market times (i.e., Globex, etc.) per the Market Manager.
profile picture

vnarra

#4
Hello Eugene, Cone,
Follow up on your recommendation for the problem I had.

I'm now using the updated IQFeed plugin.

I'm trying to use the strategy to save the data using the above script. Now I tried using it with a list of 4 symbols (As opposed to @esu20). Data does not still save through SM (strategy monitor) while right click with "run the strategy now" still saves data to local folder. Notice that I was able to use the same script to save data to local folder with wealth lab pro through SM. Seems like this functionality is lost (at least for me) with the upgrade to Wealth lab dev.

I was able to save the data with streaming strategy window.

One additional piece of information is that I could not save symbols with non letter characters in them (such as .spx, .vix etc.) using the SM even in wealth lab pro.

See attached screenshots to show additional settings.


On a separate note, even though I'm subscribed to IQfeed data, I still see data with 15min delay (in streaming chart etc.). What do I need to do to get the live data into WLD?
Thanks for your help!
Venkat
profile picture

Cone

#5
QUOTE:
Seems like this functionality is lost (at least for me) with the upgrade to Wealth lab dev.
No, it's the same code base, really. However, a major problem is trying to work with delayed data. Until you get that fixed, the S. Monitor won't work correctly... unless you delay your local clock by 15 minutes too.

CODE:
Please log in to see this code.
Invalid path maybe?

Since your code didn't check that the path exists, make sure to create a C:\Data folder and try this:
CODE:
Please log in to see this code.


And I'm looking at what you're doing now and wondering why you'd want to save the OHLC/V of all the bars every time the S. Monitor adds a new bar. Aren't you just interested in the one new bar being added when it runs?

Re: WLD2.jpg
Totally unnecessary to add U.S. stock symbols here. Click the option in the first page to "Use this Market by default..."

Finally, on the IQFeed delay, contact IQFeed and see why they're serving you delayed data! It might be that you don't have some agreement signed or something. Let us know what it is when you find out!
profile picture

Cone

#6
@vnarra:
Here's something for you to get live data going... see Rich's post #10 here: /Forum/Posts/Cannot-get-IQFeed-historical-data-40265
profile picture

vnarra

#7
Thank you for the your help! Once I got real time data, it worked out as expected.
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).