How to Test and Use Templates for Automated Trading

Automated trading in NinjaTrader 8 can significantly enhance your trading efficiency and boost profits. With the right templates and strategies, you can leverage automation to execute trades and maximize returns.

This guide will walk you through the steps to test, import, and use templates for automated trading. From setting up accounts to evaluating performance and using templates strategically, everything you need to get started is here.

Step 1: Import Trading Templates into NinjaTrader 8

To begin, connect all the templates you wish to test to your NinjaTrader account and run them simultaneously. This approach helps you quickly identify which templates perform best in real trading conditions.

Before testing templates, you’ll need to import them into NinjaTrader 8. Follow these steps to import your templates:

  1. Open NinjaTrader 8.
  2. Navigate to the Control Center and click on the Tools menu.
  3. Select Import > NinjaScript Add-On.
  4. Locate and select the template files (strategy files) you want to import (files have a .zip extension).
  5. Click Open and follow the on-screen prompts to complete the import process.

Once imported, the templates will be available under Strategies in the platform’s settings.

Step 2: Add Accounts for Testing

For example, if you’re testing a 5-minute reversal strategy, connect all templates using that time frame to a simulation account (e.g., “SimReversal5min”). Run these templates for at least three days uninterrupted to gather accurate performance data.

A helpful approach is to group templates by time frames—for instance, account #1 for 5-minute templates and account #2 for 15-minute templates. This allows you to compare performance across different setups and identify the most profitable ones over time.

To test your templates effectively, you need to create simulation accounts. Here’s how to add accounts for testing:

  1. In the Control Center, go to the Accounts tab.
  2. Right-click in the Accounts window and select Add Simulation Account.