Automatically assign buy-tag to force-buys

closes #6544
This commit is contained in:
Matthias
2022-03-20 09:30:11 +01:00
parent aceaa3faec
commit 8556e6a053
4 changed files with 4 additions and 2 deletions

View File

@@ -137,7 +137,7 @@ def show_config(rpc: Optional[RPC] = Depends(get_rpc_optional), config=Depends(g
def forcebuy(payload: ForceBuyPayload, rpc: RPC = Depends(get_rpc)):
ordertype = payload.ordertype.value if payload.ordertype else None
stake_amount = payload.stakeamount if payload.stakeamount else None
entry_tag = payload.entry_tag if payload.entry_tag else None
entry_tag = payload.entry_tag if payload.entry_tag else 'forceentry'
trade = rpc._rpc_forcebuy(payload.pair, payload.price, ordertype, stake_amount, entry_tag)

View File

@@ -713,7 +713,7 @@ class RPC:
def _rpc_forcebuy(self, pair: str, price: Optional[float], order_type: Optional[str] = None,
stake_amount: Optional[float] = None,
buy_tag: Optional[str] = None) -> Optional[Trade]:
buy_tag: Optional[str] = 'forceentry') -> Optional[Trade]:
"""
Handler for forcebuy <asset> <price>
Buys a pair trade at the given or current price