Added liq-formula to exchange classes

This commit is contained in:
Sam Germain 2021-08-01 22:38:33 -06:00
parent 7ac73999f6
commit 265638bb05
4 changed files with 6 additions and 2 deletions

View File

@ -25,6 +25,7 @@ class Binance(Exchange):
"l2_limit_range": [5, 10, 20, 50, 100, 500, 1000], "l2_limit_range": [5, 10, 20, 50, 100, 500, 1000],
} }
interest_mode: InterestMode = InterestMode.HOURSPERDAY interest_mode: InterestMode = InterestMode.HOURSPERDAY
liq_formula: LiqFormula = LiqFormula.BINANCE
maintenance_margin_formula = LiqFormula.BINANCE maintenance_margin_formula = LiqFormula.BINANCE

View File

@ -71,6 +71,7 @@ class Exchange:
_ft_has: Dict = {} _ft_has: Dict = {}
liq_formula: LiqFormula liq_formula: LiqFormula
interest_mode: InterestMode = InterestMode.NONE interest_mode: InterestMode = InterestMode.NONE
liq_formula: LiqFormula = LiqFormula.NONE
def __init__(self, config: Dict[str, Any], validate: bool = True) -> None: def __init__(self, config: Dict[str, Any], validate: bool = True) -> None:
""" """

View File

@ -5,6 +5,7 @@ from typing import Any, Dict
import ccxt import ccxt
from freqtrade.enums import LiqFormula from freqtrade.enums import LiqFormula
#from freqtrade.enums import InterestMode, LiqFormula
from freqtrade.exceptions import (DDosProtection, InsufficientFundsError, InvalidOrderException, from freqtrade.exceptions import (DDosProtection, InsufficientFundsError, InvalidOrderException,
OperationalException, TemporaryError) OperationalException, TemporaryError)
from freqtrade.exchange import Exchange from freqtrade.exchange import Exchange
@ -21,8 +22,8 @@ class Ftx(Exchange):
"stoploss_on_exchange": True, "stoploss_on_exchange": True,
"ohlcv_candle_limit": 1500, "ohlcv_candle_limit": 1500,
} }
#interest_mode: InterestMode = InterestMode.HOURSPERDAY
maintenance_margin_formula = LiqFormula.FTX liq_formula: LiqFormula = LiqFormula.FTX
def market_is_tradable(self, market: Dict[str, Any]) -> bool: def market_is_tradable(self, market: Dict[str, Any]) -> bool:
""" """

View File

@ -24,6 +24,7 @@ class Kraken(Exchange):
"trades_pagination_arg": "since", "trades_pagination_arg": "since",
} }
interest_mode: InterestMode = InterestMode.HOURSPER4 interest_mode: InterestMode = InterestMode.HOURSPER4
liq_formula: LiqFormula = LiqFormula.KRAKEN
maintenance_margin_formula = LiqFormula.KRAKEN maintenance_margin_formula = LiqFormula.KRAKEN