Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Different parameters for different instruments in a backtest on a list

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

    #16
    adamus,

    SetParam() would be your own custom events. Unfortunately I would not know how you have programmed such and the relationship you have for them. What you can try is just adding Print() statements within each method and see the sequence of printouts to know what is happening in what order.
    Josh P.NinjaTrader Customer Service

    Comment


      #17
      Originally posted by adamus View Post
      I would like to know which way round it happens. Is it the SetParamX() first and then Initialize(), or vice-versa?
      SetParamX() is the property method pairing for my parameter, paramX.

      Code:
      public double ParamX
      {
      get { return paramX; }
      set { paramX = Math.Max(0.1, value); }
      }
      I have in the meantime figured out which way around the properties and the Initialize() methods are called.

      The properties methods are called last, so if I can't set the params in Initialize since the properties methods will overwrite them.

      Is there another event that is called *after* the properties are set but before the historical data is processed for each run?

      Comment


        #18
        adamus,

        You can try using the OnStartUp() method.
        Josh P.NinjaTrader Customer Service

        Comment


          #19
          Thanks Josh, that does the business.

          Comment

          Latest Posts

          Collapse

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