edited todos
This commit is contained in:
parent
ee5f05208e
commit
fc2d3649a1
@ -85,7 +85,7 @@ def start_download_data(args: Dict[str, Any]) -> None:
|
|||||||
new_pairs_days=config['new_pairs_days'],
|
new_pairs_days=config['new_pairs_days'],
|
||||||
erase=bool(config.get('erase')), data_format=config['dataformat_ohlcv'],
|
erase=bool(config.get('erase')), data_format=config['dataformat_ohlcv'],
|
||||||
trading_mode=config.get('trading_mode', 'spot'),
|
trading_mode=config.get('trading_mode', 'spot'),
|
||||||
)
|
)
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
sys.exit("SIGINT received, aborting ...")
|
sys.exit("SIGINT received, aborting ...")
|
||||||
@ -160,7 +160,6 @@ def start_list_data(args: Dict[str, Any]) -> None:
|
|||||||
from freqtrade.data.history.idatahandler import get_datahandler
|
from freqtrade.data.history.idatahandler import get_datahandler
|
||||||
dhc = get_datahandler(config['datadir'], config['dataformat_ohlcv'])
|
dhc = get_datahandler(config['datadir'], config['dataformat_ohlcv'])
|
||||||
|
|
||||||
# TODO-lev: trading-mode should be parsed at config level, and available as Enum in the config.
|
|
||||||
paircombs = dhc.ohlcv_get_available_data(config['datadir'], config.get('trading_mode', 'spot'))
|
paircombs = dhc.ohlcv_get_available_data(config['datadir'], config.get('trading_mode', 'spot'))
|
||||||
|
|
||||||
if args['pairs']:
|
if args['pairs']:
|
||||||
|
@ -8,8 +8,10 @@ class CandleType(str, Enum):
|
|||||||
MARK = "mark"
|
MARK = "mark"
|
||||||
INDEX = "index"
|
INDEX = "index"
|
||||||
PREMIUMINDEX = "premiumIndex"
|
PREMIUMINDEX = "premiumIndex"
|
||||||
# TODO-lev: not sure this belongs here, as the datatype is really different
|
|
||||||
|
# TODO: Could take up less memory if these weren't a CandleType
|
||||||
FUNDING_RATE = "funding_rate"
|
FUNDING_RATE = "funding_rate"
|
||||||
|
BORROW_RATE = "borrow_rate" # * unimplemented
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def from_string(value: str) -> 'CandleType':
|
def from_string(value: str) -> 'CandleType':
|
||||||
|
@ -1528,7 +1528,7 @@ class Exchange:
|
|||||||
:return: Dict of [{(pair, timeframe): Dataframe}]
|
:return: Dict of [{(pair, timeframe): Dataframe}]
|
||||||
"""
|
"""
|
||||||
logger.debug("Refreshing candle (OHLCV) data for %d pairs", len(pair_list))
|
logger.debug("Refreshing candle (OHLCV) data for %d pairs", len(pair_list))
|
||||||
# TODO-lev: maybe depend this on candle type?
|
# TODO: maybe depend this on candle type?
|
||||||
drop_incomplete = self._ohlcv_partial_candle if drop_incomplete is None else drop_incomplete
|
drop_incomplete = self._ohlcv_partial_candle if drop_incomplete is None else drop_incomplete
|
||||||
input_coroutines = []
|
input_coroutines = []
|
||||||
cached_pairs = []
|
cached_pairs = []
|
||||||
|
@ -1049,7 +1049,7 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
Check if trade is fulfilled in which case the stoploss
|
Check if trade is fulfilled in which case the stoploss
|
||||||
on exchange should be added immediately if stoploss on exchange
|
on exchange should be added immediately if stoploss on exchange
|
||||||
is enabled.
|
is enabled.
|
||||||
# TODO-lev: liquidation price always on exchange, even without stoploss_on_exchange
|
# TODO: liquidation price always on exchange, even without stoploss_on_exchange
|
||||||
"""
|
"""
|
||||||
|
|
||||||
logger.debug('Handling stoploss on exchange %s ...', trade)
|
logger.debug('Handling stoploss on exchange %s ...', trade)
|
||||||
@ -1736,7 +1736,7 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
trade.update_fee(fee_cost, fee_currency, fee_rate, order.get('side', ''))
|
trade.update_fee(fee_cost, fee_currency, fee_rate, order.get('side', ''))
|
||||||
|
|
||||||
if not isclose(amount, order_amount, abs_tol=constants.MATH_CLOSE_PREC):
|
if not isclose(amount, order_amount, abs_tol=constants.MATH_CLOSE_PREC):
|
||||||
# TODO-lev: leverage?
|
# * Leverage could be a cause for this warning, leverage hasn't been thoroughly tested
|
||||||
logger.warning(f"Amount {amount} does not match amount {trade.amount}")
|
logger.warning(f"Amount {amount} does not match amount {trade.amount}")
|
||||||
raise DependencyException("Half bought? Amounts don't match")
|
raise DependencyException("Half bought? Amounts don't match")
|
||||||
|
|
||||||
|
@ -127,8 +127,6 @@ class Backtesting:
|
|||||||
self.config['startup_candle_count'] = self.required_startup
|
self.config['startup_candle_count'] = self.required_startup
|
||||||
self.exchange.validate_required_startup_candles(self.required_startup, self.timeframe)
|
self.exchange.validate_required_startup_candles(self.required_startup, self.timeframe)
|
||||||
|
|
||||||
# TODO-lev: This should come from the configuration setting or better a
|
|
||||||
# TODO-lev: combination of config/strategy "use_shorts"(?) and "can_short" from the exchange
|
|
||||||
self.trading_mode = TradingMode(config.get('trading_mode', 'spot'))
|
self.trading_mode = TradingMode(config.get('trading_mode', 'spot'))
|
||||||
self._can_short = self.trading_mode != TradingMode.SPOT
|
self._can_short = self.trading_mode != TradingMode.SPOT
|
||||||
|
|
||||||
@ -538,7 +536,7 @@ class Backtesting:
|
|||||||
sell_candle_time: datetime = sell_row[DATE_IDX].to_pydatetime()
|
sell_candle_time: datetime = sell_row[DATE_IDX].to_pydatetime()
|
||||||
|
|
||||||
if self.trading_mode == TradingMode.FUTURES:
|
if self.trading_mode == TradingMode.FUTURES:
|
||||||
# TODO-lev: liquidation price?
|
# TODO: liquidation price?
|
||||||
trade.funding_fees = self.exchange.calculate_funding_fees(
|
trade.funding_fees = self.exchange.calculate_funding_fees(
|
||||||
self.futures_data[trade.pair],
|
self.futures_data[trade.pair],
|
||||||
amount=trade.amount,
|
amount=trade.amount,
|
||||||
|
@ -15,7 +15,7 @@ import talib.abstract as ta
|
|||||||
import freqtrade.vendor.qtpylib.indicators as qtpylib
|
import freqtrade.vendor.qtpylib.indicators as qtpylib
|
||||||
|
|
||||||
|
|
||||||
# TODO-lev: Create a meaningfull short strategy (not just revresed signs).
|
# TODO: Create a meaningfull short strategy (not just revresed signs).
|
||||||
# This class is a sample. Feel free to customize it.
|
# This class is a sample. Feel free to customize it.
|
||||||
class SampleShortStrategy(IStrategy):
|
class SampleShortStrategy(IStrategy):
|
||||||
"""
|
"""
|
||||||
|
@ -558,7 +558,7 @@ tc35 = BTContainer(data=[
|
|||||||
stop_loss=-0.01, roi={"0": 0.10}, profit_perc=-0.01,
|
stop_loss=-0.01, roi={"0": 0.10}, profit_perc=-0.01,
|
||||||
custom_entry_price=7200, trades=[
|
custom_entry_price=7200, trades=[
|
||||||
BTrade(sell_reason=SellType.STOP_LOSS, open_tick=1, close_tick=1)
|
BTrade(sell_reason=SellType.STOP_LOSS, open_tick=1, close_tick=1)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
# Test 36: Custom-entry-price around candle low
|
# Test 36: Custom-entry-price around candle low
|
||||||
@ -697,7 +697,7 @@ def test_backtest_results(default_conf, fee, mocker, caplog, data) -> None:
|
|||||||
backtesting._set_strategy(backtesting.strategylist[0])
|
backtesting._set_strategy(backtesting.strategylist[0])
|
||||||
backtesting.required_startup = 0
|
backtesting.required_startup = 0
|
||||||
if data.leverage > 1.0:
|
if data.leverage > 1.0:
|
||||||
# TODO-lev: Should we initialize this properly??
|
# TODO: Should we initialize this properly??
|
||||||
backtesting._can_short = True
|
backtesting._can_short = True
|
||||||
backtesting.strategy.advise_entry = lambda a, m: frame
|
backtesting.strategy.advise_entry = lambda a, m: frame
|
||||||
backtesting.strategy.advise_exit = lambda a, m: frame
|
backtesting.strategy.advise_exit = lambda a, m: frame
|
||||||
|
@ -71,7 +71,7 @@ class StrategyTestV3(IStrategy):
|
|||||||
protection_enabled = BooleanParameter(default=True)
|
protection_enabled = BooleanParameter(default=True)
|
||||||
protection_cooldown_lookback = IntParameter([0, 50], default=30)
|
protection_cooldown_lookback = IntParameter([0, 50], default=30)
|
||||||
|
|
||||||
# TODO-lev: Can this work with protection tests? (replace HyperoptableStrategy implicitly ... )
|
# TODO: Can this work with protection tests? (replace HyperoptableStrategy implicitly ... )
|
||||||
# @property
|
# @property
|
||||||
# def protections(self):
|
# def protections(self):
|
||||||
# prot = []
|
# prot = []
|
||||||
|
Loading…
Reference in New Issue
Block a user