The scenario is to select days of week for trading.
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Multi-select enum
Collapse
X
-
Multi-select enum
Anyone has sample code for Multi-select enum? Simply adding [flag] before the enum definition doesn't work (Strategy only shows dropdown for single value selection). I know it's possible to create a type converter to do it, but what to know if there an existing way to do it.
The scenario is to select days of week for trading.Tags: None
-
Hello FutureDragon,
I am not aware of a multi-select enum available in C#.
You could use a collection editor instead.
https://ninjatrader.com/support/help...r_to_custo.htmChelsea B.NinjaTrader Customer Service
-
Chelsea, thanks for the reply. It looks the enum editor in the strategy analyzer is exactly what I want. I am wondering if it's accessible from custom strategy.
Comment
-
NinjaTrader_ChrisL, here is the screen shot from the Strategy Analyzer, Optimization Settings:
This exactly the multi-select enum UI I was referring to. It can greatly simply coding: 1 single enum can replace 9 bool's. I guess there is a PropertyEditor or TypeConverter in the Strategy Analyzer, and it will be great you can look into it and see if it's OK to use it for custom strategy development.
Comment
-
Hi, thanks for pointing that out. This is a custom control in the strategy analyzer that has special code-behind that makes it work. Enums only have one selected value at one time, so you will need to use the first example linked by Chealsea to make something similar with boolean variables.Chris L.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by anton_tymoshchuk, Yesterday, 01:43 AM
|
4 responses
69 views
0 likes
|
Last Post
by jeronymite
Today, 05:25 PM
|
||
Started by trader24211341, 03-09-2023, 12:30 PM
|
2 responses
35 views
0 likes
|
Last Post
![]() |
||
Started by ct, Today, 04:56 PM
|
0 responses
3 views
0 likes
|
Last Post
![]()
by ct
Today, 04:56 PM
|
||
Started by qewcool, 03-19-2023, 05:51 PM
|
24 responses
207 views
1 like
|
Last Post
![]()
by jama12
Today, 04:43 PM
|
||
Started by GussJ, Today, 07:43 AM
|
3 responses
40 views
0 likes
|
Last Post
![]()
by GussJ
Today, 04:37 PM
|
Comment