Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

The code generator does not create the region #region NinjaScript

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

    The code generator does not create the region #region NinjaScript

    hi!
    Look at these indicators, please.
    the region
    region NinjaScript generated code. Neither change nor remove.
    is missed in MyCustomIndicatorTester.cs

    it seems the space before { in the line 25 maters.

    Is it an expected behavior?

    Regards,

    Attached Files

    #2
    Hello AlexMocc,

    Thank you for your post.

    Yes, NinjaScript wrappers are generated when a script is edited in the NinjaScript editor. If you remove the space before the opening curly brace { in the line 'namespace NinjaTrader.NinjaScript.Indicators.SomeName {' then the wrappers, aka the NinjaScript Generated Code, will not be automatically generated. If you add the space back in and re-compile, the wrappers are auto-generated again.

    There are other known wrappers limitations listed at the very bottom of this help guide page in the "Miscellaneous practices" sub-section:


    Please let us know if we may be of further assistance.

    Comment


      #3
      Hi
      Originally posted by NinjaTrader_Emily View Post
      If you remove the space before the opening curly brace { in the line 'namespace NinjaTrader.NinjaScript.Indicators.SomeName {' then the wrappers, aka the NinjaScript Generated Code, will not be automatically generated. If you add the space back in and re-compile, the wrappers are auto-generated again.
      This case is not listed as a known wrappers limitation
      Is this a bug? Are you going to add this case to the listed limitations?
      Regards,

      Comment


        #4
        Hello AlexMocc,

        Thank you for your reply.

        This is not a bug; this is expected behavior. It is suggested to start a script using the NinjaScript Wizard, as this will help to define the namespace properly for the wrappers to be generated along with any default properties, custom input parameters, added data series, and event method syntax from the options selected in the wizard:
        https://ninjatrader.com/support/help.../ns_wizard.htm

        I can request to have more details added to the known wrappers limitations in the help guide to cover this scenario.

        I am also editing my post to add the following:
        There is a code comment in the line prior to the namespace that states
        Code:
        //This namespace holds Indicators in this folder and is required. Do not change it.
        The namespace will populate according to the folder from which a script is generated or moved to. The reason it should not be changed (such as removing the space between the namespace and the opening curly brace { in your example) is because this can prevent the wrappers from generating as expected.

        Thank you for using NinjaTrader.
        Last edited by NinjaTrader_Emily; 10-09-2023, 12:06 PM.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        71 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        43 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        25 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        28 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        56 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X