Exchange stoploss function takes side

This commit is contained in:
Sam Germain
2021-07-26 00:01:57 -06:00
parent ebf5310817
commit f4e26a616f
10 changed files with 85 additions and 58 deletions

View File

@@ -802,14 +802,15 @@ class Exchange:
):
raise OperationalException(f"Leverage is not available on {self.name} using freqtrade")
def stoploss_adjust(self, stop_loss: float, order: Dict) -> bool:
def stoploss_adjust(self, stop_loss: float, order: Dict, side: str) -> bool:
"""
Verify stop_loss against stoploss-order value (limit or price)
Returns True if adjustment is necessary.
"""
raise OperationalException(f"stoploss is not implemented for {self.name}.")
def stoploss(self, pair: str, amount: float, stop_price: float, order_types: Dict) -> Dict:
def stoploss(self, pair: str, amount: float,
stop_price: float, order_types: Dict, side: str) -> Dict:
"""
creates a stoploss order.
The precise ordertype is determined by the order_types dict or exchange default.