def get_natr_values(period: int) -> np.ndarray:
if period not in natr_values_cache:
natr_values_cache[period] = (
- ta.NATR(df, timeperiod=period).fillna(method="bfill") / 100
+ ta.NATR(df, timeperiod=period).fillna(method="bfill") / 100.0
).values
return natr_values_cache[period]
return -np.inf, -np.inf
scaled_natr_label_period_candles = (
- ta.NATR(df, timeperiod=label_period_candles).fillna(method="bfill") / 100
+ ta.NATR(df, timeperiod=label_period_candles).fillna(method="bfill") / 100.0
) * label_natr_ratio
return scaled_natr_label_period_candles.median(), n
return None
return (
current_rate
- * (current_natr / 100)
+ * (current_natr / 100.0)
* self.get_stoploss_natr_ratio(trade.pair)
* (1 / math.log10(3.75 + 0.25 * trade_duration_candles))
)
)
return (
trade.open_rate
- * (take_profit_natr / 100)
+ * (take_profit_natr / 100.0)
* self.get_take_profit_natr_ratio(trade.pair)
* math.log10(9.75 + 0.25 * trade_duration_candles)
)
return False
lower_bound = 0
upper_bound = 0
- price_deviation = (last_candle_natr / 100) * self.get_entry_natr_ratio(pair)
+ price_deviation = (last_candle_natr / 100.0) * self.get_entry_natr_ratio(pair)
if side == "long":
lower_bound = last_candle_low * (1 - price_deviation)
upper_bound = last_candle_close * (1 + price_deviation)
def get_natr_values(period: int) -> np.ndarray:
if period not in natr_values_cache:
natr_values_cache[period] = (
- ta.NATR(df, timeperiod=period).fillna(method="bfill") / 100
+ ta.NATR(df, timeperiod=period).fillna(method="bfill") / 100.0
).values
return natr_values_cache[period]