mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-02-11 00:30:40 +00:00
Add "is_bot_managed" flag to API
This commit is contained in:
@@ -43,6 +43,7 @@ class Balance(BaseModel):
|
||||
leverage: float
|
||||
is_position: bool
|
||||
position: float
|
||||
is_bot_managed: bool
|
||||
|
||||
|
||||
class Balances(BaseModel):
|
||||
|
||||
@@ -43,7 +43,8 @@ logger = logging.getLogger(__name__)
|
||||
# 2.23: Allow plot config request in webserver mode
|
||||
# 2.24: Add cancel_open_order endpoint
|
||||
# 2.25: Add several profit values to /status endpoint
|
||||
API_VERSION = 2.25
|
||||
# 2.26: increase /balance output
|
||||
API_VERSION = 2.26
|
||||
|
||||
# Public API, requires no auth.
|
||||
router_public = APIRouter()
|
||||
|
||||
@@ -631,7 +631,8 @@ class RPC:
|
||||
continue
|
||||
|
||||
total += est_stake
|
||||
if coin == stake_currency or coin in open_assets:
|
||||
is_bot_managed = coin == stake_currency or coin in open_assets
|
||||
if is_bot_managed:
|
||||
total_bot += est_stake
|
||||
currencies.append({
|
||||
'currency': coin,
|
||||
@@ -643,6 +644,7 @@ class RPC:
|
||||
'side': 'long',
|
||||
'leverage': 1,
|
||||
'position': 0,
|
||||
'is_bot_managed': is_bot_managed,
|
||||
'is_position': False,
|
||||
})
|
||||
symbol: str
|
||||
@@ -660,6 +662,7 @@ class RPC:
|
||||
'stake': stake_currency,
|
||||
'leverage': position.leverage,
|
||||
'side': position.side,
|
||||
'is_bot_managed': True,
|
||||
'is_position': True
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user