Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error Code CS1022 and Related errors. How to correct?

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

    Error Code CS1022 and Related errors. How to correct?

    Hello,

    I've searched all over for solutions in multiple places and rechecked formatting. Hopefully you can help. I have attached a photo of the errors in ninjascript. I'll upload the print of the complete code as well.

    Thank you!


    #2
    Here is the complete print of the code as well. Thanks
    Attached Files

    Comment


      #3
      At the end of your indicator class, you have several extra } closing curly braces - if you notice, in the editor, it highlights one of them as being the line of the error.
      Bruce DeVault
      QuantKey Trading Vendor Services
      NinjaTrader Ecosystem Vendor - QuantKey

      Comment


        #4
        Thank for replying Bruce. It's strange because I've removed the } along with the subsequent curly braces only to cause additional errors. I've even added and subtracted the indentation. It's like there's an expectation of something to be on that line but I don't know what it's referencing.

        Comment


          #5
          Hello cerebraltrader,

          Thanks for your post.

          All the 'Using' declarations should be added to the top of the script in the 'Using Decalarations' region of the script.

          It seems like there are extra closing curly braces in the script as QuantKey_Bruce has mentioned.

          I also seems that "public class PullbackIndicator : Indicator" is being called twice in the same script as well as "protected override void OnBarUpdate()". You only need to define the class once and OnBarUpdate() should only be called once. Any logic that needs to be placed in OnBarUpdate could be placed in a single OnBarUpdate() call.

          To determine the exact line(s) of code causing the issue you should reduce the script by commenting out sections of code and recompiling. If you see the error go away after commenting out a section of code, it is likely that second throwing the error in the script. You could then narrow in on the offending code in that section to find the exact line causing the error.

          Please let me know if I may assist further.
          <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          648 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          369 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
          573 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          575 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X