Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

About NinjaScript Source Code by Color

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

    About NinjaScript Source Code by Color

    Is it possible to change the colors of the source code to make it easier to identify?

    For example, variables are blue, functions are red, etc.
    Last edited by ラリー; 08-23-2022, 11:34 PM.

    #2
    Hello ラリー,

    Thanks for your post.

    No, NinjaTrader does not have any options available for changing the colors for certain pieces of code seen in the NinjaScript Editor window, such as blue for variables and red for functions.

    Visual Studio has add-ons available that could be used to change the color of code when programming in the Visual Studio application. It would be up to you to locate, download, and use those Visual Studio add-ons as this goes beyond what we are able to provide support for.

    You could consider downloading Visual Studio, selecting the 'Visual Studio' button in the NinjaScript Editor window to open the project in Visual Studio, and using Visual Studio for developing your NinjaScript indicators and strategies.

    See this help guide page for more information about opening a NinjaScript in Visual Studio:https://ninjatrader.com/support/help..._debugging.htm

    Note that if you decide to do this, you must make changes to the script in Visual Studio and then run a compile in the NinjaScript Editor window for changes to take effect.

    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


      #3
      ラリー You could always make a Skin (NT8 only) to your preferred settings: https://ninjatrader.com/support/help...r_own_skin.htm

      I have done this for various NinjaScript Editor colours and it works very well. I just select my version of the skin and there it all is.

      There may not be settings for specific types of elements you want, but many things are there.

      Thanks.
      Multi-Dimensional Managed Trading
      jeronymite
      NinjaTrader Ecosystem Vendor - Mizpah Software

      Comment


        #4
        NinjaTrader_BrandonH

        Thank you for your reply.

        I am seeing different source code etc. in my environment than the screenshot of the link you sent, why is this?
        Attached Files

        Comment


          #5
          ジェロニマイト

          Thank you for your reply.

          I will attempt it and would be happy to ask again.

          Comment


            #6
            Hello ラリー,

            Thanks for your note.

            "I am seeing different source code etc. in my environment than the screenshot of the link you sent, why is this?"

            The source code of the DMI indicator may have been modified by the development team between when the screenshot in the help guide was taken and the current release of NinjaTrader 8.

            If you are running the most up-to-date version of NinjaTrader 8 (8.0.26.1) seen in the Help > About window of NinjaTrader 8 then these differences between your screenshot and the screenshot in the help guide can be ignored.

            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


              #7
              NinjaTrader_BrandonH

              Thank you for your reply.

              I see that you did.
              My version of Ninja trader seems to be the latest.

              The screenshots I sent you before, I think they are separated by color, but what are the different types of colors (variables, functions, etc.) for each of them?

              Comment


                #8
                jeronymite

                Thank you for your assistance.
                Regarding your progress.
                I am trying to create and open the BluePrint.xaml in the article you sent me, but do you mean to open it from ninja script or visual studios?
                Attached Files

                Comment


                  #9
                  Hello ラリー,

                  Thanks for your note.

                  "I think they are separated by color, but what are the different types of colors (variables, functions, etc.) for each of them?"

                  Since this is Visual Studio and not NinjaTrader, I would not be able to determine what exactly each color means.

                  You could consider doing a quick Google search for something like 'Visual Studio syntax colors' to find information about the different syntax colors in Visual Studio.

                  "I am trying to create and open the BluePrint.xaml in the article you sent me, but do you mean to open it from ninja script or visual studios?"

                  You could open the BluePrint.xaml file in Visual Studio if you would like to modify it.

                  See this help guide page for information about creating your own skin: https://ninjatrader.com/support/help...r_own_skin.htm

                  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


                    #10
                    Thank you for your reply.

                    We would be happy to make an attempt and contact you again regarding the above and thank you in advance for your cooperation.

                    Comment


                      #11
                      We will keep you informed of our progress.

                      As for BluePrint, I was able to open it in Visual Studio.

                      Since this is Visual Studio and not NinjaTrader, I would not be able to determine what exactly each color means.
                      You could consider doing a quick Google search for something like 'Visual Studio syntax colors' to find information about the different syntax colors in Visual Studio.
                      Now, I would like to ask about the color of the Ninja script code, how is each of the screenshots I have attached color-coded?
                      For example, I would like to know if the blue code is a variable or a function.
                      Attached Files
                      Last edited by ラリー; 08-28-2022, 07:12 PM.

                      Comment


                        #12
                        Hello ラリー,

                        Thanks for your note.

                        You could see what conditional colors are used for the NinjaScript Editor window around line 874 in the BluePrint.xaml file.

                        The cyan blue color will indicate a number, such as 14. The light blue color indicates a keyword. Strings will display as a darker blue color. Text will display as white.

                        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


                          #13
                          Thank you for your reply.

                          You say that light blue is for keywords, but do keywords include reserved words?
                          Also, you mentioned that text will be displayed in white.
                          Does it also include functions?

                          Comment


                            #14
                            Hello ラリー,

                            Thanks for your note.

                            Yes, keywords are reserved words. Class names and method names will also be light blue in color.

                            Text is considered anything that is not a number, string, or keyword and will display as white in color.

                            I would recommend creating a custom indicator or strategy using the NinjaScript Editor window and noting the color of the code as you create the indicator/strategy. For example, if you type in a number and see that it is cyan blue, this means all numbers will be cyan blue. If you add a method and see that it is light blue, then this would mean all methods are light blue. If you create a string and see that it is dark blue, this means all strings will be dark blue, etc.

                            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


                              #15
                              Thank you for your reply.

                              Text is considered anything that is not a number, string, or keyword and will display as white in color.
                              You mention that the text is white, but when I search the document linked below, I find a description of DMI (white) in the last 35 lines attached, and there is an article about DMI, but why is there no article about dmMinus (white) in the description in line 37?

                              https://ninjatrader.com/support/help...o_read_fro.htm

                              Comment

                              Latest Posts

                              Collapse

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