Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get user value for calculations in OnStateChange() (State == State.SetDefaults)

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

    Get user value for calculations in OnStateChange() (State == State.SetDefaults)

    Scenario:

    I want to pass user defined data into an indicator so the data is available at OnStateChange. I need it then so I can add "X" number of user defined plots. I don't think I can add plots other than in OnStateChange which is prior to receiving parameter values.

    Question:
    The only way i can think of to get a value is to read the data is from an external file. I think I have to to go around normal Ninja logic.

    Can you the experts tell me if there Is there a better or other way to get pre- OnStateChange data?

    Right now I add a lot of plots but would like to be more resource friendly and just add what they want. I can add an extra parameter but I won't get the value until it is too late and after OnStateChange

    Cheers

    #2
    One reason it isn't architected to have a varying number of plots in State == State.SetDefaults is that the plot properties are saved in the workspace by their index number, so if you take some in or out all of your saved properties would be shifted or inappropriate.
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Hello, thanks for writing in. AddPlot can be called from State.Configure to add plots dynamicaly, but you would not get any configuration options in the property window. Unfortunately, it's not possible to get user input from the SetDefaults state.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      633 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      364 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      567 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      568 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X