Small stylistic fixes
This commit is contained in:
parent
6018a05343
commit
b2e9295d7f
@ -274,7 +274,6 @@ class Backtesting:
|
|||||||
return None
|
return None
|
||||||
min_stake_amount = self.exchange.get_min_pair_stake_amount(pair, row[OPEN_IDX], -0.05)
|
min_stake_amount = self.exchange.get_min_pair_stake_amount(pair, row[OPEN_IDX], -0.05)
|
||||||
if stake_amount and (not min_stake_amount or stake_amount > min_stake_amount):
|
if stake_amount and (not min_stake_amount or stake_amount > min_stake_amount):
|
||||||
# print(f"{pair}, {stake_amount}")
|
|
||||||
# Enter trade
|
# Enter trade
|
||||||
trade = LocalTrade(
|
trade = LocalTrade(
|
||||||
pair=pair,
|
pair=pair,
|
||||||
|
@ -652,9 +652,8 @@ class LocalTrade():
|
|||||||
in stake currency
|
in stake currency
|
||||||
"""
|
"""
|
||||||
if Trade.use_db:
|
if Trade.use_db:
|
||||||
total_open_stake_amount = Trade.session.query(func.sum(Trade.stake_amount))\
|
total_open_stake_amount = Trade.session.query(
|
||||||
.filter(Trade.is_open.is_(True))\
|
func.sum(Trade.stake_amount)).filter(Trade.is_open.is_(True)).scalar()
|
||||||
.scalar()
|
|
||||||
else:
|
else:
|
||||||
total_open_stake_amount = sum(
|
total_open_stake_amount = sum(
|
||||||
t.stake_amount for t in Trade.get_trades_proxy(is_open=True))
|
t.stake_amount for t in Trade.get_trades_proxy(is_open=True))
|
||||||
@ -719,6 +718,8 @@ class Trade(_DECL_BASE, LocalTrade):
|
|||||||
"""
|
"""
|
||||||
Trade database model.
|
Trade database model.
|
||||||
Also handles updating and querying trades
|
Also handles updating and querying trades
|
||||||
|
|
||||||
|
Note: Fields must be aligned with LocalTrade class
|
||||||
"""
|
"""
|
||||||
__tablename__ = 'trades'
|
__tablename__ = 'trades'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user