Operations > Automated Trading > Running NinjaScript Strategies >

Running a NinjaScriptStrategy from the Strategies Tab

Print this Topic Previous pageReturn to chapter overviewNext page

You can run a NinjaScript strategy in real-time in a live or simulation account via the Strategies tab of the Control Center.


tog_minusHow to run a NinjaScript strategy from the Strategies tab

Setup Tips

Following are some key points and instructions on on how to run a NinjaScript strategy from the Strategies tab of the Control Center window:


NinjaTrader MUST be connected to a live brokerage or market data vendor
A NinjaScript strategy is a self contained automated trading system and orders generated are live and not virtual. Cancelling strategy generated orders manually can cause your strategy to stop executing as you designed it. If you want to manually cancel an order, terminate the strategy first.
Strategies initiated from the Strategies tab will NOT appear in a chart
If running an FX strategy, please review the "Running FX Strategies" section for critical information


Running a NinjaScript Strategy

To run a NinjaScript strategy from the Strategies tab:


1.Left mouse click on the Strategies tab found in the NinjaTrader Control Center
2.Right mouse click within the Strategies tab. The right click menu will appear.
3.Select the menu item New Strategy... The New Strategy window will appear.
4.Choose the strategy you wish to run from the Strategy drop down menu.
5.Set the instrument, interval, and other optional strategy properties (see the "Understanding strategy properties section below") and press the OK button
6.Check the box in the Enable column of the Strategies tab next to the strategy you wish to enable.


tog_minusUnderstanding strategy properties

Strategy Properties (see image below)

The image below shows the adjustable properties for a strategy available in the Strategies tab of the Control Center (see the "How to run a NinjaScript strategy in from the Strategies tab" section above):


Parameters section

Sets any strategy specific user defined inputs

Price based on

Sets the type of market data used to drive the Data Series.


Sets the bar type of the Data Series.


Sets the Data Series value.


Sets the instrument(s) the strategy will run against

Days to load

Sets the number of days to load data

Session template

Sets the session time template for the Data Series. (See the "Session Manager" section of the Help Guide for more information)


Sets the account the strategy will execute orders in

Calculate on bar close

If true, will only calculate the strategy's value on the close of a bar. If false, will calculate the strategy's value on each incoming tick.


Sets a text label that will be displayed on the chart to represent the strategy

Maximum bars look back

Sets the maximum number of historical bars to use for strategy calculations. The TwoHundredFiftySix setting is the most memory friendly.

Min. bars required

Sets the minimum number of bars required before the backtest will start processing

Fill Type

Sets the algorithm for processing and filling orders on the historical data portion of the chart


Sets the slippage amount in ticks for the historical portion of the chart

Entries per direction

Sets the maximum number of entries allowed per direction while a position is active based on the "Entry handling" property

Entry handling

Sets the manner in how entry orders are handled. If set to "AllEntries", the strategy will process all entry orders until the maximum allowable entries set by the "Entries per direction" property has been reached while in an open position. If set to "UniqueEntries", strategy will process entry orders until the maximum allowable entries set by the "Entries per direction" property per each uniquely named entry.

Exit on close

When enabled, open positions are closed on the last bar of a session

Exit on close seconds

Sets the number of seconds prior to the end of a session when open positions of a strategy will be closed

Stop & target submission

Sets how stop and target orders are submitted

Sync account position

Enables or disables an automatic attempt to sync the account position and strategy position.

Set order quantity

Sets how the order size is determined, options are:

"by default quantity" - User defined order size

"by strategy" - Takes the order size specified programmatically within the strategy
"by account" - Allows you to set a virtual account value that is used to determine maximum order size based on margin settings per instrument set in the Instrument Manager

Time in force

Sets the order's time in force