The minimal example I can come up is something like the following code in OnStateChange function (I attached the full indicator code as well):
else if (State == State.Historical) { if (ChartControl != null) { try { foreach (dynamic i in ChartControl.Indicators) { Type t = i.GetType(); Print(t.FullName); } } catch (Exception e) { Print(e.ToString()); } } }
Microsoft.CSharp.RuntimeBinder.RuntimeBinderInternalCompilerException: An unexpected exception occurred while binding a dynamic operation at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.Bind( DynamicMetaObjectBinder payload, IEnumerable`1 parameters, DynamicMetaObject[] args, DynamicMetaObject& deferredBinding) at Microsoft.CSharp.RuntimeBinder.BinderHelper.Bind(DynamicMetaObjectBinder action, RuntimeBinder binder, IEnumerable`1 args, IEnumerable`1 arginfos, DynamicMetaObject onBindingError) at Microsoft.CSharp.RuntimeBinder.CSharpInvokeMemberBinder.FallbackInvokeMember(DynamicMetaObject target, DynamicMetaObject[] args, DynamicMetaObject errorSuggestion) at System.Dynamic.DynamicMetaObject.BindInvokeMember( InvokeMemberBinder binder, DynamicMetaObject[] args) at System.Dynamic.DynamicMetaObjectBinder.Bind(Object[] args, ReadOnlyCollection`1 parameters, LabelTarget returnLabel) at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T](CallSite`1 site, Object[] args) at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) at NinjaTrader.NinjaScript.Indicators.TestIndicator1.OnStateChange()
Ninja Version: 8.0.24.1 64-bit
Comment