Error compiling export assembly : error CS0234: The type or namespace name 'SoundConverter' does not exist in the namespace 'NinjaTrader.NinjaScript.Indicators' (are you missing an assembly reference?)
I added this class with a custom name (SoundConverter_HammerCandlesticks) to the indicator:
// using System.IO; https://forum.ninjatrader.com/forum/ninjatrader-8/indicator-development/1172753-sound-files-dropdown-picker?p=1172766#post1172766 public class SoundConverter_HammerCandlesticks : TypeConverter { public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { if (context == null) { return null; } //List <string> list; List <string> list = new List <string> (); DirectoryInfo dir = new DirectoryInfo(NinjaTrader.Core.Globals.InstallDir+ "sounds"); FileInfo[] files= dir.GetFiles("*.wav"); foreach (FileInfo file in files) { list.Add(file.Name); } return new TypeConverter.StandardValuesCollection(list); } public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; } }
[NinjaScriptProperty] [Display(Name="Inverted Hammer Sound", Order=2, GroupName="01. Select Sound")] [TypeConverter(typeof(NinjaTrader.NinjaScript.Indicators.SoundConverter))] public string SoundFilesIHBrush {get;set;}
I also have it in other indicators with other custom class names and those also do throw the same error when trying exporting them.
I add the class to each indicator requiring it so as not to need looking for it years later.
How can this indicator be exported without the compile error problem?
Comment