Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Optimization Test
Collapse
X
-
Hello ark321,
Thanks for your post.
You would need to make user-defined inputs instead of variables for the parameters you would like to optimize.
Are you using the [NinjaScriptProperty] Attribute for the parameters you would like to optimize?
The NinjaScriptPrperty Attribute determines if the following declared property should be included in the NinjaScript object's constructor as a parameter.
Something you could consider is using the Strategy Builder to created user-defined inputs on the Inputs and Variables screen. Then, you could click the 'View code' button to see the generated code used to create these user-defined inputs.
See the help guide page below for more information.
NinjaScriptProperty Attribute: https://ninjatrader.com/support/help...yattribute.htm
Creating User-Defined Input Parameters: https://ninjatrader.com/support/help...d_input_pa.htm
Let us know if we may assist further.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
-
Thanks for your reply. This is what I have for Target 1 (in the example screen shot above).
[NinjaScriptProperty]
[Description("")]
[Range(0,Int32.MaxValue)]
[Display(ResourceType = typeof(Custom.Resource), Name = "Profit Target 1", GroupName = "Profit Targets", Order = 6)]
public int ProfitTarget1
{
get;set;
}
Am I missing anything? I still do not see this as optimized parameter
Comment
-
Hello ark321,
Thanks for your note.
I have created a user-defined input for ProfitTarget1 in a test strategy in the Strategy Builder and clicked the 'View code' button to see the generated code. See below.
When this strategy is added to a Strategy Analyzer window, I do see the property available for optimization. See the attached screenshots.Code:[NinjaScriptProperty] [Range(0, int.MaxValue)] [Display(Name="ProfitTarget1", Order=3, GroupName="Parameters")] public int ProfitTarget1 { get; set; }
Please create a user-defined parameter in the Strategy Builder Inputs and Variables screen, click the 'View code' button to see the generated code, and then copy that user-defined input into your strategy and add the strategy to the Strategy Analyzer.
Let us know if we may assist further.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
67 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
142 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
76 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
47 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
51 views
0 likes
|
Last Post
|

Comment