Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator failing to compile

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

    Indicator failing to compile

    Hello,

    I am new to Ninja trader script writing.
    I wrote attached moving average crossover strategy which is very simple, but doesn't compile.
    Please help.
    thanks,
    Attached Files

    #2
    Hello alisidd,

    Thanks for your post and welcome to the forums!

    When you compile, the Ninjascript editor will list error messages at the bottom of the code window. In NinjaTrader, all Ninjascript (indicators/strategies/etc..) are all compiled together, so an error in any file will be shown in the file that is open.

    In the left column of the error messages will be the name of the file that contains the error. If the name does not match your strategy file name then the error is not within the strategy you posted.

    You will need all of your (files) code to be correct before the system can successfully compile. If you have created a file that is causing compilation issues and the file is no longer needed you can remove it from the folder, then open another strategy or indicator and compile to see if that resolves the error.

    Comment


      #3
      Indicator failing to compile

      Hi,

      Thanks for your prompt reply.
      I actually followed this video



      and expected it to compile without any errors.

      Now I can't figure out why it's not compiling.

      Any help will be appreciated.

      Comment


        #4
        Hello alisidd,

        Thanks for your post.

        As I tried to advise, the issue may not be with what you created but with another file.

        Please follow the instructions below to see where the errors are coming from after compiling the indicator. This will allow you to debug the indicator/strategy or remove it from your PC. If you are wondering why you receive an error when compiling only one indicator, it is because NinjaTrader always compiles all indicators and strategies - not just one. This is done to give you the highest runtime performance possible.

        For NinjaTrader 7:

        Open NinjaTrader
        From the Control Center select the Tools menu--> select the Edit NinjaScript menu item--> select Indicator
        Select ANY indicator and double click on it (we need only to open and compile one script to see all compile errors for all files).
        A new window will appear and you will need to right click in the window and select Compile to compile the indicators.
        At the bottom of the window a new section will appear where you can find the error locations.
        From there you have the option to comment out offending code sections, remove the complete indicator or debug it to be able to compile again.

        If you are unsure as to what the error is indicating, please send me a screenshot of the NinjaScript File column and Error column fully visible (not to be confused with the Code column)

        To send a screenshot with Windows 7 or newer I would recommend using Window's Snipping Tool.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        601 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        347 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        559 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        558 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X