Could you please give example on how to edit body of code to include parameters for optimization.
EDITED by Eugene: included example code from ticket 26776:
CODE:
Please log in to see this code.
Size:
Color:
In the WealthScript Programming Guide (Help menu), there is a tutorial on making a strategy optimizable:
Programming Trading Strategies >
Strategy ParametersPlease follow it and you'll quickly learn. We refer to it frequently on the forum (
#1,
#2,
#3,
#4 ...)
As to your sample code that I derived from a ticket, it's not clear what the
strategyParameter1 should refer to i.e. what part of the system do you intend to optimize using it: StochK, SMA, anything else?
Size:
Color:
For Example - Optimize SMA - Please show code
Size:
Color:
Please consider reading the tutorial to the end and you will find it out. It's very simple. Our support aims to teach you how to fish. See below how
you can generate this code on your own:
Also as we recommend to do in the
FAQ, using the Rule Wizard (Strategy from Rules) is the easiest way to get a basic trading system working w/o any programming. Learn how to expose parameters in rule-based strategies by creating an SMA system (see Wealth-Lab User Guide > Strategy Window > Strategy Builder >
Parameter Sliders for the Strategy Builder) and then simply convert it into code-based Strategy (or "Open code in new "Strategy window") to see how things fit together.
Size:
Color:
OK - I looked at the docs you suggested. I am not a programmer so still have questions. Please see attached pdf file. I think my question is what should code line 23 look like ??
Size:
Color:
Could you please post the code normally (ideally using the CODE but I can fix it) without resorting to attachments? Use Ctrl-Ins or Ctrl-C to copy, Shift-Ins or Ctrl-V to paste. Thanks.
Size:
Color:
CODE:
Please log in to see this code.
Size:
Color:
"mapram" is just a string;
strategyParameter1 is the variable:
CODE:
Please log in to see this code.
Let me stress that converting a system to code is the easiest way to understand how strategy parameters work under the hood.
Size:
Color:
Thank you very much for your help as I am very new at this. - All OK now !!
Size:
Color: