NinjaTrader_Josh
03-23-2009, 10:41 AM
Reference sample for NinjaTrader 6.5.XXXX.X or greater.
User Variables are very useful for storing values you may want to recall in the future. Another use for User Variables is having it store information that allows you to create conditions that must be executed in a specific sequence. In this example, the strategy will only take trades as the fast period SMA crosses above a slow period SMA and then a normal period SMA.
The attached reference sample demonstrates the following concepts:
Setting an User Variable
Checking an User Variable for a value
Using separate Sets for conditions and actions
Creating a sequence of conditions before trading
Important conditions and actions include:
CrossAbove (http://www.ninjatrader.com/support/helpGuides/nt7/crossabove.htm)
Numeric value (http://www.ninjatrader.com/support/helpGuides/nt7/condition_builder.htm)
Set user defined variable (http://www.ninjatrader.com/support/helpGuides/nt7/strategy_actions.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
User Variables are very useful for storing values you may want to recall in the future. Another use for User Variables is having it store information that allows you to create conditions that must be executed in a specific sequence. In this example, the strategy will only take trades as the fast period SMA crosses above a slow period SMA and then a normal period SMA.
The attached reference sample demonstrates the following concepts:
Setting an User Variable
Checking an User Variable for a value
Using separate Sets for conditions and actions
Creating a sequence of conditions before trading
Important conditions and actions include:
CrossAbove (http://www.ninjatrader.com/support/helpGuides/nt7/crossabove.htm)
Numeric value (http://www.ninjatrader.com/support/helpGuides/nt7/condition_builder.htm)
Set user defined variable (http://www.ninjatrader.com/support/helpGuides/nt7/strategy_actions.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