Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Porting 6.5 indicator to 7.0 -- problem/question

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

    Porting 6.5 indicator to 7.0 -- problem/question

    I am attempting to port a 6.5 indicator to 7.0. I exported the 6.5 source and imported it into 7.0. It compiles under 7.0. When I open the Indicators dialog, I get the following message in the Output window -- and this is BEFORE the indicator is applied:

    Failed to call method 'Initialize' for indicator 'MyIndicator': 'BarsinProgress property can't be accessed from within 'Initialize' method.

    However, I don't see the BarsinProgress property accessed in the MyIndicator Initialize code.

    MyIndicator worked fine under 6.5. I reviewed the 6.5 to 7.0 migration notes, but can't seem to find the problem.

    Thanks for any help with this!

    --Mike

    #2
    Originally posted by MikeGutmann View Post
    I am attempting to port a 6.5 indicator to 7.0. I exported the 6.5 source and imported it into 7.0. It compiles under 7.0. When I open the Indicators dialog, I get the following message in the Output window -- and this is BEFORE the indicator is applied:

    Failed to call method 'Initialize' for indicator 'MyIndicator': 'BarsinProgress property can't be accessed from within 'Initialize' method.

    However, I don't see the BarsinProgress property accessed in the MyIndicator Initialize code.

    MyIndicator worked fine under 6.5. I reviewed the 6.5 to 7.0 migration notes, but can't seem to find the problem.

    Thanks for any help with this!

    --Mike
    Would you care to post your Initialize() code?

    Comment


      #3
      Here is the code. It appears one can no longer reference Bars in the Initialize method??

      CalculateOnBarClose = false;

      // Attach a market depth event handler (if connected providers does not support depth, you
      // will not get any events)
      if (Bars != null && Bars.MarketData != null)
      {
      marketDepth = Bars.MarketData.Connection.MarketDepthStreams[Bars.Instrument];
      if (marketDepth != null)
      marketDepth.MarketDepthItem += new MarketDepthItemEventHandler(OnMarketDepth);
      }

      Comment


        #4
        Originally posted by MikeGutmann View Post
        Here is the code. It appears one can no longer reference Bars in the Initialize method??

        CalculateOnBarClose = false;

        // Attach a market depth event handler (if connected providers does not support depth, you
        // will not get any events)
        if (Bars != null && Bars.MarketData != null)
        {
        marketDepth = Bars.MarketData.Connection.MarketDepthStreams[Bars.Instrument];
        if (marketDepth != null)
        marketDepth.MarketDepthItem += new MarketDepthItemEventHandler(OnMarketDepth);
        }
        That is pretty much it. No references to Bars allowed in Initialize().

        ref: http://www.ninjatrader.com/support/h...?barsarray.htm

        Comment


          #5
          Mr. Koganam,

          With your help I was able to get my code working.

          Thank you!

          --MikeG

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          88 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          48 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          31 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          34 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          68 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X