[NinjaScriptProperty] [TypeConverter(typeof(StrategyStringConverter))] // Converts the found ATM template file names to string values [PropertyEditor("NinjaTrader.Gui.Tools.StringStandardValuesEditorKey")] // Create the combo box on the property grid [Display(ResourceType = typeof(Custom.Resource), Name = "Add Signal", GroupName = "Entries 1", Order = 0)] public string Signal1 { get; set; }​
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Make string Ninjascript Property Optimizable
Collapse
X
-
Make string Ninjascript Property Optimizable
I have the following code below :
Code:Tags: None
-
Hello JakeOfSpades,
Thank you for your inquiry.
Are you using an enum to create a list of selectable strings in the Optimizer?
Please see the sample script linked below, which demonstrates using TypeConverter and using an enum. These values are selectable in the Optimizer.
https://ninjatrader.com/support/help...r_to_custo.htm
If you have any other questions, please let me know.
Gaby V.NinjaTrader Customer Service
-
Originally posted by NinjaTrader_Gaby View PostHello JakeOfSpades,
Thank you for your inquiry.
Are you using an enum to create a list of selectable strings in the Optimizer?
Please see the sample script linked below, which demonstrates using TypeConverter and using an enum. These values are selectable in the Optimizer.
https://ninjatrader.com/support/help...r_to_custo.htm
If you have any other questions, please let me know.
Comment
-
Hello,
Unfortunately no, there is no way to optimize a list of strings.
A custom type converter is needed, which will not function in the strategy analyzer.
A TypeConverter used on an input in a NinjaScript Strategy will be disabled when the strategy is selected in the Strategy Analyzer.
While the strategy can still be backtested or optimized, the TypeConverter behavior, such as hiding or disabling inputs will not have effect on any public variables using the [NinjaScriptProperty] attribute.
This is due a limitation with the property grid and how the analyzer displays the [NinjaScriptProperty] marked properties of the strategy.
A suggested work around, is to add an extra bool property for the purpose of controlling if other properties are used within the logic of the script.
This property would not be optimized and would have the single purpose of controlling the use of the properties.Gaby V.NinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Gaby View PostHello,
Unfortunately no, there is no way to optimize a list of strings.
A custom type converter is needed, which will not function in the strategy analyzer.
A TypeConverter used on an input in a NinjaScript Strategy will be disabled when the strategy is selected in the Strategy Analyzer.
While the strategy can still be backtested or optimized, the TypeConverter behavior, such as hiding or disabling inputs will not have effect on any public variables using the [NinjaScriptProperty] attribute.
This is due a limitation with the property grid and how the analyzer displays the [NinjaScriptProperty] marked properties of the strategy.
A suggested work around, is to add an extra bool property for the purpose of controlling if other properties are used within the logic of the script.
This property would not be optimized and would have the single purpose of controlling the use of the properties.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Jonafare, 12-06-2012, 03:48 PM
|
5 responses
3,985 views
0 likes
|
Last Post
by rene69851
Today, 01:44 PM
|
||
Started by Fitspressorest, Today, 01:38 PM
|
0 responses
2 views
0 likes
|
Last Post Today, 01:38 PM | ||
Started by Jonker, Today, 01:19 PM
|
0 responses
2 views
0 likes
|
Last Post
by Jonker
Today, 01:19 PM
|
||
Started by futtrader, Today, 01:16 PM
|
0 responses
7 views
0 likes
|
Last Post
by futtrader
Today, 01:16 PM
|
||
Net Change
by Segwin
Started by Segwin, 05-07-2018, 02:15 PM
|
14 responses
1,792 views
0 likes
|
Last Post
by aligator
Today, 11:47 AM
|
Comment