feat: use proper properties for record_wallet_state
This commit is contained in:
@@ -450,7 +450,7 @@ class Wallets:
|
|||||||
"""
|
"""
|
||||||
Record daily wallet totals to database
|
Record daily wallet totals to database
|
||||||
"""
|
"""
|
||||||
if self.is_backtest:
|
if self._is_backtest:
|
||||||
# only record in live mode.
|
# only record in live mode.
|
||||||
return
|
return
|
||||||
timestamp = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
|
timestamp = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
|
||||||
@@ -471,9 +471,9 @@ class Wallets:
|
|||||||
price = self._exchange.get_conversion_rate(position.symbol, self._stake_currency)
|
price = self._exchange.get_conversion_rate(position.symbol, self._stake_currency)
|
||||||
position_record = WalletBalance(
|
position_record = WalletBalance(
|
||||||
timestamp=timestamp,
|
timestamp=timestamp,
|
||||||
currency=position.pair,
|
currency=position.symbol,
|
||||||
price=position.price,
|
price=price,
|
||||||
balance=position.amount,
|
balance=position.position,
|
||||||
)
|
)
|
||||||
WalletBalance.session.add(position_record)
|
WalletBalance.session.add(position_record)
|
||||||
WalletBalance.session.commit()
|
WalletBalance.session.commit()
|
||||||
|
|||||||
Reference in New Issue
Block a user