• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninjascript 8 Editor

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

    Ninjascript 8 Editor

    Hello,

    I have some questions related to Ninjascript Editor.
    1) How to remove light gray Boarder around current line. i.e line at which caret is. Please see attached screenshot.
    2) How to Format code.

    Regards

    Attached Files

    #2
    Hi daya123,
    ad 1) No clue. I find this very useful.
    ad 2) What type of formatting do you have in mind?
    If Font size (bold, italic, size), right click -> Properties -> General -> Text editor font
    If indentation, check the box on "Show indentation lines" in the menue where you would also set the Font.
    I'm not aware of custom auto-formatting of code functionality w/in NinjaTrader (indentation, spaces, etc.), but you could use Visual Studio, if that is important for you.
    NT-Roland

    Comment


      #3
      Hello NT-Roland,

      Thanks for your reply.

      1) That Light Grey Border Surround text is irritating to me. That's why I need to disable it.
      2) I want to Auto format Code file. That is to say, Proper indentation,Spacing,Padding,Alignment..etc. Of Course VS is there, But I am searching this functionality in NT.

      For Curious members, apart from VS, there is one program that can be use for Auto reformatting. And it can be used for numbers of Languages.
      HTML Code:
      https://sourceforge.net/projects/coolformat/
      Regards

      Comment


        #4
        Hello daya123,

        The colors for the platform are controlled by the skin. There may be a way to change the highlight however I don't see a property specifically named for that. you can take a look at the NinjaScript editors skin settings in the BluePrint.xaml file of the skin you are using: https://ninjatrader.com/support/help...hlightsub=skin

        As for formatting, that would not be something which the NinjaScript editor can accomplish. You would need to use a more advanced editor like visual studio if you wanted to apply code formatting rules. I could really only suggest visual studio, there is really no need for other applications for C# development as visual studio is C#'s native/standard editor. VS is also tied into NinjaTrader so you can just click the toolbar button to open the solution which will then also include the intellesense for the code.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Hi daya123 ,

          you could also switch to Visual Studio instead. While the NT editor is good, giving a product a try that a company spent millions of dollars on and is available for free isn't such a bad idea. Apart from the global errors list I'm not missing anything, and I'd not be surprised if it can be enabled some way.

          Comment


            #6
            Originally posted by NinjaTrader_Jesse View Post
            Hello daya123,

            ... VS is also tied into NinjaTrader so you can just click the toolbar button to open the solution which will then also include the intellesense for the code.
            Can that toolbar button be configured in some way to start VS Code? I no longer use Visual Studio, but have VS Code installed.

            Comment


              #7
              Hello caveat_lector,

              No, the toolbar button opens a visual studio .csproj in visual studio, You can download a free community edition of visual studio 2019 which would work with NinjaTrader. You can manually open the .csproj file from the documents folder in vs code however vscode has limited C# support in contrast to visual studio.

              Keep in mind that no matter what external editor is used you will never do the building from that editor so it will mainly be used for intellesense/code formatting. You would simply save the file and make sure to have the NinjaScript editor open in the background and that will trigger a compile.



              Please let me know if I may be of additional assistance.
              JesseNinjaTrader Customer Service

              Comment


                #8
                I used Visual Studio professionally for years, but now mostly write Assembly, C or C++ code in applications where speed is critical and the .NET Framework isn't needed. I prefer the speed of Notepad++ for that type of coding, and so uninstalled Visual Studio. I only occasionally need intellesense when writing NinjaScript. On those occasions it is of course available in the NT Editor, so Notepad++ has worked well for me as a NinjaScript editor, with one exception. The only problem has been that occasionally the NT Editor misses file timestamp changes when a .cs file is modified and re-saved by Notepad++. In those cases if I make an additional trivial change, such as adding a space character, and then re-save, that subsequent change is usually, but not always, detected, causing the NT Editor to reload and recompile. I would expect the same problem to occur with Visual Studio and wonder whether it does, and if not, why not.

                I realize that use of Notepad++ is not supported and don't expect support, but wonder if you have any idea why .cs file timestamp changes are sometimes missed.

                Comment


                  #9
                  Hello caveat_lector,

                  Even if you only occasionally need intellesense I would suggest to just leave visual studio installed, there is no harm in having it installed in addition to your other software. I really wouldn't suggest trying to use other editors as you will likely run into some different issues in relation to how files save and also how the editors interprets the intellesense data.

                  The NinjaScript editor is expecting the file save pattern from visual studio so if you are doing external changes from other software you may have limited success with compiles. It is possible that notepad++ is not using as fine of a timestamp, I really an not certain there.

                  Please let me know if I may be of additional assistance.

                  JesseNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by polo0202, Today, 12:15 PM
                  1 response
                  7 views
                  0 likes
                  Last Post NinjaTrader_BrendanC  
                  Started by GARZONJ, Today, 11:27 AM
                  1 response
                  6 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by NtFan, Today, 11:08 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post NtFan
                  by NtFan
                   
                  Started by anamaria0589, Today, 09:39 AM
                  1 response
                  13 views
                  0 likes
                  Last Post NinjaTrader_Jermaine  
                  Started by mcjosejavier, Today, 09:54 AM
                  1 response
                  11 views
                  0 likes
                  Last Post NinjaTrader_Heath  
                  Working...
                  X