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

Unable to create trade error #108

Closed
phacts opened this issue Nov 16, 2017 · 2 comments
Closed

Unable to create trade error #108

phacts opened this issue Nov 16, 2017 · 2 comments
Labels

Comments

@phacts
Copy link

phacts commented Nov 16, 2017

I've recently updated with the develop branch (about two hours ago), as a number of the issues I found last night have already been fixed. Everything has been running smoothly, including a full trade. This is all in with "dry_run": true set in my config.

After identifying a trade of BTC-XRP, I'm seeing an error repeated twice in the console:

2017-11-15 21:24:28,211 - freqtrade - INFO - Checking buy signals to create a new trade with stake_amount: 0.050000 ...
2017-11-15 21:26:16,135 - freqtrade - ERROR - Unable to create trade
Traceback (most recent call last):
  File "./freqtrade/main.py", line 70, in _process
    trade = create_trade(float(_CONF['stake_amount']))
  File "./freqtrade/main.py", line 223, in create_trade
    if get_buy_signal(_pair):
  File "/Users/sgrimm/dev/cryptos/bots/freqtrade/freqtrade/analyze.py", line 99, in get_buy_signal
    dataframe = analyze_ticker(pair)
  File "/Users/sgrimm/dev/cryptos/bots/freqtrade/freqtrade/analyze.py", line 82, in analyze_ticker
    ticker_hist = get_ticker_history(pair)
  File "/Users/sgrimm/dev/cryptos/bots/freqtrade/.env/lib/python3.6/site-packages/cachetools/__init__.py", line 46, in wrapper
    v = func(*args, **kwargs)
  File "/Users/sgrimm/dev/cryptos/bots/freqtrade/freqtrade/exchange/__init__.py", line 133, in get_ticker_history
    return _API.get_ticker_history(pair, tick_interval)
  File "/Users/sgrimm/dev/cryptos/bots/freqtrade/freqtrade/exchange/bittrex.py", line 103, in get_ticker_history
    data = _API_V2.get_candles(pair.replace('_', '-'), interval)
  File "/Users/sgrimm/dev/cryptos/bots/freqtrade/.env/src/python-bittrex/bittrex/bittrex.py", line 794, in get_candles
    }, protection=PROTECTION_PUB)
  File "/Users/sgrimm/dev/cryptos/bots/freqtrade/.env/src/python-bittrex/bittrex/bittrex.py", line 154, in _api_query
    return self.dispatch(request_url, apisign)
  File "/Users/sgrimm/dev/cryptos/bots/freqtrade/.env/src/python-bittrex/bittrex/bittrex.py", line 77, in using_requests
    headers={"apisign": apisign}
  File "/Users/sgrimm/dev/cryptos/bots/freqtrade/.env/lib/python3.6/site-packages/requests/models.py", line 892, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2017-11-15 21:26:16,346 - freqtrade - INFO - Checking buy signals to create a new trade with stake_amount: 0.050000 ...
2017-11-15 21:26:23,034 - freqtrade - INFO - *BITTREX:* Buying [BTC/XRP](https://www.bittrex.com/Market/Index?MarketName=BTC-XRP) with limit `0.00002919`
2017-11-15 21:26:26,300 - freqtrade - INFO - Checking buy signals to create a new trade with stake_amount: 0.050000 ...
2017-11-15 21:26:35,587 - freqtrade - INFO - Checked all whitelisted currencies. Found no suitable entry positions for buying. Will keep looking ...
2017-11-15 21:26:35,588 - freqtrade - INFO - Got open order for Trade(id=2, pair=BTC_XRP, amount=1708.63309352518, open_rate=2.919e-05, open_since=seconds ago)
2017-11-15 21:26:36,344 - freqtrade - INFO - Checking buy signals to create a new trade with stake_amount: 0.050000 ...
2017-11-15 21:26:36,974 - freqtrade - INFO - Checked all whitelisted currencies. Found no suitable entry positions for buying. Will keep looking ...
2017-11-15 21:26:39,015 - freqtrade.rpc.telegram - INFO - Executing handler: _status for chat_id: 497298357
2017-11-15 21:26:46,314 - freqtrade - INFO - Checking buy signals to create a new trade with stake_amount: 0.050000 ...
2017-11-15 21:26:46,969 - freqtrade - INFO - Checked all whitelisted currencies. Found no suitable entry positions for buying. Will keep looking ...
2017-11-15 21:26:56,392 - freqtrade - INFO - Checking buy signals to create a new trade with stake_amount: 0.050000 ...
2017-11-15 21:27:12,990 - freqtrade - ERROR - Unable to create trade
Traceback (most recent call last):
  File "./freqtrade/main.py", line 70, in _process
    trade = create_trade(float(_CONF['stake_amount']))
  File "./freqtrade/main.py", line 223, in create_trade
    if get_buy_signal(_pair):
  File "/Users/sgrimm/dev/cryptos/bots/freqtrade/freqtrade/analyze.py", line 99, in get_buy_signal
    dataframe = analyze_ticker(pair)
  File "/Users/sgrimm/dev/cryptos/bots/freqtrade/freqtrade/analyze.py", line 82, in analyze_ticker
    ticker_hist = get_ticker_history(pair)
  File "/Users/sgrimm/dev/cryptos/bots/freqtrade/.env/lib/python3.6/site-packages/cachetools/__init__.py", line 46, in wrapper
    v = func(*args, **kwargs)
  File "/Users/sgrimm/dev/cryptos/bots/freqtrade/freqtrade/exchange/__init__.py", line 133, in get_ticker_history
    return _API.get_ticker_history(pair, tick_interval)
  File "/Users/sgrimm/dev/cryptos/bots/freqtrade/freqtrade/exchange/bittrex.py", line 103, in get_ticker_history
    data = _API_V2.get_candles(pair.replace('_', '-'), interval)
  File "/Users/sgrimm/dev/cryptos/bots/freqtrade/.env/src/python-bittrex/bittrex/bittrex.py", line 794, in get_candles
    }, protection=PROTECTION_PUB)
  File "/Users/sgrimm/dev/cryptos/bots/freqtrade/.env/src/python-bittrex/bittrex/bittrex.py", line 154, in _api_query
    return self.dispatch(request_url, apisign)
  File "/Users/sgrimm/dev/cryptos/bots/freqtrade/.env/src/python-bittrex/bittrex/bittrex.py", line 77, in using_requests
    headers={"apisign": apisign}
  File "/Users/sgrimm/dev/cryptos/bots/freqtrade/.env/lib/python3.6/site-packages/requests/models.py", line 892, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2017-11-15 21:27:14,055 - freqtrade - INFO - Checking buy signals to create a new trade with stake_amount: 0.050000 ...

The app seems to think that the trade went through... and, since I'm running a dry run, I can't confirm that it actually has. This may just be another API inconsistency.

So far, this is the only error I've seen in the latest develop branch.

@rybolov
Copy link

rybolov commented Nov 16, 2017

I get this too. In production, the trade does not go through.

@gcarq
Copy link
Member

gcarq commented Nov 16, 2017

I've modified the exception handling for this a little bit, it will be logged as warning followed by a 30 sec sleep. Unfortunately we cannot do much more until bittrex fixes their API.

@gcarq gcarq added the Bug label Nov 18, 2017
@gcarq gcarq closed this as completed in 0bc9624 Nov 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants