Update setting to max_entry_position_adjustment

This commit is contained in:
Matthias
2022-01-27 16:57:50 +01:00
parent 0fa7986369
commit 002226f5fd
11 changed files with 23 additions and 22 deletions

View File

@@ -174,7 +174,7 @@ class ShowConfig(BaseModel):
state: str
runmode: str
position_adjustment_enable: bool
max_buy_position_adjustment: int
max_entry_position_adjustment: int
class TradeSchema(BaseModel):

View File

@@ -138,9 +138,10 @@ class RPC:
'state': str(botstate),
'runmode': config['runmode'].value,
'position_adjustment_enable': config.get('position_adjustment_enable', False),
'max_buy_position_adjustment': (config['max_buy_position_adjustment']
if config['max_buy_position_adjustment'] != float('inf')
else -1)
'max_entry_position_adjustment': (
config['max_entry_position_adjustment']
if config['max_entry_position_adjustment'] != float('inf')
else -1)
}
return val
@@ -251,7 +252,7 @@ class RPC:
profit_str
]
if self._config.get('position_adjustment_enable', False):
max_buy = self._config['max_buy_position_adjustment'] + 1
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)

View File

@@ -1350,7 +1350,7 @@ class Telegram(RPCHandler):
if val['position_adjustment_enable']:
pa_info = (
f"*Position adjustment:* On\n"
f"*Max buy position adjustment:* `{val['max_buy_position_adjustment']}`\n"
f"*Max enter position adjustment:* `{val['max_entry_position_adjustment']}`\n"
)
else:
pa_info = "*Position adjustment:* Off\n"