Debug error in the dual moving average analyze function

56 views
Skip to first unread message

lsyi...@gmail.com

unread,
Aug 14, 2015, 9:37:46 AM8/14/15
to Zipline Python Opensource Backtester
Hi there

I am trying to run the dual moving average example in zipline with the analyze function in the example as well. If I launch the script from command line, everything is OK. However, if I try to run the scrip in VS2015 or Wing IDE, I got the same error message below. Now, if I use Spyder IDE that comes with Anaconda, everything is OK again. I am not sure what is going on there, any thoughts would appreciated !

File "d:\Research Programming\Finance\ZiplineCode\ZiplineCode\run_algo.py", line 24, in <module>
  run_pipeline(print_algo=True, **parsed)
File "C:\Anaconda\Lib\site-packages\zipline\utils\cli.py", line 192, in run_pipeline
  perf = algo.run(source)
File "C:\Anaconda\Lib\site-packages\zipline\algorithm.py", line 429, in run
  self.analyze(daily_stats)
File "C:\Anaconda\Lib\site-packages\zipline\algorithm.py", line 233, in analyze
  self._analyze(self, perf)
File "d:\Research Programming\Finance\ZiplineCode\ZiplineCode\<string>", line 57, in analyze
File "C:\Anaconda\Lib\site-packages\pandas\core\frame.py", line 1678, in __getitem__
  return self._getitem_column(key)
File "C:\Anaconda\Lib\site-packages\pandas\core\frame.py", line 1685, in _getitem_column
  return self._get_item_cache(key)
File "C:\Anaconda\Lib\site-packages\pandas\core\generic.py", line 1052, in _get_item_cache
  values = self._data.get(item)
File "C:\Anaconda\Lib\site-packages\pandas\core\internals.py", line 2565, in get
  loc = self.items.get_loc(item)
File "C:\Anaconda\Lib\site-packages\pandas\core\index.py", line 1181, in get_loc
  return self._engine.get_loc(_values_from_object(key))
File "C:\Anaconda\Lib\site-packages\pandas\index.pyd", line 129, in pandas.index.IndexEngine.get_loc (pandas\index.c:3656)
File "C:\Anaconda\Lib\site-packages\pandas\index.pyd", line 149, in pandas.index.IndexEngine.get_loc (pandas\index.c:3534)
File "C:\Anaconda\Lib\site-packages\pandas\hashtable.pyd", line 696, in pandas.hashtable.PyObjectHashTable.get_item (pandas\hashtable.c:11911)
File "C:\Anaconda\Lib\site-packages\pandas\hashtable.pyd", line 704, in pandas.hashtable.PyObjectHashTable.get_item (pandas\hashtable.c:11864)

KeyError: 'AAPL'
Reply all
Reply to author
Forward
0 new messages