Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SampleMultiInstrument getting in the way

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

    SampleMultiInstrument getting in the way

    I'm trying to run my custom strategy and I can't run it because the SampleMultiInstrument strategy won't compile because on line 39 it has

    Add("ES 12-08", PeriodType.Minute, 1);

    and the error I'm getting is

    The strategy 'SampleMultiInstrument' has called the Add() method with an invalid instrument. Either 'ES 12-08' does not exist in the Instrument Manager or the specified exchange has not been configured.

    And I'm just trying to run data back to 6/1 to 6/9 so I'm stuck...

    Later...

    Well, I figured out that if I added the 12/08 ES instrument manager I'd get past it. Still, probably not a good idea to hard-code things like that in your sample scripts, especially since you can't move forward with your own strategies without fixing it.

    #2
    Had that same problem, although it didn't stop my compilation, just keeps kicking out that error in the log file every time I load my strats.

    Ross

    Comment


      #3
      To clarify:
      - that issue definitely will not prevent you from compiling, since the error message is a runtime error message thrown in the NT logs
      - it's a hard coded sample to illustrate how you would add future+their expriy in your custom strategy which you could edit
      - we will amend the sample with next update.

      Thanks

      Comment


        #4
        Well, when I try to back test a strategy, nothing happens, and I see this error in the log so I assume the reason my back testing is not doing anything is because of this error.

        I am on the free version of Ninja, using ZenFire (also a demo acct). Does the Zen demo account not support back testing? I can see live data just fine with it.

        Comment


          #5
          Where are you attempting to backtest your strategy shodson? Have you tried the per default installed 'SampleMACrossOver' strategy? You would need to be connected live to do this from the Chart or the Strategies tab.

          Comment


            #6
            Originally posted by NinjaTrader_Dierk View Post
            To clarify:
            - that issue definitely will not prevent you from compiling, since the error message is a runtime error message thrown in the NT logs
            - it's a hard coded sample to illustrate how you would add future+their expriy in your custom strategy which you could edit
            - we will amend the sample with next update.

            Thanks
            That is exactly what I'm saying: it's a runtime and not a compile. Please try this:
            - edit SampleMultiInstrument
            - right click->Save as: set a name of your choice
            - edit that freshly created custom strategy and set an instrument of your liking
            - backtest that strategy

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            85 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            47 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            29 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            32 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            67 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X