Can I combine index from Yahoo and shares from Wealth-Data?
Author: MrIzzy
Creation Date: 8/28/2020 4:32 PM
profile picture

MrIzzy

#1
I understand that indexes are not supported in Wealth-Data.

But - I can get index values though Yahoo.

Can I combine the index from Yahoo and the individual shares from Wealth-Data?

How would that be done?
profile picture

Eugene

#2
Could you please rephrase? I don't understand what this means: "Can I combine the index from Yahoo and the individual shares from Wealth-Data?"
profile picture

MrIzzy

#3
In my strategy I have a line like this:

CODE:
Please log in to see this code.


That works if Yahoo is the provider as it is their symbol for the S&P500 index..

When I shift it to Wealth-Data (which is great at giving information about individual stocks) it fails.

I am trying to somehow get prices for the S&P500 index into my strategy.



profile picture

Eugene

#4
Got it. There's overloaded call that accepts the DataSet name (Yahoo's in your case), pointing WL at the right symbol. Give this a try:
CODE:
Please log in to see this code.
profile picture

MrIzzy

#5
Thanks, Eugene.

Unfortunately, I got a
Runtime error: Object reference not set to an instance of an object.


profile picture

Eugene

#6
It works just fine.

Double check everything.

p.s. More insight: Errors | Strategy > Object reference not set to an instance of an object
profile picture

MrIzzy

#7
Eugene,

Found the problem. Actually, there are missing symbols from Wealth-Data as specified here:
https://www.wealth-lab.com/Forum/Posts/Missing-symbols-from-Wealth-Data-40379/

Once I remove these symbols from my "universe", everything works fine.

Izzy
profile picture

MrIzzy

#8
More:

I have this code:

CODE:
Please log in to see this code.


The response is:
QUOTE:

Runtime error: Object reference not set to an instance of an object


In short, I don't think I can access any data that's in spxbars.
profile picture

Eugene

#9
Already replied in post #6 above.
profile picture

MrIzzy

#10
Hi there again, this is the complete source code. The only line that gives the error message is the PrintDebug.
Any idea of what's wrong with it?


CODE:
Please log in to see this code.


profile picture

Eugene

#11
Yes, ideas for your troubleshooting are in the Wiki link in post #6.
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).