Both Real Time and Backtest generated Trading Data can easily be imported into BTAnalytics from NinjaTrader.
To export the Real Time Trades from NinjaTrader, you can take the following steps:
|1.||Select the Click on the "Account Performance" tab in the NinjaTrader main window and then in the "Trades" tab.|
|2.||Right click on the grid and in the context menu select "Grid -> Save as".|
|3.||A window should open that will allow you to save the trades in a CSV format.|
|4.||After that, you can import the text files with the exported trades into BTAnalytics by following the instructions on Importing Text Files in the BTAnalytics Documentation.|
To export the Strategy Analyzer Backtest generated Trades from NinjaTrader, you can use the Binary Data Feeder created for this purpose. For more information about Binary Data Feeders, please see: Importing Data using a Binary Data Feeder in the BTAnalytics documentation.
To be able to import data into BTAnalytics from NinjaTrader, take the following steps:
|1.||Download the NinjaTrader Binary Data Feeder from the BTAnalytics website.|
You can download the NinjaTrader Binary Data Feeder from the External Data Feeders download page in our website.
|2.||Install the downloaded NinjaTrader Data Feeder.|
NinjaTrader must be closed before starting the NinjaTrader Data Feeder installation process.
|3.||Compile a Strategy in NinjaTrader.|
For the NinjaTrader BTAnalytics Data Feeder to work you have to compile any strategy in NinjaTrader.
|1.||Open the Strategy Analyzer.|
|2.||In the Strategies tree, double click in any strategy in order to open it in the code editor.|
|3.||In the Code Editor, right-click in any position of the editor and in the shown menu click on "Compile" or simply push F5|
|4.||The Strategies will be updated and compiled. if there are errors during the build process, take appropriate actions to fix them.|
|4.||Easily export your Backtests Data from the NinjaTrader Strategy Analyzer into BTAnalytics!|
Whenever you want to export your backtest results from NinjaTrader Strategy Analyzer into BTAnalytics, you only have to push the button in the Strategy Analyzer tool box.
Note: The "Export" button will appear in the Strategy Analyzer tool box only after a simulation of a strategy has been performed.
In this window, you can:
|•||Set the path where the simulation data will be exported. This path can be configured in BTAnalytics for Automatic Folder Monitoring.|
|•||Select a name for the exported data, write a small note (that will be shown in the Studies Explorer) or a deeper description.|
|•||Normalize Equity Curve: you can make that the exported Equity Curve only has data points with certain periodicity. For example you can normalize an intraday Trading System equity curve to show the equity curve with data only in a daily basis.|
|•||Include Analysis Variables: Select if you want to include Analysis Variables with the exported data. See 'Exporting Analysis Variables'.|
|•||Ignore Intra-Trade Bars: Only information about the first and last bar of the trade is included for each trade. This reduces the size of the simulation data but also reduces the precision of the simulation and falsifies the "Bars Held" data.|
Note: With the NinjaTrader Data Feeder install it's included a NinjaTrader example strategy with the name "SampleMACrossOver_BTAnalytics" that shows how easy is to export Analysis Variables data.
If you want to include Analysis Variables for further analysis or to design filters over them using the BTAnalytics Analysis Vars DAV or the Analysis Vars Derivation Builder, you have to check the 'Include Analysis Variables' option in the NinjaTrader BTAnalytics Data Feeder.
Then, you can include Analysis Variables data with the Trading Data using the "BTASetAnalysisVar()" method. This method has the following declaration:
void BTASetAnalysisVar(string varName, IDataSeries dataSeries, BarOfAnalysis barOfAnalysis)
|1.||Example that adds several Analysis Variables to be exported to BTAnalytics:|
//Add Analysis Vars:
//Add Analysis Vars:
BTASetAnalysisVar("Fast SMA", SMA(Fast), BarOfAnalysis.BarBeforeEntry);
BTASetAnalysisVar("Slow SMA", SMA(Slow), BarOfAnalysis.BarBeforeEntry);
BTASetAnalysisVar("RSI(10,0)", RSI(Slow, 0), BarOfAnalysis.BarBeforeEntry);
BTASetAnalysisVar("RSI(Open, 10, 1)", RSI(Open, 10, 1), BarOfAnalysis.BarBeforeEntry | BarOfAnalysis.BarOfEntry); //Add Analysis Vars for both the "Bar Before Entry" and "Bar Of Entry"
|2.||When you imports into BTAnalytics the Trading Results, you will be able to analyze the results for the Analysis Vars in the Analysis Vars DAV of the Raw Simulation Study or in the Analysis Var Derivation Builder:|
Note: NinjaTrader is a trademark of NinjaTrader LLC