Merge branch 'freqtrade:develop' into fix-docs

This commit is contained in:
Stefano Ariestasia
2022-01-28 06:57:13 +09:00
committed by GitHub
12 changed files with 91 additions and 21 deletions

View File

@@ -173,6 +173,8 @@ class ShowConfig(BaseModel):
bot_name: str
state: str
runmode: str
position_adjustment_enable: bool
max_entry_position_adjustment: int
class TradeSchema(BaseModel):

View File

@@ -136,7 +136,12 @@ class RPC:
'ask_strategy': config.get('ask_strategy', {}),
'bid_strategy': config.get('bid_strategy', {}),
'state': str(botstate),
'runmode': config['runmode'].value
'runmode': config['runmode'].value,
'position_adjustment_enable': config.get('position_adjustment_enable', False),
'max_entry_position_adjustment': (
config['max_entry_position_adjustment']
if config['max_entry_position_adjustment'] != float('inf')
else -1)
}
return val
@@ -249,8 +254,9 @@ class RPC:
profit_str
]
if self._config.get('position_adjustment_enable', False):
filled_buys = trade.select_filled_orders('buy')
detail_trade.append(str(len(filled_buys)))
max_buy = self._config['max_entry_position_adjustment'] + 1
filled_buys = trade.nr_of_successful_buys
detail_trade.append(f"{filled_buys}/{max_buy}")
trades_list.append(detail_trade)
profitcol = "Profit"
if self._fiat_converter:

View File

@@ -1405,6 +1405,14 @@ class Telegram(RPCHandler):
else:
sl_info = f"*Stoploss:* `{val['stoploss']}`\n"
if val['position_adjustment_enable']:
pa_info = (
f"*Position adjustment:* On\n"
f"*Max enter position adjustment:* `{val['max_entry_position_adjustment']}`\n"
)
else:
pa_info = "*Position adjustment:* Off\n"
self._send_msg(
f"*Mode:* `{'Dry-run' if val['dry_run'] else 'Live'}`\n"
f"*Exchange:* `{val['exchange']}`\n"
@@ -1414,6 +1422,7 @@ class Telegram(RPCHandler):
f"*Ask strategy:* ```\n{json.dumps(val['ask_strategy'])}```\n"
f"*Bid strategy:* ```\n{json.dumps(val['bid_strategy'])}```\n"
f"{sl_info}"
f"{pa_info}"
f"*Timeframe:* `{val['timeframe']}`\n"
f"*Strategy:* `{val['strategy']}`\n"
f"*Current state:* `{val['state']}`"