NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Educational Resources > Reference Samples

Reference Samples Official NinjaScript reference code samples

Reply
 
Thread Tools Display Modes
Old 03-23-2009, 09:41 AM   #1
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default Strategy: Using User Variables in the Strategy Wizard

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:Import instructions for NinjaTrader 6.5.XXXX.X or greater:
  1. Download the file contained in this thread to your PC desktop
  2. From the Control Center window, select the menu File > Utilities > Import NinjaScript
  3. Select the downloaded file
Attached Files
File Type: zip SampleUserVariables.zip (4.4 KB, 1298 views)
NinjaTrader_Josh is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
User Variables- Ninja wizard latkinso Strategy Development 3 03-17-2012 05:07 PM
User Variables RJay Strategy Development 3 03-14-2009 06:29 PM
Strategy wizard & existing ATM Strategy thepcmd ATM Strategies (Discretionary Trading) 12 05-16-2008 07:15 AM
optimize strategy for user variables darthtrader Suggestions And Feedback 1 04-15-2008 10:06 PM
Strategy: Halting a Strategy Once User Defined Conditions Are Met NinjaTrader_Josh Reference Samples 0 01-04-2008 12:09 AM


All times are GMT -6. The time now is 09:43 AM.