Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

indicator fails when strategy is applied

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

    indicator fails when strategy is applied

    Hi,

    I've written an indicator which uses heavy Matlab calculations per 50 ticks of data. Because the calculations are very time-intensive I use a .txt doc to temporarilystore the results so that I can calculate averages more efficiently.
    The indicator works just fine, graphs are just as expected. But then when I apply a very simple teststrategy to the indicator (go long if MyIndicator >90 and go short if MyIndicator < 10) It immediately fails, no output of MyIndicator.
    setup :
    Kinetick > Ninjatrader > FXCM testaccount.

    What could be the issue here?

    Thanks

    Michael

    #2
    Hello Michael,

    Do you receive an error on screen? Are there errors on the Log tab of the Control Center? If so, what do these errors report?

    If you use the Print() statement in your simple teststrategy is it failed before your indicator is called or after?
    http://www.ninjatrader.com/support/f...ead.php?t=3418
    JCNinjaTrader Customer Service

    Comment


      #3
      Originally posted by MichaelBruce View Post
      Hi,

      I've written an indicator which uses heavy Matlab calculations per 50 ticks of data. Because the calculations are very time-intensive I use a .txt doc to temporarilystore the results so that I can calculate averages more efficiently.
      The indicator works just fine, graphs are just as expected. But then when I apply a very simple teststrategy to the indicator (go long if MyIndicator >90 and go short if MyIndicator < 10) It immediately fails, no output of MyIndicator.
      setup :
      Kinetick > Ninjatrader > FXCM testaccount.

      What could be the issue here?

      Thanks

      Michael
      What errors, if any, are in your log?

      Comment


        #4
        error log

        I get :
        Error on calling 'OnBarUpdate' method for indicator 'MyIndicator' on bar 21: The object reference is not set to an instance of the object.

        Comment


          #5
          The strange thing is that this error suddenly appeared, the code is untouched for more then one week. After many attempts it sometimes works....
          Very strange. I've been working many hours a day with ninjatrader since July and this is the weirdest thing that has occurred so far...

          Comment


            #6
            Hello Michael,

            This error generally means that the NinjaScript item is accessing/calling an object that does not exist yet. You may view the following link that will go over how to make sure you have enough bars in a data series you are accessing.

            http://www.ninjatrader.com/support/f...ead.php?t=3170
            JCNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

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