Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Programmatic access to Parameters list

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

    Programmatic access to Parameters list

    Hi Folks, I've been trying to figure this out for several days and haven't had any luck.

    I'm trying to get a list of my Parameters at run time (use on first bar routine in OnBarUpdate) so I can store the values in a data base. I want to do this so I can reuse the same technique with multiple strategies and keep a generic database of the parameters and let NT generate the appropriate SQL on the fly instead of having to rewrite it myself every time a change a parameter.

    Clearly NT does this since we can give the Parameters values in Backtest, Optimize and Walkforward.

    I've tried various things around the Category attribute. Any ideas?

    Thanks!
    daqu40
    NinjaTrader Ecosystem Vendor - QTradez

    #2
    You could try something like this.

    Code:
     
    IndicatorBase[] ib = ChartControl.Indicators;
    foreach (var item in ib)
    {
        Print(item.ToString());
    }
    That will print each indicator on the chart to the output screen in this form:
    EMA(Typical of TF 06-11 (4 Range),34)
    MACD(TF 06-11 (4 Range),12,26,9)

    You would have to add the code you need in the foreach loop to store item.ToString() where you want it.

    BTW, putting it in OnStartUp() would be a better place than a routine in OnBarUpdate().

    Hope this helps.

    VT

    Comment


      #3
      Thanks VT,

      This got me on the right track.

      What I needed was:

      foreach(Parameter p in Parameters)
      {
      Print(p.Name);
      }

      Seems I got sidetracked by Attributes.

      Thanks also for the OnStartUp() tip. Turns out this is the event I really needed.
      daqu40
      NinjaTrader Ecosystem Vendor - QTradez

      Comment

      Latest Posts

      Collapse

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