jesse-ai / jesse

An advanced crypto trading bot written in Python
https://jesse.trade
MIT License
5.57k stars 714 forks source link

Bug: original arguments not included in recursive call to run import_candles_mode.run #358

Closed getorca closed 2 years ago

getorca commented 2 years ago

Describe the bug When using import_candles_mode.run(...) from outside of the dashboard, when the startdate is before available and the exchange returns a first_existing_timestamp, the run function try to recursively call import_candles_mode.run(...) with the default settings, causing a script using it to crash.

To Reproduce

from jesse.config import config
from jesse.services import db
from jesse.modes import import_candles_mode
from jesse.enums import exchanges

config['app']['trading_mode'] = 'candles'

exchange = exchanges.BINANCE_PERPETUAL_FUTURES
start_date = '2015-09-09'
pairs = ['BTC-USDT', 'LTC-USDT', 'XMR-USDT', 'ETC-USDT']

for pair in pairs:
    # ToDo: allow this to run in parallel
    arr = import_candles_mode.run(exchange, pair, start_date, running_via_dashboard=False, show_progressbar=True)
    print(arr)

db.close_connection()

Expected behavior The recursive call to import_candles_mode.run will keep running with arguments passed to it.

Additional context See pull request https://github.com/jesse-ai/jesse/pull/359

saleh-mir commented 2 years ago

Thank you for the PR!