Last active
January 4, 2021 06:29
-
-
Save macd2/0430c7c77a6630c21c6167dfe034b660 to your computer and use it in GitHub Desktop.
Revisions
-
macd2 revised this gist
Jan 4, 2021 . No changes.There are no files selected for viewing
-
macd2 created this gist
Jan 4, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ # add this file to YOUR_PROJECT_ROOT from YOUR_PROJECT_ROOT.symbols_ import symbols from jesse import register_custom_exception_handler from jesse.modes import import_candles_mode from jesse.services import db from jesse.routes import router def get_candles(start_date, routes_, extra_candles_): router.set_routes(routes_) router.set_extra_candles(extra_candles_) for i in symbols: try: tmfrm = [x[2] for x in routes_ if x[1] == i][0] print('Downloading:', i, tmfrm) register_custom_exception_handler() import_candles_mode.run(exchange='Binance', symbol=i, start_date_str=start_date, skip_confirmation=True) db.close_connection() except IndexError: print(f'Please add {i} to routes_') except Exception as e: print(e) if __name__ == '__main__': # Set start_date and timeframe than run python3 get_candles.py start_date = '2020-01-01' timeframe = '4h' get_candles(start_date=start_date, routes_=[('Binance', x, timeframe, 'YOURS_STRATEGY') for x in symbols], extra_candles_=[]) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ # add this file to YOUR_PROJECT_ROOT and insert your desired symbols symbols = ["BTC-USDT", "ETH-USDT",add_your_symbols...]