Merge pull request #5887 from samgermain/common-ccxt-config

Common ccxt config
This commit is contained in:
Matthias
2021-11-14 09:52:06 +01:00
committed by GitHub
7 changed files with 29 additions and 65 deletions

View File

@@ -27,6 +27,7 @@ class Binance(Exchange):
"trades_pagination": "id",
"trades_pagination_arg": "fromId",
"l2_limit_range": [5, 10, 20, 50, 100, 500, 1000],
"ccxt_futures_name": "future"
}
funding_fee_times: List[int] = [0, 8, 16] # hours of the day
# but the schedule won't check within this timeframe
@@ -39,24 +40,6 @@ class Binance(Exchange):
# (TradingMode.FUTURES, Collateral.ISOLATED)
]
@property
def _ccxt_config(self) -> Dict:
# Parameters to add directly to ccxt sync/async initialization.
if self.trading_mode == TradingMode.MARGIN:
return {
"options": {
"defaultType": "margin"
}
}
elif self.trading_mode == TradingMode.FUTURES:
return {
"options": {
"defaultType": "future"
}
}
else:
return {}
def stoploss_adjust(self, stop_loss: float, order: Dict, side: str) -> bool:
"""
Verify stop_loss against stoploss-order value (limit or price)