Key concepts in this example:
- Obtaining previous trade information to decide whether or not to keep trading for the day
Important related documentation:
NinjaTrader 8
- SystemPerformance
- TradeCollection
- AllTrades*
- EnterLong()
- ExitLong()
- IsFirstBarOfSession
- IsFirstTickOfBar
* 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.
NinjaTrader 7
- Performance
- Trade class
- TradeCollection class
- EnterLong()
- ExitLong()
- FirstBarOfSession
- FirstTickOfBar
Import instructions:
NinjaTrader 8
- Download the file contained in this thread to your PC desktop
- From the Control Center window, select the menu Tools > Import > NinjaScript
- Select the downloaded file
NinjaTrader 7
- 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 and click Import.