Test for short exchange.stoploss exchange.stoploss_adjust

This commit is contained in:
Sam Germain
2021-09-09 14:24:07 -06:00
parent 785b71aec1
commit 2c7cf794f5
6 changed files with 105 additions and 57 deletions

View File

@@ -57,7 +57,10 @@ class Ftx(Exchange):
Limit orders are defined by having orderPrice set, otherwise a market order is used.
"""
limit_price_pct = order_types.get('stoploss_on_exchange_limit_ratio', 0.99)
limit_price_pct = order_types.get(
'stoploss_on_exchange_limit_ratio',
0.99 if side == "sell" else 1.01
)
limit_rate = stop_price * limit_price_pct
ordertype = "stop"
@@ -164,10 +167,6 @@ class Ftx(Exchange):
return safe_value_fallback2(order, order, 'id_stop', 'id')
return order['id']
def _apply_leverage_to_stake_amount(self, stake_amount: float, leverage: float):
# TODO-lev: implement
return stake_amount
def fill_leverage_brackets(self):
"""
FTX leverage is static across the account, and doesn't change from pair to pair,