Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problems with instantiated indicators

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

    Problems with instantiated indicators

    In NT7 I've got a problem with indicators which didn't exist in NT6.5

    Currently I'm migrating a prospective NT-3rdParty tool.

    For some reasons (performance, extended API,...) I'm using some indicators like a class to instantiate the indicator as an object:

    TEClimacticDistance climacticDistance = new TEClimacticDistance ();

    the neccessary data is provided by the caller (Strategy, MarketAnalyzerColumn) and the OnBarUpdate is also simulated by the caller.

    in the Indicator some other Indicators are being called - this was no Problem in NT6.5

    But now I'm getting a NullReferenceException - "use the new keyword to create an object instance"... at the red marked line in the code where the SMA is gonna be called.


    protected override void OnBarUpdate()
    {

    PerformClimaticDistance ( 0 );

    }

    public void PerformClimaticDistance ( int barsAgo ) {

    close = isExternal ? extClose : Close;
    open = isExternal ? extOpen : Open;
    high = isExternal ? extHigh : High;
    low = isExternal ? extLow : Low;

    double sma = SMA ( close, sMAPeriod )[0];
    smaClose.Set(sma);

    currentBar = isExternal ? extCurrentBar : CurrentBar;

    if (currentBar > 2)
    SetClimacticDistance(0, true);

    }

    Why does this not work anymore ? - hopefully this is a bug - because without this 'feature' the software is in deep troubles.

    #2
    TheChingachgook,

    Can you please provide stripped down, simple-as-possible scripts that demonstrates the issue. I tried really basically the line of code you are stating as problematic with no problem on my end. Thank you.
    Attached Files
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      OK - I've created a sample

      Please put the TestAnalyzer-Column into the MarketAnalyzer
      Attached Files

      Comment


        #4
        - We never provided any support for market analyzer columns. This still yields true for NT7.
        - We always promoted to not create and keep instances of indicators.
        - Never the less I ran a quick review on your issue and tried some things but was unable to resolve your problem.

        I suggest starting from scratch to get some solid ground to see which the unsupported features you're using now breaks.

        Comment


          #5
          Originally posted by NinjaTrader_Dierk View Post
          - We never provided any support for market analyzer columns. This still yields true for NT7.
          - We always promoted to not create and keep instances of indicators.
          - Never the less I ran a quick review on your issue and tried some things but was unable to resolve your problem.

          I suggest starting from scratch to get some solid ground to see which the unsupported features you're using now breaks.
          @I suggest starting from scratch to get some solid ground to see which the unsupported features you're using now breaks.

          Sorry - I don't understand exactly - are you looking for a solution or do you mean it's my problem ?

          Comment


            #6
            I tried to point out a direction you could go to resolve the issue.

            Comment

            Latest Posts

            Collapse

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