mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Updating requested changes in PR #6653
This commit is contained in:
parent
9417bb01dc
commit
f7020df097
|
@ -128,8 +128,8 @@ Telegram is not mandatory. However, this is a great way to control your bot. Mor
|
||||||
- `/stopbuy`: Stop entering new trades.
|
- `/stopbuy`: Stop entering new trades.
|
||||||
- `/status <trade_id>|[table]`: Lists all or specific open trades.
|
- `/status <trade_id>|[table]`: Lists all or specific open trades.
|
||||||
- `/profit [<n>]`: Lists cumulative profit from all finished trades, over the last n days.
|
- `/profit [<n>]`: Lists cumulative profit from all finished trades, over the last n days.
|
||||||
- `/force_exit <trade_id>|all`: Instantly exits the given trade (Ignoring `minimum_roi`).
|
- `/forceexit <trade_id>|all`: Instantly exits the given trade (Ignoring `minimum_roi`).
|
||||||
- `/fe <trade_id>|all`: Alias to `/force_exit`
|
- `/fx <trade_id>|all`: Alias to `/forceexit`
|
||||||
- `/performance`: Show performance of each finished trade grouped by pair
|
- `/performance`: Show performance of each finished trade grouped by pair
|
||||||
- `/balance`: Show account balance per currency.
|
- `/balance`: Show account balance per currency.
|
||||||
- `/daily <n>`: Shows profit or loss per day, over the last n days.
|
- `/daily <n>`: Shows profit or loss per day, over the last n days.
|
||||||
|
|
|
@ -171,8 +171,9 @@ official commands. You can ask at any moment for help with `/help`.
|
||||||
| `/locks` | Show currently locked pairs.
|
| `/locks` | Show currently locked pairs.
|
||||||
| `/unlock <pair or lock_id>` | Remove the lock for this pair (or for this lock id).
|
| `/unlock <pair or lock_id>` | Remove the lock for this pair (or for this lock id).
|
||||||
| `/profit [<n>]` | Display a summary of your profit/loss from close trades and some stats about your performance, over the last n days (all trades by default)
|
| `/profit [<n>]` | Display a summary of your profit/loss from close trades and some stats about your performance, over the last n days (all trades by default)
|
||||||
| `/force_exit <trade_id>` | Instantly exits the given trade (Ignoring `minimum_roi`).
|
| `/forceexit <trade_id>` | Instantly exits the given trade (Ignoring `minimum_roi`).
|
||||||
| `/force_exit all` | Instantly exits all open trades (Ignoring `minimum_roi`).
|
| `/forceexit all` | Instantly exits all open trades (Ignoring `minimum_roi`).
|
||||||
|
| `/fx` | alias for `/forceexit`
|
||||||
| `/forcelong <pair> [rate]` | Instantly buys the given pair. Rate is optional and only applies to limit orders. (`forcebuy_enable` must be set to True)
|
| `/forcelong <pair> [rate]` | Instantly buys the given pair. Rate is optional and only applies to limit orders. (`forcebuy_enable` must be set to True)
|
||||||
| `/forceshort <pair> [rate]` | Instantly shorts the given pair. Rate is optional and only applies to limit orders. This will only work on non-spot markets. (`forcebuy_enable` must be set to True)
|
| `/forceshort <pair> [rate]` | Instantly shorts the given pair. Rate is optional and only applies to limit orders. This will only work on non-spot markets. (`forcebuy_enable` must be set to True)
|
||||||
| `/performance` | Show performance of each finished trade grouped by pair
|
| `/performance` | Show performance of each finished trade grouped by pair
|
||||||
|
|
|
@ -244,7 +244,9 @@ def _validate_time_in_force(conf: Dict[str, Any]) -> None:
|
||||||
def _validate_order_types(conf: Dict[str, Any]) -> None:
|
def _validate_order_types(conf: Dict[str, Any]) -> None:
|
||||||
|
|
||||||
order_types = conf.get('order_types', {})
|
order_types = conf.get('order_types', {})
|
||||||
if any(x in order_types for x in ['buy', 'sell', 'emergencysell', 'forcebuy', 'forcesell', 'emergencyexit', 'forceexit', 'forceentry']):
|
old_order_types = ['buy', 'sell', 'emergencysell', 'forcebuy',
|
||||||
|
'forcesell', 'emergencyexit', 'forceexit', 'forceentry']
|
||||||
|
if any(x in order_types for x in old_order_types):
|
||||||
if conf.get('trading_mode', TradingMode.SPOT) != TradingMode.SPOT:
|
if conf.get('trading_mode', TradingMode.SPOT) != TradingMode.SPOT:
|
||||||
raise OperationalException(
|
raise OperationalException(
|
||||||
"Please migrate your order_types settings to use the new wording.")
|
"Please migrate your order_types settings to use the new wording.")
|
||||||
|
|
|
@ -136,7 +136,7 @@ def show_config(rpc: Optional[RPC] = Depends(get_rpc_optional), config=Depends(g
|
||||||
|
|
||||||
|
|
||||||
# /forcebuy is deprecated with short addition. use Force_entry instead
|
# /forcebuy is deprecated with short addition. use Force_entry instead
|
||||||
@router.post('/force_enter', response_model=ForceEnterResponse, tags=['trading'])
|
@router.post('/forceenter', response_model=ForceEnterResponse, tags=['trading'])
|
||||||
@router.post('/forcebuy', response_model=ForceEnterResponse, tags=['trading'])
|
@router.post('/forcebuy', response_model=ForceEnterResponse, tags=['trading'])
|
||||||
def force_entry(payload: ForceEnterPayload, rpc: RPC = Depends(get_rpc)):
|
def force_entry(payload: ForceEnterPayload, rpc: RPC = Depends(get_rpc)):
|
||||||
ordertype = payload.ordertype.value if payload.ordertype else None
|
ordertype = payload.ordertype.value if payload.ordertype else None
|
||||||
|
@ -154,7 +154,7 @@ def force_entry(payload: ForceEnterPayload, rpc: RPC = Depends(get_rpc)):
|
||||||
{"status": f"Error entering {payload.side} trade for pair {payload.pair}."})
|
{"status": f"Error entering {payload.side} trade for pair {payload.pair}."})
|
||||||
|
|
||||||
|
|
||||||
@router.post('/force_exit', response_model=ResultMsg, tags=['trading'])
|
@router.post('/forceexit', response_model=ResultMsg, tags=['trading'])
|
||||||
@router.post('/forcesell', response_model=ResultMsg, tags=['trading'])
|
@router.post('/forcesell', response_model=ResultMsg, tags=['trading'])
|
||||||
def forcesell(payload: ForceExitPayload, rpc: RPC = Depends(get_rpc)):
|
def forcesell(payload: ForceExitPayload, rpc: RPC = Depends(get_rpc)):
|
||||||
ordertype = payload.ordertype.value if payload.ordertype else None
|
ordertype = payload.ordertype.value if payload.ordertype else None
|
||||||
|
|
|
@ -115,7 +115,7 @@ class Telegram(RPCHandler):
|
||||||
r'/stopbuy$', r'/reload_config$', r'/show_config$',
|
r'/stopbuy$', r'/reload_config$', r'/show_config$',
|
||||||
r'/logs$', r'/whitelist$', r'/blacklist$', r'/bl_delete$',
|
r'/logs$', r'/whitelist$', r'/blacklist$', r'/bl_delete$',
|
||||||
r'/weekly$', r'/weekly \d+$', r'/monthly$', r'/monthly \d+$',
|
r'/weekly$', r'/weekly \d+$', r'/monthly$', r'/monthly \d+$',
|
||||||
r'/forcebuy$', r'/forcelong$', r'/forceshort$', r'/force_exit$',
|
r'/forcebuy$', r'/forcelong$', r'/forceshort$', r'/forceexit$',
|
||||||
r'/edge$', r'/health$', r'/help$', r'/version$']
|
r'/edge$', r'/health$', r'/help$', r'/version$']
|
||||||
# Create keys for generation
|
# Create keys for generation
|
||||||
valid_keys_print = [k.replace('$', '') for k in valid_keys]
|
valid_keys_print = [k.replace('$', '') for k in valid_keys]
|
||||||
|
@ -153,7 +153,7 @@ class Telegram(RPCHandler):
|
||||||
CommandHandler('balance', self._balance),
|
CommandHandler('balance', self._balance),
|
||||||
CommandHandler('start', self._start),
|
CommandHandler('start', self._start),
|
||||||
CommandHandler('stop', self._stop),
|
CommandHandler('stop', self._stop),
|
||||||
CommandHandler(['forcesell', 'force_exit', 'fe'], self._force_exit),
|
CommandHandler(['forcesell', 'forceexit', 'fx'], self._force_exit),
|
||||||
CommandHandler(['forcebuy', 'forcelong'], partial(
|
CommandHandler(['forcebuy', 'forcelong'], partial(
|
||||||
self._force_enter, order_side=SignalDirection.LONG)),
|
self._force_enter, order_side=SignalDirection.LONG)),
|
||||||
CommandHandler('forceshort', partial(
|
CommandHandler('forceshort', partial(
|
||||||
|
@ -1360,13 +1360,13 @@ class Telegram(RPCHandler):
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
force_enter_text = ("*/forcelong <pair> [<rate>]:* `Instantly buys the given pair. "
|
force_enter_text = ("*/forcelong <pair> [<rate>]:* `Instantly buys the given pair. "
|
||||||
"Optionally takes a rate at which to buy "
|
"Optionally takes a rate at which to buy "
|
||||||
"(only applies to limit orders).` \n"
|
"(only applies to limit orders).` \n"
|
||||||
)
|
)
|
||||||
if self._rpc._freqtrade.trading_mode != TradingMode.SPOT:
|
if self._rpc._freqtrade.trading_mode != TradingMode.SPOT:
|
||||||
force_enter_text += ("*/forceshort <pair> [<rate>]:* `Instantly shorts the given pair. "
|
force_enter_text += ("*/forceshort <pair> [<rate>]:* `Instantly shorts the given pair. "
|
||||||
"Optionally takes a rate at which to sell "
|
"Optionally takes a rate at which to sell "
|
||||||
"(only applies to limit orders).` \n")
|
"(only applies to limit orders).` \n")
|
||||||
message = (
|
message = (
|
||||||
"_BotControl_\n"
|
"_BotControl_\n"
|
||||||
"------------\n"
|
"------------\n"
|
||||||
|
|
|
@ -1075,7 +1075,7 @@ def test_api_whitelist(botclient):
|
||||||
|
|
||||||
@pytest.mark.parametrize('endpoint', [
|
@pytest.mark.parametrize('endpoint', [
|
||||||
'forcebuy',
|
'forcebuy',
|
||||||
'force_enter',
|
'forceenter',
|
||||||
])
|
])
|
||||||
def test_api_force_entry(botclient, mocker, fee, endpoint):
|
def test_api_force_entry(botclient, mocker, fee, endpoint):
|
||||||
ftbot, client = botclient
|
ftbot, client = botclient
|
||||||
|
|
|
@ -95,7 +95,7 @@ def test_telegram_init(default_conf, mocker, caplog) -> None:
|
||||||
|
|
||||||
message_str = ("rpc.telegram is listening for following commands: [['status'], ['profit'], "
|
message_str = ("rpc.telegram is listening for following commands: [['status'], ['profit'], "
|
||||||
"['balance'], ['start'], ['stop'], "
|
"['balance'], ['start'], ['stop'], "
|
||||||
"['forcesell', 'force_exit', 'fe'], ['forcebuy', 'forcelong'], ['forceshort'], "
|
"['forcesell', 'forceexit', 'fx'], ['forcebuy', 'forcelong'], ['forceshort'], "
|
||||||
"['trades'], ['delete'], ['performance'], "
|
"['trades'], ['delete'], ['performance'], "
|
||||||
"['buys', 'entries'], ['sells', 'exits'], ['mix_tags'], "
|
"['buys', 'entries'], ['sells', 'exits'], ['mix_tags'], "
|
||||||
"['stats'], ['daily'], ['weekly'], ['monthly'], "
|
"['stats'], ['daily'], ['weekly'], ['monthly'], "
|
||||||
|
|
Loading…
Reference in New Issue
Block a user