NinjaTrader_Josh
08-03-2009, 08:26 AM
Reference sample for NinjaTrader 6.5.xxxx.x or greater.
Trending days or ranging days can make or break a strategy. If you have a system that does extremely well on trending days, you may look for a way to turn that system off during range-bound days. A simple filter you may use could be something like, "If the last three trades were consecutive losers, stop trading for the rest of the session."
This reference sample demonstrates the following concepts:
Obtaining previous trade information to decide whether or not to keep trading for the day
Important methods and properties used include:
Performance (http://www.ninjatrader.com/support/helpGuides/nt7/performance.htm)
Trade class (http://www.ninjatrader.com/support/helpGuides/nt7/trade.htm)
TradeCollection class (http://www.ninjatrader.com/support/helpGuides/nt7/tradecollection.htm)
Other methods and properties of interest include:
EnterLong() (http://www.ninjatrader.com/support/helpGuides/nt7/enterlong.htm)
ExitLong() (http://www.ninjatrader.com/support/helpGuides/nt7/exitlong.htm)
FirstBarOfSession (http://www.ninjatrader.com/support/helpGuides/nt7/firstbarofsession.htm)
FirstTickOfBar (http://www.ninjatrader.com/support/helpGuides/nt7/firsttickofbar.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
Trending days or ranging days can make or break a strategy. If you have a system that does extremely well on trending days, you may look for a way to turn that system off during range-bound days. A simple filter you may use could be something like, "If the last three trades were consecutive losers, stop trading for the rest of the session."
This reference sample demonstrates the following concepts:
Obtaining previous trade information to decide whether or not to keep trading for the day
Important methods and properties used include:
Performance (http://www.ninjatrader.com/support/helpGuides/nt7/performance.htm)
Trade class (http://www.ninjatrader.com/support/helpGuides/nt7/trade.htm)
TradeCollection class (http://www.ninjatrader.com/support/helpGuides/nt7/tradecollection.htm)
Other methods and properties of interest include:
EnterLong() (http://www.ninjatrader.com/support/helpGuides/nt7/enterlong.htm)
ExitLong() (http://www.ninjatrader.com/support/helpGuides/nt7/exitlong.htm)
FirstBarOfSession (http://www.ninjatrader.com/support/helpGuides/nt7/firstbarofsession.htm)
FirstTickOfBar (http://www.ninjatrader.com/support/helpGuides/nt7/firsttickofbar.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