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

Downloading historical data in CTA backtesting module does not work #4

Open
chiefirr opened this issue Oct 7, 2019 · 2 comments
Open
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@chiefirr
Copy link

chiefirr commented Oct 7, 2019

I am trying to run backtesting module, using GUI. But when I select default IF88.CEFEX ticker - it fails to find the data, Same is for AAPL.NYMEX.

- 09:18:34	initialization CTA backtesting engine
- 09:18:34	strategy file loaded  
- 09:18:50	----------------------------------------  
- 09:18:50	IF88.CFFEX-1m start downloading historical data  
- 09:18:50	 data download failed , unable to get IF88.CFFEX historical data 
- 09:19:13	----------------------------------------  
- 09:19:13	AAPL.NYMEX-1m start downloading historical data 
- 09:23:40	 data download failed , unable to get AAPL.NYMEX historical data 

I am using Alpaca paper trading brocker. What is a proper way to fetch the data for selected stock and to start backtesting?

@day0market day0market added the help wanted Extra attention is needed label Oct 7, 2019
@day0market
Copy link
Owner

Note: I didn't test it with Alpaca.

You should specify symbol in following format: {ticker}.{gatewayname}. In case of AAPL and Alpaca symbol would be AAPL.ALPACA

Also make sure you're connected to Alpaca. If not go to main window -> system -> Alpaca, add your creds and connect

@day0market day0market added the good first issue Good for newcomers label Oct 8, 2019
@chiefirr
Copy link
Author

chiefirr commented Oct 8, 2019

Yeah, I have connected to Alpaca and did as you said AAPL.ALPACA - it results with error in a console:

-   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
-     self.run()
-   File "/usr/lib/python3.7/threading.py", line 865, in run
-     self._target(*self._args, **self._kwargs)
-   File "/home/andrii/PycharmProjects/ch-trading-platform/venv/lib/python3.7/site-packages/pyalgotrader-2.0.7-py3.7.egg/vnpy/app/cta_backtester/engine.py", line 345, in run_downloading
-     symbol, exchange = extract_vt_symbol(vt_symbol)
-   File "/home/andrii/PycharmProjects/ch-trading-platform/venv/lib/python3.7/site-packages/pyalgotrader-2.0.7-py3.7.egg/vnpy/trader/utility.py", line 22, in extract_vt_symbol
-     return symbol, Exchange(exchange_str)
-   File "/usr/lib/python3.7/enum.py", line 310, in __call__
-     return cls.__new__(cls, value)
-   File "/usr/lib/python3.7/enum.py", line 564, in __new__
-     raise exc
-   File "/usr/lib/python3.7/enum.py", line 548, in __new__
-     result = cls._missing_(value)
-   File "/usr/lib/python3.7/enum.py", line 577, in _missing_
-     raise ValueError("%r is not a valid %s" % (value, cls.__name__))
- ValueError: 'ALPACA' is not a valid Exchange

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants