chrism2671 / PyTrendFollow

PyTrendFollow - systematic futures trading using trend following
MIT License
362 stars 70 forks source link

`contract_format()` opaque error #14

Closed JoaoAparicio closed 6 years ago

JoaoAparicio commented 6 years ago

i['cocoa'].contract_format(199309)

returns


AttributeError                            Traceback (most recent call last)
<ipython-input-78-d8ecb233dd15> in <module>()
----> 1 i['cocoa'].contract_format(199309)

~/PyTrendFollow/core/instrument.py in contract_format(self, contract)
    236         """
    237         year, month = contract_to_tuple(contract)
--> 238         if self.contract_name_format == 'cbot':
    239             return self.quandl_symbol + cbot_month_code(month) + str(year)
    240         else:

AttributeError: 'Instrument' object has no attribute 'contract_name_format'```