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

Import question

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

    Import question

    I downloaded a .zip file (the LBR "310" indicator) but am unable to import it.

    When I try to do so, I get this message: "You have custom NinjaScript files on your PC that have programming errors. These errors must be resolved before you can import a NinjaScript Archive file."

    Uh - ohhhh kkkaaayy. How, then, do I determine in which files those errors exist, so I can deal with the problem? Not a very helpful error message.

    A bigger question: why would it matter at all if there are errors in some unrelated script? If the script I wish to run doesn't reference the one(s) with errors, who cares? Why such a limitation and why isn't there any useful information about the nature of the errors and where they exist?

    Thanks.

    #2
    Hello Weston,

    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.

    *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 post a screenshot of the error with the name and description fields clearly readable.

    Press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CRTL + V to paste the image. Lastly, save as a jpeg file and attach the file to the post.

    We have also collected more comprehensive steps for resolving NinjaScript programming errors in this tip on our forums - http://www.ninjatrader.com/support/f...ead.php?t=4678

    Let us know if we can be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Thank you for the reply. It allowed me to deal with the problem and get that indicator imported, modified and compiled.

      Comment


        #4
        Hello Weston,

        You are quite welcome and as always, let us know if we can be of further assistance.
        JCNinjaTrader Customer Service

        Comment


          #5
          JC: I do have another question. I posed this in a separate thread, but the person handling the question couldn't answer it to my satisfaction. Perhaps you can. All he/she could tell me was, basically, "That's the way it is. That's what it says in the documentation I have."

          Anyhow: Why can I not set up an indicator (I'm messing around with RSI - was a programmer for many years, but don't really know this language (C++, is it?)) ... to NOT autoscale. I want to see, at all times, the top value possible for this oscillator and the bottom (100 and 0, respectively). It just doesn't make sense to me that this wouldn't be possible. I can see that autoscaling would be turned off if the indicator were in the same panel as another indicator or the underlying instrument, but when it's in its own panel, it makes no sense to me that autoscaling MUST be defaulted to TRUE. I've seen reference to an AutoScale parameter in the DrawText function (function?) but, in indicators I've examined in which one can manually configure AutoScale, I've not found a DrawText function.

          Anyhow: how come why for it has to default to TRUE?

          Comment


            #6
            Originally posted by Weston View Post
            JC: I do have another question. I posed this in a separate thread, but the person handling the question couldn't answer it to my satisfaction. Perhaps you can. All he/she could tell me was, basically, "That's the way it is. That's what it says in the documentation I have."

            Anyhow: Why can I not set up an indicator (I'm messing around with RSI - was a programmer for many years, but don't really know this language (C++, is it?)) ... to NOT autoscale. I want to see, at all times, the top value possible for this oscillator and the bottom (100 and 0, respectively). It just doesn't make sense to me that this wouldn't be possible. I can see that autoscaling would be turned off if the indicator were in the same panel as another indicator or the underlying instrument, but when it's in its own panel, it makes no sense to me that autoscaling MUST be defaulted to TRUE. I've seen reference to an AutoScale parameter in the DrawText function (function?) but, in indicators I've examined in which one can manually configure AutoScale, I've not found a DrawText function.

            Anyhow: how come why for it has to default to TRUE?
            AutoScale is a built-in property. You CAN set AutoScale in the Initialize() method for the indicator.

            ref: http://www.ninjatrader.com/support/h.../autoscale.htm

            Comment


              #7
              Thanks, koganam. The replies I received in the other thread indicated that I was stuck with AutoScale set to TRUE. Not being familiar with the language and not finding that parameter being set in any of the indicators I examined, I didn't know this was possible ... though I certainly thought it should be.

              Comment


                #8
                Hello Weston,

                NinjaScript is based on the C# language.

                When only 1 plot or data series is on a panel it is the default settings inside of NinjaTrader to set AutoScale to true even if programmatically (as koganam stated earlier) it is set to false.

                One way to get around that could be to draw two horizontal lines and set AutoScale to True at the prices that you would always want to see. For example:

                Code:
                protected override void Initialize()
                {
                Overlay	= false;
                			
                DrawOnPricePanel = false;
                }
                
                protected override void OnBarUpdate()
                {
                			
                	// Draws a horizontal line and set AutoScale to True so that Chart will always show the values between 100 and 0 no matter the plot values
                	DrawHorizontalLine("tag1",true, 100, Color.Black, DashStyle.Solid, 1);
                	DrawHorizontalLine("tag2",true, 0, Color.Black, DashStyle.Solid, 1);
                
                }
                http://www.ninjatrader.com/support/h...zontalline.htm

                http://www.ninjatrader.com/support/h...pricepanel.htm

                With that said, you can manually set the scale of the panel by either double click in the right or left margin to open the Chart Panel Properties window, or right mouse click in the price scale and select the menu Properties. Then you may set the Range to Fixed and enter a Maximum and Minimum for the chart scale. You may also move the chart up or down by doing the follow the steps below.

                1.Move your mouse to the Y-Axis
                2. Hold down the Ctrl button and left mouse button
                3. While holding down both Ctrl + Left Mouse button move the mouse up or down

                http://www.ninjatrader.com/support/h...ng_a_chart.htm

                Let us know if we can be of further assistance.
                Last edited by NinjaTrader_JC; 10-19-2012, 03:44 PM.
                JCNinjaTrader Customer Service

                Comment


                  #9
                  Thanks. I'd conceived of that as a way to accomplish what I wanted but, not being at all familiar with the language, didn't know how to do it. Probably would have found the horizontal line drawing function (or whatever it's called in this language) ... but I certainly don't know about "protected override void Initialize()" and the code associated with that. And thanks for the info about doing this without coding.

                  Thanks!
                  Last edited by Weston; 10-19-2012, 09:01 PM.

                  Comment


                    #10
                    Originally posted by Weston View Post
                    I downloaded a .zip file (the LBR "310" indicator) but am unable to import it.

                    When I try to do so, I get this message: "You have custom NinjaScript files on your PC that have programming errors. These errors must be resolved before you can import a NinjaScript Archive file."

                    Uh - ohhhh kkkaaayy. How, then, do I determine in which files those errors exist, so I can deal with the problem? Not a very helpful error message.

                    A bigger question: why would it matter at all if there are errors in some unrelated script? If the script I wish to run doesn't reference the one(s) with errors, who cares? Why such a limitation and why isn't there any useful information about the nature of the errors and where they exist?

                    Thanks.

                    It is a well oiled machine, and must remain as such.

                    I think one time I upgraded, I got caught with some compile errors

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by cmtjoancolmenero, Yesterday, 03:58 PM
                    11 responses
                    39 views
                    0 likes
                    Last Post cmtjoancolmenero  
                    Started by FrazMann, Today, 11:21 AM
                    0 responses
                    3 views
                    0 likes
                    Last Post FrazMann  
                    Started by geddyisodin, Yesterday, 05:20 AM
                    8 responses
                    52 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Started by DayTradingDEMON, Today, 09:28 AM
                    4 responses
                    26 views
                    0 likes
                    Last Post DayTradingDEMON  
                    Started by George21, Today, 10:07 AM
                    1 response
                    22 views
                    0 likes
                    Last Post NinjaTrader_ChristopherJ  
                    Working...
                    X