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 09-24-2007, 09:12 PM   #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 Indicator: Creating a user-defined parameter type (enum)

Creating user-defined parameters allows you to present the user with hard coded options they can choose. These options provide flexibility in your indicators and can be of value to the user if they like to switch settings often.

The attached reference sample demonstrates the following key concepts:
  • Hard code various Moving Average types the user can select
  • Use a switch to determine which code logic is executed based on the Moving Average type selected
Important methods and properties used include:Import instructions:
  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 SampleUniversalMovingAverage.zip (8.6 KB, 1475 views)
NinjaTrader_Josh is offline  
Reply With Quote
The following 4 users say thank you to NinjaTrader_Josh for this post:
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
Creating parameters for user input NinjaTrader_Josh Indicator Development 13 08-12-2010 02:47 AM
Swing Indicator Strength parameter Kardinal Charting 1 07-06-2007 09:10 AM
Maximum number of user defined inputs Folls Indicator Development 1 05-03-2007 07:58 AM
Problem creating Indicator nicko9 Indicator Development 2 02-22-2007 01:52 AM
Problem with 'Parameter Type' set to Price codeye Miscellaneous Support 5 12-09-2005 07:06 AM


All times are GMT -6. The time now is 12:19 AM.