![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Aug 2005
Location: , ,
Posts: 28
Thanks: 0
Thanked 0 times in 0 posts
|
How do i specify multiple options with drop down/combo box type parameter?
Similar to EntryHandling parameter. |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
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.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Aug 2005
Location: , ,
Posts: 28
Thanks: 0
Thanked 0 times in 0 posts
|
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 }
}
|
|
|
|
|
|
#4 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
FYI: There already is an equivalent NT enum: NinjaTrader.Cbi.MarketPosition.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Aug 2005
Location: , ,
Posts: 28
Thanks: 0
Thanked 0 times in 0 posts
|
I know, bad example on my part, i just pulled it out of thin air.
|
|
|
|
|
|
#6 | |
|
Senior Member
Join Date: Aug 2008
Location: Netherlands
Posts: 159
Thanks: 17
Thanked 5 times in 5 posts
|
Quote:
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, |
|
|
|
|
|
|
#7 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
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.
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |