I would like to use the SmartQuant.IB.dll in my strategy so that I can do something like this:
ITBWS ibtws = (IBTWS)ProviderManager.GetProvider("IB") ibtws.Host = "10.1.2.14" ibtws.Port = 3124 ibtws.WhatToShow = "BID"
I need to set these properties dynamically, so setting them manually from the GUI is not an option. However QuantTrader's reference and my strategies reference to SmartQuant.IB.dll are different, so this exception is thrown. What can I do?
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: [A]SmartQuant.IB.IBTWS cannot be cast to [B]SmartQuant.IB.IBTWS. Type A originates from 'SmartQuant.IB, Version=1.0.7026.31158, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'C:\Program Files\SmartQuant Ltd\QuantTrader 2014\SmartQuant.IB.dll'. Type B originates from 'SmartQuant.IB, Version=1.0.7026.31158, Culture=neutral, PublicKeyToken=null' in the context 'LoadFrom' at location 'C:\Users\Quant\Documents\QuantTrader 2014\Packages\MyStrategy!\MyStrategy\SmartQuant.IB.dll'. at OpenQuant.RealTime.Run() at OpenQuant.Program.Main(String[] args) --- 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 QuantTrader.SolutionRunner.Run(Object obj)
|