Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

New NJT 8 version and new errors...

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

    New NJT 8 version and new errors...

    With the new version of NJT 8 software I now get errors in some of my strategies that I've created. The current screen shot showing the errors in the code are new. I've seen no errors like this in any previous versions of NJT 8. The strategy pictured is almost two years old and like I said, I have never seen anything like this before...



    Click image for larger version

Name:	Code Errors.jpg
Views:	212
Size:	304.3 KB
ID:	1259618

    #2
    Hello Mykro,

    Thanks for your post.

    In the screenshot you shared of your code you are calling comparison operators but are not actually comparing anything.

    In your script, you would need to add values to compare in your conditions. In the code, you have ( > ) and ( <= ) which does not compare anything. You should be comparing values, for example (Close[0] > Open[0]) or (Close[0] <= Open[0]).

    You also need to make sure that each open parenthesis has a closing parenthesis accompanying it.

    And, make sure that each method within your conditions contains a semi-colon at the end. For example, EnterLong();

    Below is a link to a forum post with helpful information about getting started with NinjaScript.
    https://ninjatrader.com/support/foru...040#post786040

    If you are new to C#, to get a basic foundation for the concepts and syntax used in NinjaScript I would recommend this section of articles in our help guide first:
    https://ninjatrader.com/support/help...g_concepts.htm​​
    <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


      #3
      Originally posted by NinjaTrader_BrandonH View Post
      Hello Mykro,

      Thanks for your post.

      In the screenshot you shared of your code you are calling comparison operators but are not actually comparing anything.

      In your script, you would need to add values to compare in your conditions. In the code, you have ( > ) and ( <= ) which does not compare anything. You should be comparing values, for example (Close[0] > Open[0]) or (Close[0] <= Open[0]).

      You also need to make sure that each open parenthesis has a closing parenthesis accompanying it.

      And, make sure that each method within your conditions contains a semi-colon at the end. For example, EnterLong();

      Below is a link to a forum post with helpful information about getting started with NinjaScript.
      https://ninjatrader.com/support/foru...040#post786040

      If you are new to C#, to get a basic foundation for the concepts and syntax used in NinjaScript I would recommend this section of articles in our help guide first:
      https://ninjatrader.com/support/help...g_concepts.htm​​
      Brandon,

      Those comparison operators, or that code that you see... IS NOT by me..!! Those are errors by NJT8 v. 8.1.1.7. These errors are sporadic in different strategies that I have created from the past (over a year now ).. If one strategy is in an incompatible state that keeps me from compiling anything else I may create.. Like I said in my first post, these errors are all new with this new version of NJT8... I have not seen anything like this in previous versions where the code worked and then was changed like what you see from the image..

      Comment


        #4
        Hello Mykro,

        Thanks for your notes.

        NinjaTrader does not add the comparison operators seen in your screenshot by default to NinjaScript code.

        Was this strategy created by you using the NinjaScript Editor window? Or, is the strategy created by you in the Strategy Builder?

        You would either need to resolve the compile errors in your script by removing the lines of code from the script that is causing the errors or by adding values to compare inside the conditions seen in the screenshot.

        Further, you will need to add a semi-colon at the end of methods, such as EnterLong();, and ensure that you have the appropriate number of opening/closing parentheses and curly braces in the script.

        Or, you could exclude the script from compilation by right-clicking on the script file in the Strategies folder of the NinjaScript Editor window and selecting the 'Exclude from compilation' option.
        <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 argusthome, 03-08-2026, 10:06 AM
        0 responses
        93 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        48 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        31 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        34 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        70 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X