Auquan / quant-quest-2

Quant Quest 2
3 stars 47 forks source link

backtester/dataSource/data_source_utils.py isn't python3 compatible #2

Open Parth-Vader opened 6 years ago

Parth-Vader commented 6 years ago

I'm a participant for Quant Quest, and had installed the auquan_toolbox in a python3 environment, as well as the trainingTest_params.py file. By python trainingTest_params.py, the call trace is as follows:-

Traceback (most recent call last):
  File "trainingTest_params.py", line 320, in <module>
    tradingSystem = TradingSystem(tsParams)
  File "/home/parth/Codes/auquan/venv/lib/python3.5/site-packages/backtester/trading_system.py", line 35, in __init__
    self.dataParser = self.tsParams.getDataParser()
  File "trainingTest_params.py", line 202, in getDataParser
    event='history')
  File "/home/parth/Codes/auquan/venv/lib/python3.5/site-packages/backtester/dataSource/yahoo_data_source.py", line 125, in __init__
    self.__groupedInstrumentUpdates = self.getGroupedInstrumentUpdates()
  File "/home/parth/Codes/auquan/venv/lib/python3.5/site-packages/backtester/dataSource/yahoo_data_source.py", line 145, in getGroupedInstrumentUpdates
    if not downloadFileFromYahoo(self.startDate, self.endDate, instrumentId, fileName):
  File "/home/parth/Codes/auquan/venv/lib/python3.5/site-packages/backtester/dataSource/data_source_utils.py", line 37, in downloadFileFromYahoo
    f.write(data.content)
TypeError: write() argument must be str, not bytes

This should have been mentioned here. Thanks :smile:

TeamAuquan commented 6 years ago

Thanks for pointing this. seems this got broken in the last refactoring. Please use with Python 2.7 for now