Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with coding errors

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

    Help with coding errors

    Still learning Ninjascript. Could someone help me with the errors in this indicator?
    Attached Files

    #2
    Kendall, looks like you're missing a CurrentBars check at the beginning of your OnBarUpdate() :

    Comment


      #3
      I'm not sure. The error only appears when I add the new sections at the bottom of IndicatorREV. There is no error in the base indicator attached
      Attached Files

      Comment


        #4
        I'm not 100% sure I follow you - in your rev script you have a CurrentBars check for 1 bar only while trying to reference more than this back (2) -> this will not work and thus you need a higher check here for this script.

        Comment


          #5
          Changed the rev script but got an error regarding the public class name. I changed the public class name to something different than the same indicator that I already had, which fixed this error but generated many more.
          Attached Files

          Comment


            #6
            kendallw4,

            How did you change the name? There are many places that need the change propagated throughout the whole code. If you want to change names I suggest having the Editor take care of that for you by just doing a Save As and typing a new name for it to get a new name. That will make sure all locations it needs a different name will be changed.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              I did it as a saved as and still getting the same error

              Comment


                #8
                What error exactly do you see? Please provide the complete error text. Thank you.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  "The namespace 'NinjaTrader.Indicator' already contains a definition for '********Indicator'

                  Comment


                    #10
                    You will need to find across all of your NinjaScripts where exactly there is a file with two of the same indicator class names. Then you will need to delete one of them and then recompile.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      when I remove any other occurrences attached is what I get for errors in the indicator
                      Attached Files

                      Comment


                        #12
                        Originally posted by kendallw4 View Post
                        when I remove any other occurrences attached is what I get for errors in the indicator
                        You have shown the indicator, not the errors.
                        Last edited by koganam; 06-28-2011, 10:27 AM.

                        Comment


                          #13
                          Errors posted
                          Attached Files

                          Comment


                            #14
                            You would now need to double click on the errors and fix the relative code portions in the indicator where the issues were found, if you don't need the script anymore you could also delete it completely if you would not want to address those issues.

                            Comment


                              #15
                              When I double click the error it takes me to another indicator that I copied the code snippet from. I need to remove the link between the code it takes me to and this code that I'm trying to edit. How do I do that?

                              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