Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

failed to call method 'initialize' for indicator

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

    failed to call method 'initialize' for indicator

    I get this message in the log, I am not running this indicator, it appears when i start one of my own, I did however take some code from it, but only from a section of code that was relevant

    failed to call method 'initialize' for indicator 'DOM_Bands': Object reference not set to an instance of the object.

    How can i track down this error and remove it?

    #2
    Hi tinkerz,

    Thank you for your post.

    It sounds like the new indicator is referencing the DOM_Bands.

    Can you reply with the code under Initialize() in the DOM_Bands?
    TimNinjaTrader Customer Service

    Comment


      #3
      Code:
              protected override void Initialize()
              {
                  
                  Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Bar, "BidAmp"));
                  Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Bar, "SellAmp"));
                  Add(new Plot(Color.FromKnownColor(KnownColor.DarkViolet), PlotStyle.Bar, "AskAmp"));
                  Add(new Plot(Color.FromKnownColor(KnownColor.Firebrick), PlotStyle.Bar, "BuyAmp"));
                  CalculateOnBarClose    = false;
                  Overlay                = false;
                  PriceTypeSupported    = false;
      //The input time-series Excel range. Length must be a power of 2 (for example 16, 32, 64, 128 etc…).            
                  BuyStack = new Queue(128);
                  BuyTime = new Queue(128);
                  BuyArray = new double[128];
                   BuyTimeArray= new double[128];
                  
                  AskStack = new Queue(128);
                  AskTime = new Queue(128);
                  AskArray = new double[128];
                   AskTimeArray= new double[128];
                  
                  BidStack = new Queue(128);    
                  BidTime = new Queue(128);
                  BidArray = new double[128];
                   BidTimeArray= new double[128];            
                  
                  SellStack = new Queue(128);
          
                  
                  timestart = (DateTime.Now.AddMilliseconds(100).TimeOfDay.TotalSeconds);
                  
                  _hp = new double[129];
                  _smoothHp = new double[128];
                  DrawOnPricePanel = false;
              }

      Comment


        #4
        Hi tinkerz,

        Likely, some of the assignments in the initialize need to be moved to the OnBarUpdate() section of the code, specifically, any that result in an empty object.

        You can have them called on the first bar with

        if (CurrentBar == 0)
        {
        replace here
        }

        If you don't use the indicator, you may be able to simply delete it or comment out the problematic sections.
        TimNinjaTrader Customer Service

        Comment


          #5
          OK Its the DOM_bands that is problem, that initialize section was from my indicator i copied functions too, ok i will look at dom bands

          Comment

          Latest Posts

          Collapse

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