The Strategy builder explicitly asks for the name, the type, the default value, the minimum value.
but in the NinjaScript section where those user inputs are declared, it's just a simple line that says:
VariableName = 4; (where 4 is the default value in strategy Builder, and the type integer was chosen)
I opened my strategy in NinjaScript editor, edited it extensively, - it compiles. I like it and want to add user input criteria to the strategy.
I can't open it in Strategy Builder anymore.
How do I add user input variables to the script.?
I tried inserting the variable name and default value in the section at the top of the script where the other input variables are defined,
giving it a name, and assigning an integer as a default value followed by a semicolon on an inserted line.
using the same format as other user input integers declared in this section, ex:
========trimmed content==========
BarsRequiredToTrade = 20;
// Disable this property for performance gains in Strategy Analyzer optimizations
// See the Help Guide for additional information
IsInstantiatedOnEachOptimizationIteration = true;
NewsAt730 = false; <----created in strategy builder
NewsAt845 = false; <----created in strategy builder
Variable8CreatedinStrategyBuilder = 4; <----created in strategy builder
MyNewInsertedVariableHere = 2; <-----new variable line was inserted here.
Variable9CreatedinStrategyBuilder = 6; <----created in strategy builder
}
else if (State == State.Configure)
{
========trimmed content==========
When I try to compile the editor says the name "MyNewInsertedVariableHere" does not exist in this context.
I can see that I somehow added other user input variables to this section of the script (or at least changed their names or positions), and they compile and appear as options on the screen where I enable the strategy on a chart.
I tried using a new strategy builder to create a user input variable, opened its script and copied that line into my script. - Same error.
Have I forgotten a step?
What is the standard protocol for declaring a new user input variable in the Ninjascript editor?
Thanks.

Comment