NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Miscellaneous Support

Miscellaneous Support Miscellaneous support issues.

Reply
 
Thread Tools Display Modes
Old 09-19-2011, 05:27 PM   #1
Hawk Arps
Member
 
Join Date: Oct 2008
Location: Lopez Island Washington
Posts: 47
Thanks: 32
Thanked 0 times in 0 posts
Default Alert Sounds

Is there any way to toggle on or off alerts or alert sounds for charting indicators. Is there any way to choose a preferred sound for alerts from charting indicators? If these options must be hardcoded, is there a .wav file for silence?
Hawk Arps is offline  
Reply With Quote
Old 09-20-2011, 03:27 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,566
Thanks: 261
Thanked 1,015 times in 996 posts
Default

Hawk Arps, correct you would need to custom code this into your study either via PlaySound() or Alert() - I believe you could selfrecord a quick .wav with the mic muted and then use it in the indicator.
NinjaTrader_Bertrand is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Bertrand for this post:
Old 09-22-2011, 12:10 PM   #3
Hawk Arps
Member
 
Join Date: Oct 2008
Location: Lopez Island Washington
Posts: 47
Thanks: 32
Thanked 0 times in 0 posts
Default

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?
Hawk Arps is offline  
Reply With Quote
Old 09-22-2011, 12:14 PM   #4
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

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_RyanM; 09-22-2011 at 12:28 PM.
NinjaTrader_RyanM is offline  
Reply With Quote
The following user says thank you to NinjaTrader_RyanM for this post:
Old 09-22-2011, 12:53 PM   #5
Hawk Arps
Member
 
Join Date: Oct 2008
Location: Lopez Island Washington
Posts: 47
Thanks: 32
Thanked 0 times in 0 posts
Default

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?
Hawk Arps is offline  
Reply With Quote
Old 09-22-2011, 01:01 PM   #6
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Yes, there may be a way to do this. We only support declaring enum in the namespace, but some users prefer a different approach. This thread may assist with one alternative approache:
http://www.ninjatrader.com/support/f...ad.php?t=37521
NinjaTrader_RyanM is offline  
Reply With Quote
The following user says thank you to NinjaTrader_RyanM for this post:
Old 09-22-2011, 02:07 PM   #7
koganam
Senior Member
 
Join Date: Feb 2008
Location: Durham, North Carolina, USA
Posts: 3,356
Thanks: 24
Thanked 1,304 times in 1,067 posts
Send a message via Skype™ to koganam
Default

Quote:
Originally Posted by Hawk Arps View Post
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?
You declared your enum in the global namespace. That means it is available to all indicators with no further action. You do not need to declare it again in any other indicator. Just use it.

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.
koganam is offline  
Reply With Quote
The following user says thank you to koganam for this post:
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
No sounds danemo Version 7 Beta General Questions & Bug Reports 6 07-01-2010 05:52 AM
NT alert sounds distorted on new system Billy Valentine Miscellaneous Support 11 08-05-2009 02:17 AM
NT Alert Sounds MXASJ Miscellaneous Support 1 06-06-2009 06:41 AM
Sounds xewoox Automated Trading 1 02-20-2009 07:51 AM
Price Alert Modification for different sounds MicroAl Indicator Development 1 08-27-2008 07:18 AM


All times are GMT -6. The time now is 07:54 AM.