updated new-config command to add trading_mode and margin_mode to config
This commit is contained in:
parent
b423c61127
commit
22da2e059f
@ -103,11 +103,18 @@ def ask_user_config() -> Dict[str, Any]:
|
||||
"message": "Please insert your display Currency (for reporting):",
|
||||
"default": 'USD',
|
||||
},
|
||||
{
|
||||
"type": "confirm",
|
||||
"name": "trading_mode",
|
||||
"message": "Do you want to trade Perpetual Swaps (perpetual futures)?",
|
||||
"default": False,
|
||||
"filter": lambda val: '"futures"' if val else '"spot"',
|
||||
},
|
||||
{
|
||||
"type": "select",
|
||||
"name": "exchange_name",
|
||||
"message": "Select exchange",
|
||||
"choices": [
|
||||
"choices": lambda x: [
|
||||
"binance",
|
||||
"binanceus",
|
||||
"okex",
|
||||
@ -118,6 +125,10 @@ def ask_user_config() -> Dict[str, Any]:
|
||||
"kucoin",
|
||||
Separator(),
|
||||
"other",
|
||||
] if x['trading_mode'] == '"spot"' else [
|
||||
"binance",
|
||||
# "okex",
|
||||
"gateio",
|
||||
],
|
||||
},
|
||||
{
|
||||
@ -192,6 +203,11 @@ def ask_user_config() -> Dict[str, Any]:
|
||||
},
|
||||
]
|
||||
answers = prompt(questions)
|
||||
answers["margin_mode"] = (
|
||||
'\n "margin_mode": "isolated",'
|
||||
if answers["trading_mode"] == '"futures"'
|
||||
else ''
|
||||
)
|
||||
|
||||
if not answers:
|
||||
# Interrupted questionary sessions return an empty dict.
|
||||
|
@ -13,6 +13,7 @@
|
||||
"fiat_display_currency": "{{ fiat_display_currency }}",{{ ('\n "timeframe": "' + timeframe + '",') if timeframe else '' }}
|
||||
"dry_run": {{ dry_run | lower }},
|
||||
"cancel_open_orders_on_exit": false,
|
||||
"trading_mode": {{ trading_mode }},{{ margin_mode }}
|
||||
"unfilledtimeout": {
|
||||
"buy": 10,
|
||||
"sell": 10,
|
||||
|
Loading…
Reference in New Issue
Block a user