Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Alert Sounds
Collapse
X
-
I have been able to create an alert toggle with drop down menu for alert sounds within the input parameters.Hooray! However, I want to be able to do this to several indicators.... when I repeat the process for the second, third, etc... indicators I get a compile error message stating that my enum AlertSound {} already exists in the global namespace... yet it doesn't work in the second,third indicators. Is there a way to repeat this process for many indicators without changing the name of the enum AlertSound { } for every indicator?
Comment
-
Hello Hawk Arps,
Enums can only be declared once per namespace. Once declared (use Public for enums), you can have access to them from any other script.Last edited by NinjaTrader_RyanM1; 09-22-2011, 12:28 PM.Ryan M.NinjaTrader Customer Service
Comment
-
In order to have many indicators access my public enum AlertSond {} without tying it to any one indicator in particular I have tried to place it in my User Defined Methods folder. However, the indicators do not seem to be able to find it there. Is there a generic way of creating an enum {} without tying to one particular indicator?
Comment
-
Originally posted by Hawk Arps View PostI have been able to create an alert toggle with drop down menu for alert sounds within the input parameters.Hooray! However, I want to be able to do this to several indicators.... when I repeat the process for the second, third, etc... indicators I get a compile error message stating that my enum AlertSound {} already exists in the global namespace... yet it doesn't work in the second,third indicators. Is there a way to repeat this process for many indicators without changing the name of the enum AlertSound { } for every indicator?
Of course, if you do use the enum in any other indicator, it means that the file in which you declared the enum must be present in the assembly, or all the other indicators will scream "bloody murder". That means that you must give the declaration file also to any other user to whom you give the indicator, and also on any computer on which you use any of the indicators. Now you know at least one of the reasons why declaring anything in the global namespace is a bad thing.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by DJ888, Today, 10:57 PM
|
0 responses
1 view
0 likes
|
Last Post
by DJ888
Today, 10:57 PM
|
||
Started by MacDad, 02-25-2024, 11:48 PM
|
7 responses
158 views
0 likes
|
Last Post Today, 10:23 PM | ||
Started by Belfortbucks, Today, 09:29 PM
|
0 responses
7 views
0 likes
|
Last Post
by Belfortbucks
Today, 09:29 PM
|
||
Started by zstheorist, Today, 07:52 PM
|
0 responses
7 views
0 likes
|
Last Post
by zstheorist
Today, 07:52 PM
|
||
Started by pmachiraju, 11-01-2023, 04:46 AM
|
8 responses
151 views
0 likes
|
Last Post
by rehmans
Today, 06:44 PM
|
Comment