fix json issue

This commit is contained in:
Saleh Mir
2021-03-15 09:12:54 +01:00
parent 3c47183378
commit 7480434d42
2 changed files with 7 additions and 3 deletions

View File

@@ -10,7 +10,6 @@ from jesse.store import store
def store_logs(export_json: bool = False, export_tradingview: bool = False, export_csv: bool = False) -> None:
# store trades
mode = config['app']['trading_mode']
now = str(arrow.utcnow())[0:19]
@@ -23,7 +22,12 @@ def store_logs(export_json: bool = False, export_tradingview: bool = False, expo
if export_json:
os.makedirs('./storage/json', exist_ok=True)
with open(path, 'w+') as outfile:
json.dump(trades_json, outfile)
def set_default(obj):
if isinstance(obj, set):
return list(obj)
raise TypeError
json.dump(trades_json, outfile, default=set_default)
print('\nJSON output saved at: \n{}'.format(path))

View File

@@ -1,6 +1,6 @@
from setuptools import setup, find_packages
VERSION = '0.20.1'
VERSION = '0.20.2'
DESCRIPTION = "A trading framework for cryptocurrencies"
REQUIRED_PACKAGES = [