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 > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 05-15-2007, 12:30 PM   #1
theperm
Junior Member
 
Join Date: Aug 2005
Location: , ,
Posts: 28
Thanks: 0
Thanked 0 times in 0 posts
Default Multi-option drop down parameters

How do i specify multiple options with drop down/combo box type parameter?

Similar to EntryHandling parameter.
theperm is offline  
Reply With Quote
Old 05-15-2007, 12:40 PM   #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
Default

This can be done by declaring an enum within your strategy. If you are not familiar with this C# concept I would suggest leaving it for now. This is outside of what we support however, I will provide sample code on how this can be done in the near future.
NinjaTrader_Ray is offline  
Reply With Quote
Old 05-15-2007, 02:48 PM   #3
theperm
Junior Member
 
Join Date: Aug 2005
Location: , ,
Posts: 28
Thanks: 0
Thanked 0 times in 0 posts
Default

Excellent, I'm familiar with it.

heres an example for anyone else
Code:
public enum PosTypes {Long, Short} // be sure to make this public

PosTypes posType = PosTypes.Long;

        [Description("Pos Type")]
        [Category("Parameters")]
        public PosTypes PosType
        {
            get { return posType; }
            set { posType = value }
        }
theperm is offline  
Reply With Quote
Old 05-15-2007, 11:51 PM   #4
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

FYI: There already is an equivalent NT enum: NinjaTrader.Cbi.MarketPosition.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 05-16-2007, 03:36 AM   #5
theperm
Junior Member
 
Join Date: Aug 2005
Location: , ,
Posts: 28
Thanks: 0
Thanked 0 times in 0 posts
Default

I know, bad example on my part, i just pulled it out of thin air.
theperm is offline  
Reply With Quote
Old 08-17-2010, 05:17 AM   #6
J_o_s
Senior Member
 
Join Date: Aug 2008
Location: Netherlands
Posts: 159
Thanks: 17
Thanked 5 times in 5 posts
Default

Quote:
Originally Posted by NinjaTrader_Dierk View Post
FYI: There already is an equivalent NT enum: NinjaTrader.Cbi.MarketPosition.
Hm, that's interesting. Is there also such a class for relational operators? (<,>,>=,etc)

I was just wondering, because I'm making an indicator, and would like to include a drop-down menu with various relational operators so that the user can choose how the condition should be tested. For example with such an drop-down menu it would be possible for the user to choose between 'Variable1 > Variable2' condition and the 'Variable1 < Variable2' condition.

How can I achieve such a feature with enums? (or perhaps a different way?)

Any thoughts are highly appreciated

Regards,
J_o_s is offline  
Reply With Quote
Old 08-17-2010, 12:18 PM   #7
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

J_o_s, I'm not aware of one for relational operators, I would suggest you create an enum case for either scenario you would need to express your potential conditions.
NinjaTrader_Bertrand 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
Chart - fixed price scale option MJT Suggestions And Feedback 5 04-26-2009 08:44 AM
Range Bar Option for Charting DavidJNowak Charting 22 08-03-2007 08:32 AM
Parameters - drop down selection? rtrader General Programming 4 04-11-2007 04:53 AM
NT6 Drop down menu-data series LG Charting 4 11-27-2006 01:05 PM
Multi strategies, multi superDOM windows N40K Miscellaneous Support 1 12-20-2004 01:51 AM


All times are GMT -6. The time now is 07:53 PM.