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!
See more
See less

Partner 728x90

Collapse

Refresh Strategy Analyzer property values after State.SetDefaults

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Refresh Strategy Analyzer property values after State.SetDefaults

    Hi there,

    I was wondering whether is there any way to access and refresh the [NinjaScriptProperty] values exposed to the Strategy Analyzer UI after the State left SetDefaults? I am trying to achieve the next: I created a txt file containing the results of a previous optimization and at State.Configure I read this file and set the values of the exposed properties to values found in the file. This way i dont have to spend a lot of time setting up the Strat Analyzer UI. And this part works just fine. My only problem is that the UI remains setted to the default values even if the values changed during State.Configure.

    Is there any way to solve this and refresh the values printed to the UI? Just like when we select a template.
    Or if the template like approach does not work, would it be possible to use a type converter to refresh the values?
    Also, would you be able to help when and how a type converter is called? Can I trigger it or is it integrated into the system?

    The best would be if it could take place in the Configure state (just before the actual run).

    Thanks a lot, Adam

    #2
    Hello Altemor,

    Welcome to the NinjaTrader forums!

    I understand your meaning and changing parameters from State.Configure in the Strategy Analyzer doesn't reflect in the UI because that is not the actual instance populating the UI the way that the instance on a chart is the instance populating the UI.
    This is because for every backtest and optimization iteration a new cloned instance of the strategy is created.

    Unfortunately, custom typeconverters do not function in the strategy analyzer when optimizing.
    I am aware of the type converter sample, and have used portions of it to hide/show properties. My question is how can this be applied when in the optimizer? For example, if I have a bool property, I want to show other properties if it is set to True or Optimize.



    If you just need to know what the values are, you can print (or write to file) the variable in State.DataLoaded.

    else if (State == State.DataLoaded)
    {
    Print(MyVariableName); // you could also choose to write the values to a text file with a StreamWriter here
    }

    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by llanqui, Today, 03:53 AM
    0 responses
    5 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    10 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    15 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    14 views
    0 likes
    Last Post strategist007  
    Working...
    X