Added more update_funding_fee tests, set exchange of default conf
This commit is contained in:
@@ -29,6 +29,7 @@ class Binance(Exchange):
|
||||
"l2_limit_range": [5, 10, 20, 50, 100, 500, 1000],
|
||||
}
|
||||
funding_fee_times: List[int] = [0, 8, 16] # hours of the day
|
||||
# but the schedule won't check within this timeframe
|
||||
|
||||
_supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [
|
||||
# TradingMode.SPOT always supported and not required in this list
|
||||
|
@@ -1,7 +1,8 @@
|
||||
""" Bybit exchange subclass """
|
||||
import logging
|
||||
from typing import Dict, List
|
||||
from typing import Dict, List, Tuple
|
||||
|
||||
from freqtrade.enums import Collateral, TradingMode
|
||||
from freqtrade.exchange import Exchange
|
||||
|
||||
|
||||
@@ -23,3 +24,9 @@ class Bybit(Exchange):
|
||||
}
|
||||
|
||||
funding_fee_times: List[int] = [0, 8, 16] # hours of the day
|
||||
|
||||
_supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [
|
||||
# TradingMode.SPOT always supported and not required in this list
|
||||
# (TradingMode.FUTURES, Collateral.CROSS), # TODO-lev: Uncomment once supported
|
||||
# (TradingMode.FUTURES, Collateral.ISOLATED) # TODO-lev: Uncomment once supported
|
||||
]
|
||||
|
@@ -21,7 +21,7 @@ class Ftx(Exchange):
|
||||
"stoploss_on_exchange": True,
|
||||
"ohlcv_candle_limit": 1500,
|
||||
}
|
||||
funding_fee_times: List[int] = list(range(0, 23))
|
||||
funding_fee_times: List[int] = list(range(0, 24))
|
||||
|
||||
_supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [
|
||||
# TradingMode.SPOT always supported and not required in this list
|
||||
|
@@ -111,10 +111,15 @@ class FreqtradeBot(LoggingMixin):
|
||||
self.trading_mode = TradingMode.SPOT
|
||||
|
||||
if self.trading_mode == TradingMode.FUTURES:
|
||||
for time_slot in self.exchange.funding_fee_times:
|
||||
schedule.every().day.at(str(time(time_slot))).do(self.update_funding_fees)
|
||||
|
||||
def update():
|
||||
self.update_funding_fees()
|
||||
self.wallets.update()
|
||||
|
||||
for time_slot in self.exchange.funding_fee_times:
|
||||
t = str(time(time_slot))
|
||||
schedule.every().day.at(t).do(update)
|
||||
|
||||
def notify_status(self, msg: str) -> None:
|
||||
"""
|
||||
Public method for users of this class (worker, etc.) to send notifications
|
||||
|
Reference in New Issue
Block a user