Having searched the forum and Wiki I am having trouble finding an answer to the following.
With an external symbol in a strategy how do I assure that both the external and tested symbol have adequate data for my Strategy Data Range? I recall a line of code that does this as a condition to buy but can't find it.
Also is there a simple Strategy that will "Print Debug" a data-set run, and show the symbol and first data date, and or the quantity of data periods by symbol?
Thanks for any help!
Size:
Color:
This is accomplished with the Bars.
FirstActualBar property.
P.S. Also, to always load the data despite a big lookback your system may have you might want to use
GetAllDataForSymbol from Community Components. It shouldn't be an issue to find many examples and discussions on the forum.
Size:
Color:
Eugene, thanks for the reply. I had looked at that, but was trying to do the following;
Also is there a simple Strategy that will "Print Debug" a data-set run, and show the symbol and first data date, and or the quantity of data periods by symbol?
Looking on the forum I was unable to find an answer?
Size:
Color:
Have you seen the QuickRef example code for FirstActualBar ?
Size:
Color:
Eugene, yes.
I am not able to get from this code to;
Also is there a simple "stand-alone" Strategy that will "Print Debug" a data-set run, and show the symbol and first data date, and or the quantity of data periods by symbol?
Size:
Color:
Copy that. I'm not the brightest mind here but 3 iterations of that seem to be enough. ;)
This code shows the symbol and the first actual bar (which changes depends on the number of bars loaded). And it's designed exactly to make sure that the external symbol has adequate data - as states your topic title.
If you wish to output the first date and/or quantity of bars loaded, I'm sure this will be a trivial excercise for you when you review other properties of the Bars object and related entries. This is WealthScript 101 that shouldn't present any difficulty and it's all covered with examples in the QuickRef. Good luck.
Size:
Color:
QUOTE:
is there a simple "stand-alone" Strategy that will "Print Debug" a data-set run,
Run this on any one symbol in the DataSet. It will sort by first or last date as specified in the parameter.
CODE:
Please log in to see this code.
Size:
Color: