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

Extend code with limit check #461

Open
paczko opened this issue Sep 5, 2023 · 1 comment
Open

Extend code with limit check #461

paczko opened this issue Sep 5, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@paczko
Copy link

paczko commented Sep 5, 2023

Is your feature request related to a problem? Please describe.
When executing the code sometime Bitfinex limitation (https://docs.bitfinex.com/docs/requirements-and-limitations) reached.
A logic need to be added when it happens and sleep for a time (60s) defined by Bitfinex.

Describe the solution you'd like
A logic like that would be nice to be added:

orig code:

    candle_data.extend(candlestick)
    write_to_console(
        ticker,
        interval,
        candlestick,
        live,
        setup_table(),
    )

..suggested code:

  if (len(candlestick) == 3):
      if  (candlestick[2] == 'ratelimit: error'):
          print('limit exceeded. sleep for 60s')
          sleep(60)
          continue
      break
  if len(candlestick) > 0:
    candle_data.extend(candlestick)
    write_to_console(
        ticker,
        interval,
        candlestick,
        live,
        setup_table(),
    )
  else:
    break

..the above suggested changes handles the situation if date is newer than latest data (even today added causes exception in code running)

@paczko paczko added the enhancement New feature or request label Sep 5, 2023
@create-issue-branch
Copy link

Branch issue-461-Extend_code_with_limit_check created!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants