NinjaScript Editor Components

Overview

The NinjaScript Editor is a powerful scripting editor that allows you to create custom indicators, strategies, and any other custom NinjaScript types used to enhance the NinjaTrader platform. The NinjaScript Editor can be opened by selecting the New menu from the NinjaTrader Control Center. Then left mouse click on the menu item NinjaScript Editor.

  • NinjaScript Explorer - Displays files, folders, and allows for additional file management
  • Tool bar - Moving your mouse over each icon will display the function of the icon button
  • Line numbers
  • Line modification marking - Yellow flags indicate unsaved line modifications where green flags indicate saved modifications
  • Tabs for creating new scripts via the NinjaScript wizard and working on multiple scripts.

NS_Editor_1

Context Menus

Context menus can be opened by right-clicking in the NinjaScript Editor.

NinjaScriptEditorContextMenu

Context Menu Items
SaveSaves pending changes to the currently open NinjaScript
Save AsCreates a copy of the script and attempts to rename the class name so the new script is unique
Insert Code SnippetInserts a code snippet (see Code Snippets for more information)
Go To Line...Moves the cursor to the line of code specified.
UndoUndoes the last modification
RedoApplies the modification that was last Undone
CutRemoves selected text and copies to clipboard
CopyCopies selected text to clipboard
PastePastes the text saved in the clipboard
RemoveRemoves the selected text
Select AllSelects all text in the Code Editor
Debug ModeSets if a debug dll should be generated on compilation (see Visual Studio Debugging for more information)
References...Opens the list of dll references used by NinjaTrader. This includes dll's used by NinjaTrader and dll's installed with custom Add On's.
Show WarningsEnables Warning messages to be seen alongside compile errors
Always On TopSets the NinjaScript Editor to viewed on top of other windows
PrintAllows printing the content of this window (see Printing Content for more information)
ShareAllows sharing the content of this window (see Sharing Content for more information)
PropertiesOpens the Properties menu (see below)

Properties and Definitions

ninjatrader_2020-12-03_10-03-00.png

General
Auto hide NinjaScript explorerSets if the NinjaScript explorer should be collapsed by default
Debug modeSets if a debug dll should be generated on compilation (see Visual Studio Debugging for more information)
Inline syntax checkingSets if errors and warnings should be detected as code is written (without needing to compile)
Auto bracket completionSets if opening characters should automatically be appended closing characters. Works for (parentheses), [brackets], {braces}, <angled brackets>
Show indentation linesDisplays vertical lines for code formatting
Show WarningsSets if code warnings should be shown on compilation.
FontSets the font optionsWindow
Always on topSets if the window will be always on top of other windows.