What I did was build a simple strategy in Ninjatrader that does the following:
1- Builds a Database in MySQL
2- Builds needed tables (OpenPnL & ClosedPnL)
3- Stores PNL for all instruments that the strategy is loaded
4- Runs a Query for both Open and Closed PNL
5- Using existing indicator Strategy Plot draws both total PNL (Open + Closed) and Realized PNL
The possibilities of this method are very robust. I can reference the MySQL database in Excel or third party apps, or I can build logic in the trading system to stop trading at a defined loss.
You will need MySQL loaded on your machine, and I suggest setting up your own user name and pass word. There are plenty resources online on how to do this.
Also, you will need to add references to two dll files (MySql.Data.MySqlClient & System.Data) that are included in MySQL installation; the paths are:
C:\Program Files\MySQL\MySQL Connector C 6.1.3\lib\vs11
C:\Program Files (x86)\MySQL\MySQL for Visual Studio 1.1.4\Assemblies\v2.0
Follow along @: https://nexusfi.com/elite-automated-trading/35272-mysql-ninjatrader-total-p-l.html
Cheers,
SodyTexas
Category The Elite Circle
|
|
|