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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
45 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
21 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
31 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
50 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment