From cbbdf00ddd745ef15c5887ce7d639561d399c4c2 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 15 Mar 2022 06:39:07 +0100 Subject: [PATCH] Update comments in short backtest rates --- freqtrade/optimize/backtesting.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index c597c6748..ea9850624 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -444,22 +444,22 @@ class Backtesting: if (trade_dur == 0 and ( ( is_short - # Red candle (for longs), TODO: green candle (for shorts) + # Red candle (for longs) and sell_row[OPEN_IDX] < sell_row[CLOSE_IDX] # Red candle - and trade.open_rate > sell_row[OPEN_IDX] # trade-open below open_rate - and close_rate < sell_row[CLOSE_IDX] + and trade.open_rate > sell_row[OPEN_IDX] # trade-open above open_rate + and close_rate < sell_row[CLOSE_IDX] # closes below close ) or ( not is_short - # Red candle (for longs), TODO: green candle (for shorts) - and sell_row[OPEN_IDX] > sell_row[CLOSE_IDX] # Red candle + # green candle (for shorts) + and sell_row[OPEN_IDX] > sell_row[CLOSE_IDX] # green candle and trade.open_rate < sell_row[OPEN_IDX] # trade-open below open_rate - and close_rate > sell_row[CLOSE_IDX] + and close_rate > sell_row[CLOSE_IDX] # closes above close ) )): # ROI on opening candles with custom pricing can only - # trigger if the entry was at Open or lower. + # trigger if the entry was at Open or lower wick. # details: https: // github.com/freqtrade/freqtrade/issues/6261 # If open_rate is < open, only allow sells below the close on red candles. raise ValueError("Opening candle ROI on red candles.")