[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 rhyminkevin, Today, 04:58 PM
|
3 responses
51 views
0 likes
|
Last Post
by Anfedport
Today, 05:24 PM
|
||
Started by iceman2018, Today, 05:07 PM
|
0 responses
5 views
0 likes
|
Last Post
by iceman2018
Today, 05:07 PM
|
||
Started by lightsun47, Today, 03:51 PM
|
0 responses
7 views
0 likes
|
Last Post
by lightsun47
Today, 03:51 PM
|
||
Started by 00nevest, Today, 02:27 PM
|
1 response
14 views
0 likes
|
Last Post
by 00nevest
Today, 03:48 PM
|
||
Started by futtrader, 04-21-2024, 01:50 AM
|
4 responses
50 views
0 likes
|
Last Post
by futtrader
Today, 03:01 PM
|
Comment