SmartQuant Discussion
http://www.smartquant.com/forums/

Exception in CAD and AD
http://www.smartquant.com/forums/viewtopic.php?f=60&t=10709
Page 1 of 1

Author:  Wajeeha [ Mon Apr 14, 2014 8:26 am ]
Post subject:  Exception in CAD and AD

Hello Support,

I am getting following exception whenever I access CAD or AD indicators. Please advise.

Exception:
Quote:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.Generic.SortedList`2.GetByIndex(Int32 index)
at SmartQuant.Data.MemorySeries`1.get_Item(Int32 index)
at SmartQuant.Series.TimeSeries.get_Item(Int32 index)
at SmartQuant.Series.DoubleSeries.get_Item(Int32 Index)
at SmartQuant.Indicators.Indicator.get_Item(Int32 Index)
at SmartQuant.Indicators.AD.Calculate(Int32 index)
at SmartQuant.Indicators.AD.OnInputItemAdded(Object sender, DateTimeEventArgs EventArgs)
at SmartQuant.Indicators.Indicator.OnInputItemAdded2(Object sender, DateTimeEventArgs EventArgs)
at SmartQuant.Series.ItemAddedEventHandler.Invoke(Object sender, DateTimeEventArgs e)
at SmartQuant.Series.TimeSeries.EmitItemAdded(DateTime dateTime)
at SmartQuant.Series.BarSeries.Add(Bar bar)
at SmartQuant.Instruments.BarSeriesList.nu3ogAtIQh(Instrument , Bar )
at SmartQuant.Instruments.DataManager.itPuRrloC(Object , BarEventArgs )
at SmartQuant.Providers.ProviderManager.FITf8H8Ipj(Object , BarEventArgs )
at SmartQuant.Providers.BarEventHandler.Invoke(Object sender, BarEventArgs args)
at SmartQuant.Simulation.SimulationDataProvider.xp16UUMHjF(Object , BarEventArgs )
at SmartQuant.Providers.BarFactory.BOW1aPpNtM(Bar , IFIXInstrument )
at SmartQuant.Providers.BarFactory.Rn813ovF1f(ReminderEventArgs )
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at SmartQuant.Clock.LxgwO7C7Ux(DateTime )


Code:
Code:
public override void OnStrategyStart()
{
   AD ad = new AD(Bars);
   Draw(ad);
}

Similarly for CAD I am using following lines of code
Code:
Code:
public override void OnStrategyStart()
{
   CAD cad = new CAD(Bars,5,8);
   Draw(cad);
}


Thanks,

Author:  Dr. Anton Fokin [ Tue Apr 15, 2014 8:56 am ]
Post subject:  Re: Exception in CAD and AD

Thanks for pointing out, we are able to reproduce this issue. We will publish an update with fix soon. Please drop us a message if you need these indicators right away and we will send you updated dll.

Regards,
Anton

Author:  Dr. Anton Fokin [ Fri Apr 18, 2014 11:59 am ]
Post subject:  Re: Exception in CAD and AD

Update: this issue should be fixed in the latest release.

Regards,
Anton

Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/