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 Mindset, 04-21-2026, 06:46 AM
          0 responses
          118 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          166 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          85 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          130 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          88 views
          0 likes
          Last Post PaulMohn  
          Working...
          X