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

NinjaScript editor #region un-collapsing.

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

    NinjaScript editor #region un-collapsing.

    Is there a way to stop the Ninjascript editor un-collapsing my code #region(s) and functions every time the script is compiled. This is very annoying and a time waster. It also defeats the purpose of #region i.e. hiding code not being worked on to make getting around the code easier.
    Last edited by seahn; 02-22-2017, 11:46 AM.

    #2
    Hello seahn,

    Thank you for your note.

    What version of NinjaTrader are you currently running?

    The regions would be expected to collapse upon compiling your code. I have tested this and my regions are collapsing upon compile. However, the body of your code is expected to expand after compiling. Are you finding that your regions specifically are expanding and not collapsing or do you mean something else?

    If it is just the regions that are expanding then we would want to take a look at the code itself and attempt to reproduce. If you could attach the .cs file to an email to platformsupport[AT]ninjatrader[DOT]com with "ATTN CHRIS S" in the subject line, I will be happy to look into this further.

    Thank you and I look forward to your reply.

    Comment


      #3
      I am using NT8.

      The regions and functions in my code which I manually collapse seem to randomly expand after compilation I cannot seem to reproduce it consistently, sometimes just one or two regions get expanded other times every function in the script gets expanded. As you can imagine it is very frustrating in a large script to have all the code I have just spent minutes collapsing because I am not working on it be expanded again when I recompile.

      But the point is the collapsed/expanded state of any text should not be affected by compilation that is how all editors I have used behave such as Visual Studio.
      Last edited by seahn; 02-22-2017, 09:34 PM.

      Comment


        #4
        Hello seahn,

        Under Control Center>Help>About, next to version, what is the number you see? For example, 8.0.2.0.

        I look forward to your reply.
        Last edited by NinjaTrader_AlanP; 02-24-2017, 02:21 PM.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Nt 8.0.4.0

          Comment


            #6
            Hello,

            Thank you for your note.

            Without the full code we're unable to test on our end.

            If you'd like to upload the full code I can take a look and see if anything jumps out. Or if you'd prefer to email a copy, send to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread, and the files.

            I look forward to your reply.
            Alan P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_AlanP View Post
              Without the full code we're unable to test on our end.
              This has been an ongoing problem since early in the beta cycle..



              Was a lot worse early on.. but the problem being described here, is the same as my comment from late 2015 in the above thread.. This has been a long standing problem with working in NT8's editor, and remains to be a major pain..



              -=Edge=-
              NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

              Comment


                #8
                Originally posted by -=Edge=- View Post
                This has been an ongoing problem since early in the beta cycle..
                This has been a problem going back to NT7.

                At this point I kind of feel like I am just getting the run around on the issue, it happens regularly for me with all types of scripts yet they "cannot reproduce the problem". I doubt NT will do anything about this since the editor is 3rd party software I believe.

                I am working around the issue by using the Visual Studio link in the NT8 script editor. I can do all my editing in VS then save the file (Ctrl-S). The NT8 editor sees the code has changed and automatically compiles the script. Its pretty seamless, I just minimize the NT8 editor and forget about it.

                Anyone that wants to edit with Visual Studio if you do not have it Microsoft has Visual Studio Community Edition which is free just Google it. Just be sure you do not compile in VS and do not save the solution when done.

                Comment


                  #9
                  Oh, the run around, around here. YUPPPPP

                  The highlighting with /* and */ is also still a problem. Using 3rd party softwares has it plus and minus. Is the 3rd party to blame?

                  Comment


                    #10
                    Yes... This is all happening.

                    Comment


                      #11
                      Hello marty087 and seahn,

                      Development is aware of the issue and working on a resolution.

                      Thank you for your patience.
                      Alan P.NinjaTrader Customer Service

                      Comment


                        #12
                        I was able to get rid of most instances of this issue by going thru my code
                        and making sure that I did not have double // // comment slashes on any one line.
                        However in some regions I was unable to fix the region collapse based on this theory albeit
                        it did fix most.

                        Comment


                          #13
                          Originally posted by NinjaTrader_AlanP View Post
                          Without the full code we're unable to test on our end.
                          Not sure if this will help.. but duplicating these issues is not difficult.. Throw this in your indicator folder and open in editor..

                          1st thing to notice is that regions don't work at all unless they encompasses the entire method. Notice because the OnStateChange region is inside the override method but the endregion is not.. It doesn't even recognize it as a region..

                          Now left click on line 122 or 123 in the editor and delete it..
                          or tab the endregion line 55 over 1...
                          or I could come up with other scenarios of inserting lines of code.. that will....

                          Immediately expand all regions...


                          Attached Files
                          -=Edge=-
                          NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

                          Comment


                            #14
                            Hello =Edge=-,

                            Thank you for the information and steps to reproduce; I have passed this on to development.

                            Please let us know if you need further assistance.
                            Alan P.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by The_Sec, Yesterday, 03:37 PM
                            1 response
                            11 views
                            0 likes
                            Last Post NinjaTrader_Gaby  
                            Started by vecnopus, Today, 06:15 AM
                            0 responses
                            1 view
                            0 likes
                            Last Post vecnopus  
                            Started by Aviram Y, Today, 05:29 AM
                            0 responses
                            5 views
                            0 likes
                            Last Post Aviram Y  
                            Started by quantismo, 04-17-2024, 05:13 PM
                            3 responses
                            27 views
                            0 likes
                            Last Post NinjaTrader_Gaby  
                            Started by ScottWalsh, 04-16-2024, 04:29 PM
                            7 responses
                            36 views
                            0 likes
                            Last Post NinjaTrader_Gaby  
                            Working...
                            X