Is there a way to have the backtester use data prior to the start date to set the values of indicators used in a given strategy? For example, if one of the indicators in a strategy is a 250 day moving average, the strategy test wont start for a year (250 days), even though prior data exists to set the value of the moving average at the start date. Currently, this lag in the start of a strategy distorts the performance data and the relative performance to buy & hold.
Size:
Color:
Size:
Color:
I figured I wasn't the only one to have this issue. Thanks for your continued support. I'm still a newbie and likely to continue to ask stupid questions.
Size:
Color:
OK next stupid question....Can I use a combination of drag & drop rules and code based rules in the same strategy? I assume I'll have to drop the "GetAllDataForSymbol" code into the Strategy code view, but not exactly sure how to do it and how it will impact my drag & drop rules. I'm hoping I can apply GetAllDataForSymbol globally to all indicators.
Size:
Color:
It's good to be inquisitive, neither one of those questions is stupid. While one cannot combine Rules with code, it's possible to either "Convert to code" or "Open in new strategy window" where you'd install the GetAllDataForSymbol code. Once done there's no way back to Rules. Also it's impossible to apply GetAllDataForSymbol globally.
Size:
Color:
Thank Eugene. So are the steps as follows?
1. Create primary strategy in rules
2. Convert rules to code
3. Insert the GetAllDataForSymlol code prior to each indicator
Assuming that is true, which rows from the GetAllDataForSymlol code do I insert? Can you show an example?
Size:
Color:
Ralph, your understanding is correct. Here's an illustration of
GetAllDataForSymbol (scroll down to "Example"). As always, you can find examples for additional methods in the
Wealth-Lab Wiki while built-in functions are documented in the QuickRef (F11 key) and WealthScript Programming Guide.
Size:
Color:
Where am I going wrong with this? I'm getting the attached error:
CODE:
Please log in to see this code.
Size:
Color:
Size:
Color:
Thanks........it compiled successfully, but still doesn't appear to be working. Do i need to copy the code to precede each of the MA and Plot instructions as well?
Size:
Color:
Yes, you have to apply
GetAllDataForSymbol to each DataSeries that your script has created. Here's your script tweaked.
You'll notice how I've edited it to combine duplicating instructions created by the Rule Wizard (maFast_1 etc) and shared the DataSeries with the plot instructions to avoid having superfluous calls to
GetAllDataForSymbol.
CODE:
Please log in to see this code.
Size:
Color:
Thanks Eugene. That worked, but what did you do differently aside from cleaning up the code generated by the rule wizard? I noticed you removed the reference to "Dow 30" in the row below. Anything else?
CODE:
Please log in to see this code.
Size:
Color:
There's nothing wrong with the "Dow 30" reference but it could generate an error if you don't have that DataSet. This is just an example. Feel free to tailor it to your taste.
Size:
Color:
Then I'm not sure why your code worked and mine did not.
Size:
Color:
It didn't work because you didn't apply
GetAllDataForSymbol to any DataSeries. Just compare it line by line:
CODE:
Please log in to see this code.
CODE:
Please log in to see this code.
Size:
Color:
Now i see it. "b."
Thanks.
Size:
Color: