PDA

View Full Version : Strategy: Using trade performance statistics for money management


NinjaTrader_Josh
11-15-2007, 03:51 PM
Reference sample for NinjaTrader 6.5.XXXX.X or greater.

For money management reasons you may want to limit your strategy from aggressive daytrading or you may want to cut your losses short on volatile sessions that are not playing out in your favor. This can be done through the utilization of the Performance object.

The attached reference sample demonstrates the following concepts:

Locking in realized profits after a certain amount of gains have been achieved during the trading session
Cutting realized losses short after a certain amount of losses have been accrued over the trading session
Preventing aggressive amounts of trading

Important methods and properties include:

Performance (http://www.ninjatrader.com/support/helpGuides/nt7/performance.htm)*
TradesPerformanceValues (http://www.ninjatrader.com/support/helpGuides/nt7/tradesperformancevalues.htm)

* This reference sample uses the .AllTrades property. This property will include all historical virtual trades as well as real-time trades. If you wish to only make calculations based on real-time trades you can use the .RealtimeTrades property.

Other methods and properties of interest include:

Trade (http://www.ninjatrader.com/support/helpGuides/nt7/trade.htm)
TradeCollection (http://www.ninjatrader.com/support/helpGuides/nt7/tradecollection.htm)
TradesPerformance (http://www.ninjatrader.com/support/helpGuides/nt7/tradesperformance.htm)

Import instructions for NinjaTrader 6.5.XXXX.X or greater:

Download the file contained in this thread to your PC desktop
From the Control Center window, select the menu File > Utilities > Import NinjaScript
Select the downloaded file