Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Pre-Complier Errors With Indicator Wizard Generated Code

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

    Pre-Complier Errors With Indicator Wizard Generated Code

    With NT7, I'm getting pre-complier errors with Indicator Wizard generated code. Error lists: CS1502, NT1503, CS1502, CS1503, CS0103, CS0103. Invalid arguments. Line numbers starting in Properties areas and going lower.

    I've also tried loading library indicators into the editor, saving them as new file name, and running the complier. Same errors.

    What's causing this? I don't have this complier problem with Strategies, just with Indicators.
    Last edited by borland; 07-26-2016, 11:26 AM.

    #2
    Hello Borland,

    May we have a screenshot of the error messages?
    (please fully expand the error column so that we may read the error message)

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

    Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.
    Click here for detailed instruction
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      See the attached screenshot.
      Attached Files

      Comment


        #4
        Hello borland,

        You have errors in two files that are not in this script.
        One file is an indicator that starts with MyCustomIn (I am not able to read the full name of the indicator). The strategy starts with MyCustomSt (again I am not able to read the full name).

        It looks like you have attempted to use a double where a data series should be in the indicator.

        With the strategy, I'm not entirely sure. It mentions the Add() but also mentions Lines. I think there may be multiple errors in the strategy. But I would start with the Add() call in Initialize(). With Add() you can add a secondary series to the script or you can add an indicator to a chart. If you are trying to add lines or plots to a strategy this will not work by using the Add() call.

        What code is on line 55 of the indicator as shown in the error messages?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I've attached the Custom Indicator files. I have made no changes. One is Wizard generated code. The other is a duplicate of the EMA indicator in the Library. Again, no code changes were made, only file name is different.
          Attached Files

          Comment


            #6
            Hello borland,

            This indicator appears OK, though I can't be certain this is the script with the error... (I was not able to read the full file name in the screenshot of the error message you posted)

            Where is the strategy?

            The one that starts with MyCustomSt that is shown in the error messages?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              I clicked on that error code and it opened the NT strategy script file in another editor window. After commenting out the Add(... MyIndicator) to remove any compile errors in the Strategy file, the Indicator files now compile without errors.

              I'm not sure how/why NT complier got hung up with these unrelated files. That Strategy wasn't opened in any workspace or editor. The file names are different (MyCustomIndicator or MyCustomEMA) than the MyIndicator name used in the Strategy.

              Thanks for the help.

              Comment


                #8
                Hello borland,

                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 basically true of all C# projects and done to give you the highest runtime performance possible and to ensure that it is not possible to call a script that has not been compiled.

                I recommend watching the NinjaScript Editor webinar which covers understanding the error message colors and filenames.
                Dive into manipulating C# code from within an unlocked NinjaScript strategy using the NinjaScript Editor.NinjaTrader 7 is an award winning end to end online ...
                Last edited by NinjaTrader_ChelseaB; 07-26-2016, 02:39 PM.
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by timmbbo, 07-05-2023, 10:21 PM
                4 responses
                158 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by tkaboris, Today, 08:01 AM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by Lumbeezl, 01-11-2022, 06:50 PM
                31 responses
                818 views
                1 like
                Last Post NinjaTrader_Adrian  
                Started by xiinteractive, 04-09-2024, 08:08 AM
                5 responses
                15 views
                0 likes
                Last Post NinjaTrader_Erick  
                Started by swestendorf, Today, 11:14 AM
                2 responses
                6 views
                0 likes
                Last Post NinjaTrader_Kimberly  
                Working...
                X