Backtesting a strategy with NinjaTrader 8 and analyze the performance

The best way to gain confidence that your trading strategy works is by backtesting it. Most traders backtest their strategies by looking at historical data to see where trade setups occurred. They use a spreadsheet to write down where a potential setup occurred and what the PnL would have been. As you can imagine this can be very time consuming and error-prone. That is one of the reasons traders stop early and only analyze a couple of days of historical data while it would be much better to at least backtest 100 trades and at least 6 months of historical data.

 Improve your trade tries to make backtesting easier. We created a special indicator for NinjaTrader 8 which allows you to easily mark your trades on the chart and when done upload them to your trading journal with a single click. Once all your backtested trades are in your trading journal you can analyze its performance in depth by using any of the analysis reports and filtering. In this post, we will explain to you how to get started backtesting your strategy.

To backtest a strategy in NinjaTrader 8 and then analyze the performance in your trade journal you

  1. Download and install the improve your trade backtest indicator in NinjaTrader 8
  2. Add the improve your trade backtest indicator to your chart
  3. Mark all your trades on the chart by placing up/down arrows for each trade
  4. Upload your trades to the improve your trade journal 
  5. Login to improve your trade and analyze the trading performance of your backtest

 

The idea is that we are just going to mark all our trades on the chart by simply drawing up/down arrows to mark our trade entry and exits. Our custom indicator will see all the arrows and recognize all trades you drew. It will show you some basic statistics right on your chart already. But for those who want to analyze the trades even further, we can use the indicator to upload all trades to the improve your trade journal. Once all your trades are uploaded in the journal you can then use all the various views and reports to analyze your trades in depth. In the next paragraphs, I will describe all the steps you need to do. But for those who cant' wait here's a video showing it in action ;-)

 

1. Download and install the improve your trade backtest indicator in NinjaTrader 8

To download and install the backtest indicator please follow these steps. 

  1. Login into your improve-your.trade account
  2. Go to settings/NinjaTrader 8 addon
  3. Download the latest installer from there
  4. Next, make sure NinjaTrader is NOT running
  5. Run the downloaded executable to install the indicator.
  6. When finished you can close the installer and start NinjaTrader 8

 

2. Add the improve your trade backtest indicator to your chart

After downloading and installing the backtest indicator you can add it to your chart like any other indicator. Note you will find the indicator in the EBWorx sub-folder (see screenshot below)

The indicator has all kinds of settings for you to play with. For now the most important are

  • The e-mail address you use to login to improve your trade
  • your password for improve your trade
  • The name of the trade setup you are going to backtest
  • The name of the account you want to contain your backtesting trades

Make sure you fill in the email address and password you use to login to improve your trade and choose a trade setup name & account name you want to use for your backtesting results. The indicator will use those fields for uploading all the trades to your online journal. If you want you can also change the lot size, commissions, and other settings. But for now.. I would suggest to just use the default values.

 

3. Mark all your trades on the chart by placing up/down arrows for each trade

Now its time to find and mark all your trades. We strongly suggest to take your time and do not rush this. Try to mark at least 100 trades over a 6-month period to get a good sample size. The more the better. Of course, you don’t need to do this all in 1 session. Maybe you mark 20 trades today and another 30 tomorrow. By just drawing 20-30 trades a day you keep motivated and before you know it you will have marked 100+ trades in a few days. These 100 trades will give you get a good sample and most reliable results.

Ok. so to mark a trade, you do the following.

Marking a short  trade:

Draw an up arrow (ALT+F2) at your entry and a down arrow (ALT+F3) at your exit. The indicator will draw a line between the two and tell you the open/close price, the number of ticks, and PnL for the trade. 

Marking a short  trade:

Draw a down arrow (ALT+F3) at your entry and an up arrow (ALT+F2) at your exit. The indicator will draw a line between the two and tell you the open/close price, the number of ticks, and PnL for the trade.

Note you can always move your arrows around if they are not exactly at the correct price.

Marking your stop loss

You can specify where your stop loss is by drawing a rectangle (ALT+F7) between your entry-exit arrows. The indicator will draw a red horizontal line when it recognizes your stop loss. It's always important to draw your stop loss since it will be used by many trading performance statistics later on when you analyze your results in your improve-your trade journal

 

4. Upload your trades to the improve your trade journal 

When you marked all your trades on the chart you can upload them to the improve your trade journal by simply clicking the upload button. Depending on how many trades you marked this might take some time. So, get a cup of coffee, sit back, and relax. Usually, all trades should be uploaded within a few minutes.

It’s a good idea to check if the upload is successful by logging in to your improve your trade journal and verifying that all trades have been added into account you specified.

 

5. Login to improve your trade and analyze the trading performance of your backtest

Now that all your trades are in your trading journal you can start analyzing the trading performance. Login in to improve your trade and make sure you selected the correct account in the filter, otherwise you won’t see your backtested trades.

Next, go through the various analysis views. For example.. look at your risk of ruin or any of the top 17 trading metrics.  Once you are done with the analysis then use the monte Carlo simulator to too see how robust this strategy is and how small changes in the market affect its performance. 

 Take a look at How to start a trading journal and analyze your trading performance for a quick start

 

 

 

 

Erwin

I am the owner of EB-Worx. Together with my wife and dog I live in the Netherlands where I love to day trade the ES-mini and develop software which helps me to become a better trader.

Recent Content

What is a Trading Journal ? (And why you need one)

Do you want to know what a trading journal is, and why you should use one ? If you are serious about your trading, then you should treat it as a real business. This means you should track all your dat...

Read More

Monte Carlo Simulation Explained; The Ultimate Guide

As a trader, you probably noticed understand that markets change from time to time. For example, during the summer we often see that the markets are quieter and during the fall we usually get some mor...

Read More