Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

any local working example? #18

Open
stanleywu111 opened this issue Jan 31, 2017 · 2 comments
Open

any local working example? #18

stanleywu111 opened this issue Jan 31, 2017 · 2 comments

Comments

@stanleywu111
Copy link

Can I just run the local simulator without all the hassle of database and trading connector configuration? Any example? Thanks!

@alexcwyu
Copy link
Owner

alexcwyu commented Feb 1, 2017

I don't have that yet.

but you can quickly modify the code either in:

  1. algotrader/app/backtest_runner.py
    change to mongo feed to yahoo feed

or

  1. poc/backtest_in_memory.py
    you can construct your pandas datafeed:
    feed = PandasMemoryDataFeed(dict_df, ref_data_mgr=mgr)

method 1 should be easier to you....

@stanleywu111
Copy link
Author

After running backtest_runner.py, I got the following error:

Traceback (most recent call last):
  File "E:/Project/python-trading/algotrader/app/backtest_runner.py", line 77, in <module>
    main()
  File "E:/Project/python-trading/algotrader/app/backtest_runner.py", line 73, in main
    BacktestRunner(True).start(app_context)
  File "E:\Project\python-trading\algotrader\__init__.py", line 22, in start
    self._start(app_context=app_context, **kwargs)
  File "E:\Project\python-trading\algotrader\app\__init__.py", line 10, in _start
    self.run()
  File "E:/Project/python-trading/algotrader/app/backtest_runner.py", line 38, in run
    self.app_context.start()
  File "E:\Project\python-trading\algotrader\__init__.py", line 22, in start
    self._start(app_context=app_context, **kwargs)
  File "E:\Project\python-trading\algotrader\trading\context.py", line 54, in _start
    startable.start(self)
  File "E:\Project\python-trading\algotrader\__init__.py", line 22, in start
    self._start(app_context=app_context, **kwargs)
  File "E:\Project\python-trading\algotrader\strategy\down_2pct_strategy.py", line 23, in _start
    super(Down2PctStrategy, self)._start(app_context, **kwargs)
  File "E:\Project\python-trading\algotrader\strategy\strategy.py", line 92, in _start
    self.app_config.from_date, self.app_config.to_date)
  File "E:\Project\python-trading\algotrader\provider\subscription.py", line 136, in subscript_market_data
    feed.subscribe_mktdata(self.get_subscription_keys(feed.id(), instruments, subscription_types, from_date, to_date))
  File "E:\Project\python-trading\algotrader\provider\subscription.py", line 146, in get_subscription_keys
    keys.append(HistDataSubscriptionKey(inst_id=instrument.inst_id,
AttributeError: 'NoneType' object has no attribute 'inst_id'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants