You can run a NinjaScript strategy in real-time in a live or simulation account. Following are some key points and instructions on on how to run a NinjaScript strategy from a chart.
1. Within the NinjaTrader Control Ceneter window, open a a chart via File > New > Chart and select the instrument, interval type and period that you want to run the strategy on
2. Set Chart Properties to your preferences
3. As per the image below, either select the "Strategies..." menu from within the right mouse button click context menu, the Strategies icon from the tool bar or press the CTRL-S keys simultaneously on your keyboard bring up the Strategy dialog window

4. You can add/remove and set up live strategies from within the Strategy dialog window pictured below
1. List of availabe strategies
2. List of live strategies currently running on the chart
3. Selected strategy's properties

5. From the list of available strategies (section 1 in the image above) select a strategy and either press the "New" button or double click on the strategy
6. Once added to the list of applied strategies (section 2 in the image above), you can now edit the strategy's properties
7. Set the strategies properties (section 3 in the image above)
8. Press the "OK" button to run the strategy
9. To terminate (stop running) a strategy, you can highlight a running strategy and press the "Remove" button within the Strategy dialog window
Property Definitions
|
Parameters section |
Sets any strategy specific user defined inputs |
|
Account |
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 else its calculated with each incoming tick |
|
Label |
Sets a text value that will be displayed on the chart to represent the strategy |
|
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 |
|
Slippage |
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. |
|
Error handling |
Sets the real-time order error handling |
|
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 that the any an open position(s) of a strategy is closed |
|
Stop & target submission |
Sets how stop and target orders are submitted |
|
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
|
|
Time in force |
Sets the order time in force |