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 Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 04-11-2007, 12:27 AM   #1
rtrader
Member
 
Join Date: Mar 2007
Location: London, UK
Posts: 61
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

Can an indicator/strategyparameter have a drop down selection box applied to it? eg for True/False or multiple values.

If so could someone post a code snippet? If not could it be added to the suggestions list?

Thanks.


rtrader is offline  
Reply With Quote
Old 04-11-2007, 01:20 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Post imported post

Yes this is possible.

Please look at the PriorDayOHLC indicator source. Take a look at the following:

Quote:
Under variables:

showOpen

Under properties:

ShowOpen
Ray
NinjaTrader_Ray is offline  
Reply With Quote
Old 04-11-2007, 01:30 AM   #3
rtrader
Member
 
Join Date: Mar 2007
Location: London, UK
Posts: 61
Thanks: 0
Thanked 0 times in 0 posts
Post imported post

Thanks Ray.

I see it is possiblewith bool True/False. Can one specify multiple values - eg multiple strings or numbers?

eg "PlotBasedOn"

"Close" or

"(H+L) / 2" or

"(O+H+L+C) / 4"






rtrader is offline  
Reply With Quote
Old 04-11-2007, 01:37 AM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Post imported post

Yes but I do not have code samples to provide you.

If you want to choose between plots in Initialize() set:

PriceTypeSupported = true;

This will allow you to select in the indicator dialog when adding to a chart, either OHLC, Median or Typical price types, like the Simple Moving Average indicator.

Then in your indicator code, where you want to reference the actual plot, use:

Input[0] as opposed to Open[0] or Close[0].
"Input" will always reference the price type you selected.

See the SMA indicator source for an example.

Ray
NinjaTrader_Ray is offline  
Reply With Quote
Old 04-11-2007, 04:53 AM   #5
whitmark
Certified NinjaScript Consultant
 
Join Date: Nov 2005
Location: Virginia, USA
Posts: 441
Thanks: 0
Thanked 12 times in 7 posts
Send a message via Skype™ to whitmark
Post imported post

I think the question has more to do with defining an enumerated list or type (or similar concept) and making itavailable in a parameter pulldown list to suggest predfined inputs.For example:

Exponential, Simple, Hull

7, 14, 21

1.0, 1.5, 2.5

1- Conservative, 2-Moderate, 3-Aggressive

I see there are preexisting Color and PriceTypes available but what about the ability to define other customized lists. An example set of code for this simplistic type of input would be helpful.

Regards,

Whitmark
whitmark 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


All times are GMT -6. The time now is 04:35 AM.