I need to load the current symbol with about 10 years of prices leading up to the start date (if available). Currently the only scripting tool I see is LoadFromFile. I use the following code...
CODE:
Please log in to see this code.
This works fine for most securities; however, index symbols are still an issue. Do you know what is typically used for encoding index symbols? Is my test for IsLetterOrDigit appropriate for all symbols?
On a wish list note, it would be nice if GetExternalSymbol allowed for start and end dates to be passed so you could load prices outside of the current test range. I've seen others request a lead bars setting in the past (bars prior to back test start date to allow indicators to be stable on bar == 0). This could be used as a work around.
Size:
Color:
It's easier if you use:
WealthLab.DataStore.FileNameForSymbol(string, WealthLab.BarScale, int)
Size:
Color:
Sounds like a good idea... however, it is undocumented and adding that line of code doesn't compile. I'm assuming my method above could be changed to...
CODE:
Please log in to see this code.
Size:
Color:
More likely something like this as the datastore needs to be specified...
CODE:
Please log in to see this code.
This still gets a compile error as FidelityStaticProvider does not contain a definition for FileNameForSymbol.
Size:
Color:
QUOTE:
I'm assuming my method above could be changed to...
No, because the DataStore class is not static.
Okay, this should work:
CODE:
Please log in to see this code.
Size:
Color:
Actually your first line in the code example above looks like it needs to be...
CODE:
Please log in to see this code.
The 'Data' node needs to be included as I got a file exception without it when I called LoadFromFile.
Thanks for the code! This should work great.
Size:
Color:
You're welcome. That's right, it should be prefaced with "Data\", I'm editing my post, thanks.
Size:
Color:
In case somebody stumbles onto this thread, a solution for Lead Bars has long been found:
FAQ | Strategies and WealthScript >
How to start Buy&Hold from specific bar (not at bar #0)?
Size:
Color: