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

Issue in running Spread_ sample
http://www.smartquant.com/forums/viewtopic.php?f=86&t=14898
Page 1 of 1

Author:  Zell [ Fri Mar 29, 2019 7:24 am ]
Post subject:  Issue in running Spread_ sample

Hi Support Team,

I ran the Spread_ sample in Openquant 2014 in backtest mode and returned below exceptions in the output.

Quote:
Building MyStrategy
03/29/2019 17:02:53.060 Scenario::StartStrategy SpreadTrading in Backtest
InstrumentStrategy_::Subscribe BuySide (AAPL vs MSFT) AAPL vs MSFT
SubscriptionManager::Subscribe OpenQuant.SpreadSellSide AAPL vs MSFT
SellSideStrategy::Connect
SellSideStrategy::Connect
EventManager::OnException Exception occured in EventDispatcher - Group 01/01/0001 00:00:00.000, Id = 2, Name = Bars_AAPL - System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at SmartQuant.Controls.BarChart.GroupItem2..ctor(Group group)
at SmartQuant.Controls.BarChart.BarChart2.OnNewGroup(Group group)
at SmartQuant.GroupDispatcher.yJp1iIQtOQ(IGroupListener , Group )
at SmartQuant.GroupDispatcher.Qb6185hd48(Object , GroupEventAgrs )
at SmartQuant.EventDispatcher.Yur7JEc9oK(Event )
at SmartQuant.EventDispatcher.OnEvent(Event e)
at SmartQuant.EventManager.OnEvent(Event e)
EventManager::OnException Exception occured in EventDispatcher - Group 01/01/0001 00:00:00.000, Id = 3, Name = Fills_AAPL - System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at SmartQuant.Controls.BarChart.GroupItem2..ctor(Group group)
at SmartQuant.Controls.BarChart.BarChart2.OnNewGroup(Group group)
at SmartQuant.GroupDispatcher.yJp1iIQtOQ(IGroupListener , Group )
at SmartQuant.GroupDispatcher.Qb6185hd48(Object , GroupEventAgrs )
at SmartQuant.EventDispatcher.Yur7JEc9oK(Event )
at SmartQuant.EventDispatcher.OnEvent(Event e)
at SmartQuant.EventManager.OnEvent(Event e)
EventManager::OnException Exception occured in EventDispatcher - Group 01/01/0001 00:00:00.000, Id = 4, Name = Bars_MSFT - System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at SmartQuant.Controls.BarChart.GroupItem2..ctor(Group group)
at SmartQuant.Controls.BarChart.BarChart2.OnNewGroup(Group group)
at SmartQuant.GroupDispatcher.yJp1iIQtOQ(IGroupListener , Group )
at SmartQuant.GroupDispatcher.Qb6185hd48(Object , GroupEventAgrs )
at SmartQuant.EventDispatcher.Yur7JEc9oK(Event )
at SmartQuant.EventDispatcher.OnEvent(Event e)
at SmartQuant.EventManager.OnEvent(Event e)
EventManager::OnException Exception occured in EventDispatcher - Group 01/01/0001 00:00:00.000, Id = 5, Name = Fills_MSFT - System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at SmartQuant.Controls.BarChart.GroupItem2..ctor(Group group)
at SmartQuant.Controls.BarChart.BarChart2.OnNewGroup(Group group)
at SmartQuant.GroupDispatcher.yJp1iIQtOQ(IGroupListener , Group )
at SmartQuant.GroupDispatcher.Qb6185hd48(Object , GroupEventAgrs )
at SmartQuant.EventDispatcher.Yur7JEc9oK(Event )
at SmartQuant.EventDispatcher.OnEvent(Event e)
at SmartQuant.EventManager.OnEvent(Event e)
SellSideInstrumentStrategy_::Subscribe SellSide (AAPL vs MSFT) AAPL
SubscriptionManager::Subscribe provider id = 1 DataSimulator (Default data simulator) http://www.smartquant.com AAPL
03/29/2019 17:02:53.173 DataSimulator::Subscribe AAPL
SellSideInstrumentStrategy_::Subscribe SellSide (AAPL vs MSFT) MSFT
SubscriptionManager::Subscribe provider id = 1 DataSimulator (Default data simulator) http://www.smartquant.com MSFT
03/29/2019 17:02:53.222 DataSimulator::Subscribe MSFT
03/29/2019 17:02:53.242 Data simulator thread started
03/29/2019 17:03:00.439 Data simulator thread stopped
03/29/2019 17:03:00.442 Data run done[OpenQuant], count = 9398057 ms = 7163 event/sec = 1312000
03/29/2019 17:03:00.447 Scenario::StartStrategy Done
Objective: 99945.6000000001


After the backtest, I called the Chart(gapless), and then below exception poped up. May I know what goes wrong here? thanks.

Quote:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at SmartQuant.Controls.BarChart.GroupItem2..ctor(Group group)
at SmartQuant.Controls.BarChart.BarChart2.OnNewGroup(Group group)
at SmartQuant.GroupDispatcher.yJp1iIQtOQ(IGroupListener , Group )
at SmartQuant.GroupDispatcher.AddListener(IGroupListener listener)
at SmartQuant.Controls.BarChart.BarChart2.OnInit()
at SmartQuant.Shared.DockWindow.OnInit()
at SmartQuant.Docking.WinForms.DockManager.Open(Type type, Object key, Boolean focus)
at SmartQuant.Docking.WinForms.DockManager.Open(Type type)
at OpenQuant.MainForm.menuView_BarChart2_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


Best,
Zell

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