PDA

View Full Version : SoundLocationEditor


DayTrader_Cam
03-18-2009, 03:24 AM
NinjaTrader MarketAnalyzer AlertConditions have a property for specifying a sound file for alerts. This is a string value but in the property grid shows as a 'browsable file value', this is implemented through a 'SoundLocationEditor' attribute decorating the property, the code is shown below...


[Editor (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System:2.0.0.0:b77a5c561934e089/System.ComponentModel.EditorAttribute/.ctor(System.Type,System.Type))(typeof(SoundLocati onEditor (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://NinjaTrader.Core:6.5.1000.7/NinjaTrader.Gui.Design.SoundLocationEditor)), typeof(UITypeEditor (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Drawing:2.0.0.0:b03f5f7f11d50a3a/System.Drawing.Design.UITypeEditor))), Description (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System:2.0.0.0:b77a5c561934e089/System.ComponentModel.DescriptionAttribute/.ctor(String))("Sound file."), DisplayName (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://NinjaTrader.Core:6.5.1000.7/NinjaTrader.Gui.Design.DisplayNameAttribute/.ctor(String))("Sound file"), Category (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System:2.0.0.0:b77a5c561934e089/System.ComponentModel.CategoryAttribute/.ctor(String))("Alert")]
public string (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String) SoundLocation (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://NinjaTrader.Core:6.5.1000.7/NinjaTrader.MarketAnalyzer.AlertCondition/property:SoundLocation:String)
{
get { return _soundLocation; }
set { _soundLocation = value }
}

Can you tell me if / how this same style can be implement on a NinjaTrader custom indicator, I'm unable to find the right references / using statements?

NinjaTrader_Bertrand
03-18-2009, 03:32 AM
Unfortunately this is not supported, but you could use Alert() or PlaySound() for this -

http://www.ninjatrader-support.com/HelpGuideV6/Alert.html

http://www.ninjatrader-support.com/HelpGuideV6/PlaySound.html

MicroAl
03-27-2009, 05:34 PM
I modified the price alert indicator so that I could use a drop down box to
select various sound files. I achieved this through an enumeration and switch and case statements. Its messy but it works.

It would be very helpful if we could browse and select a sound file for an alert in the manner described below, ie through a menu rather than custom programming. Perhaps this feature could be added in a later version of Ninja.

NinjaTrader_Kyle
03-27-2009, 06:22 PM
Hello MicroAl,

Thank you for your post.

I will forward your suggestion on to development for further consideration.