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

binance does not offer 3h candles for 30m extra #424

Closed
movy opened this issue Mar 5, 2024 · 1 comment
Closed

binance does not offer 3h candles for 30m extra #424

movy opened this issue Mar 5, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@movy
Copy link
Contributor

movy commented Mar 5, 2024

Very basic stuff: extra candles state that 30m candles will fetch 3h as extras:
https://github.com/jesse-ai/jesse/blob/dc9a9ca1dd591ca920d4f6b3603a0ec1c82624ce/jesse/utils.py#L26C1-L27C1

and naturally it works fine during backtesting. Yet Binance does not offer 3h candles, so going live is impossible with such strategy, error goes:

  error: 'ValueError: Invalid timeframe: 3h',
  traceback: 'Traceback (most recent call last):\n' +
    '  File "/usr/lib/python3.11/threading.py", line 1045, in _bootstrap_inner\n' +
    '    self.run()\n' +
    '  File "/usr/lib/python3.11/threading.py", line 982, in run\n' +
    '    self._target(*self._args, **self._kwargs)\n' +
    '  File "/home/ubuntu/.local/lib/python3.11/site-packages/jesse/services/api.py", line 27, in initiate_ws\n' +
    '    self.drivers[exchange_name] = exchange_class()\n' +
    '                                  ^^^^^^^^^^^^^^^^\n' +
    '  File "jesse_live/exchanges/Binance/BinancePerpetualFutures.py", line 7, in jesse_live.exchanges.Binance.BinancePerpetualFutures.BinancePerpetualFutures.__init__\n' +
    '  File "jesse_live/exchanges/Binance/BinancePerpetualFuturesMain.py", line 25, in jesse_live.exchanges.Binance.BinancePerpetualFuturesMain.BinancePerpetualFuturesMain.__init__\n' +
    '  File "jesse_live/exchanges/LiveExchange.py", line 171, in jesse_live.exchanges.LiveExchange.LiveExchange.__init__\n' +
    '  File "jesse_live/exchanges/LiveExchange.py", line 1322, in jesse_live.exchanges.LiveExchange.LiveExchange._fetch_initial_candles_for_all_timeframes\n' +
    '  File "/home/ubuntu/.local/lib/python3.11/site-packages/jesse/modes/import_candles_mode/drivers/Binance/BinanceMain.py", line 46, in fetch\n' +
    '    interval = timeframe_to_interval(timeframe)\n' +
    '               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n' +
    '  File "/home/ubuntu/.local/lib/python3.11/site-packages/jesse/modes/import_candles_mode/drivers/Binance/binance_utils.py", line 51, in timeframe_to_interval\n' +
    "    raise ValueError('Invalid timeframe: {}'.format(timeframe))\n" +
    'ValueError: Invalid timeframe: 3h\n'
}

A simple fix would be to offer extra tf conditionally based on the exchange used. I think manually generating 3h candles not worth the effort in such case.

@movy movy added the bug Something isn't working label Mar 5, 2024
@movy
Copy link
Contributor Author

movy commented Mar 5, 2024

My bad, I forgot that local candle generation can be activated by user!

@movy movy closed this as completed Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant