jkbrzt / cointrol

฿ Bitcoin trading bot with a real-time dashboard for Bitstamp.
https://twitter.com/jakubroztocil
MIT License
1.45k stars 290 forks source link

cointrol-trader error #3

Closed DimaVIII closed 6 years ago

DimaVIII commented 7 years ago

Hello,

if I'm starting cointrol-trader, I'm getting following error, what doses this mean?

[2017-03-11 23:53:50,022 E] cointrol.trader.workers.Ticker: work failed
Traceback (most recent call last):
  File "/root/bitcoin/Cointrol/cointrol/cointrol/trader/workers.py", line 68, in run_forever
    result = yield self.work()
  File "/root/bitcoin/Cointrol/virtualenv/lib/python3.4/site-packages/tornado/gen.py", line 807, in run
    value = future.result()
  File "/root/bitcoin/Cointrol/virtualenv/lib/python3.4/site-packages/tornado/concurrent.py", line 209, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 3, in raise_exc_info
  File "/root/bitcoin/Cointrol/virtualenv/lib/python3.4/site-packages/tornado/gen.py", line 810, in run
    yielded = self.gen.throw(*sys.exc_info())
  File "/root/bitcoin/Cointrol/cointrol/cointrol/trader/workers.py", line 391, in work
    ticker = yield Task(bitstamp_client.ticker)
  File "/root/bitcoin/Cointrol/virtualenv/lib/python3.4/site-packages/tornado/gen.py", line 807, in run
    value = future.result()
  File "/root/bitcoin/Cointrol/virtualenv/lib/python3.4/site-packages/tornado/concurrent.py", line 209, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 3, in raise_exc_info
  File "/root/bitcoin/Cointrol/virtualenv/lib/python3.4/site-packages/tornado/stack_context.py", line 314, in wrapped
    ret = fn(*args, **kwargs)
  File "/root/bitcoin/Cointrol/cointrol/cointrol/trader/bitstamp.py", line 212, in <lambda>
    resp, model_class))
  File "/root/bitcoin/Cointrol/cointrol/cointrol/trader/bitstamp.py", line 250, in _process_response
    data = model_class(data)
  File "/root/bitcoin/Cointrol/cointrol/cointrol/trader/bitstamp.py", line 72, in __init__
    raise ValueError('%s unknown field: %r' % (type(self), key))
ValueError: <class 'cointrol.trader.bitstamp.Ticker'> unknown field: 'open'
will try again
jkbrzt commented 7 years ago

Hi @DimaVIII, this means the Bitstamp API has changed. They've added a new field (open) to the ticker.

I currently don't have an API key to test it, but it should be easy to fix by yourself:

  1. . virtualenv/bin/activate

  2. Add the open field to the Ticker model class:

        open = PriceField()
  3. Make a DB migration file:

    ./manage.py makemigrations
  4. Run the migration on your DB:

    ./manage.py migrate
  5. Try to run the cointrol-trader again.

  6. If there are more unknown field errors, repeat the process.

  7. Open a pull request with your changes.

lorrp1 commented 7 years ago

hi, i have not understood, has cointrol a built-in trading strategy?

BubaVV commented 6 years ago

You also need to edit trader/bitstamp.py:

class Ticker(Model):
...
'open' : Decimal,
}