_rpc_forcebuy

This commit is contained in:
Matthias
2022-01-26 19:08:37 +01:00
parent 4998f3bdd7
commit 48d8cd82af
7 changed files with 23 additions and 21 deletions

View File

@@ -141,13 +141,14 @@ def forceentry(payload: ForceEnterPayload, rpc: RPC = Depends(get_rpc)):
ordertype = payload.ordertype.value if payload.ordertype else None
stake_amount = payload.stakeamount if payload.stakeamount else None
trade = rpc._rpc_forcebuy(payload.pair, payload.price, order_side=payload.side,
order_type=ordertype, stake_amount=stake_amount)
trade = rpc._rpc_force_entry(payload.pair, payload.price, order_side=payload.side,
order_type=ordertype, stake_amount=stake_amount)
if trade:
return ForceEnterResponse.parse_obj(trade.to_json())
else:
return ForceEnterResponse.parse_obj({"status": f"Error entering {payload.side} trade for pair {payload.pair}."})
return ForceEnterResponse.parse_obj(
{"status": f"Error entering {payload.side} trade for pair {payload.pair}."})
@router.post('/forcesell', response_model=ResultMsg, tags=['trading'])