diff --git a/strategy/generator/bootstrap/_trend_follow.py b/strategy/generator/bootstrap/_trend_follow.py index 49dccdc0..6ba4b155 100644 --- a/strategy/generator/bootstrap/_trend_follow.py +++ b/strategy/generator/bootstrap/_trend_follow.py @@ -60,7 +60,7 @@ RsiNautralityRejectionSignal, ) from strategy.generator.signal.pattern.ao_saucer import AoSaucerSignal -from strategy.generator.signal.pattern.candle_trend import CandleTrendSignal +from strategy.generator.signal.pattern.candle_trend import CandlestickTrendSignal from strategy.generator.signal.pattern.hl import HighLowSignal from strategy.generator.signal.pattern.macd_colorswitch import MacdColorSwitchSignal from strategy.generator.signal.pattern.rsi_v import RsiVSignal @@ -346,7 +346,7 @@ def _generate_signal(self, signal: TrendSignalType): return np.random.choice( [ AoSaucerSignal(), - CandleTrendSignal(), + CandlestickTrendSignal(), HighLowSignal(), MacdColorSwitchSignal(), TiiVSignal(), @@ -360,7 +360,6 @@ def _generate_signal(self, signal: TrendSignalType): VwapBbSignal(), ] ) - if signal == TrendSignalType.FLIP: return np.random.choice( [ @@ -386,7 +385,6 @@ def _generate_signal(self, signal: TrendSignalType): DchMa2BreakoutSignal(), ] ) - if signal == TrendSignalType.REVERSAL: return np.random.choice( [ @@ -395,7 +393,6 @@ def _generate_signal(self, signal: TrendSignalType): ViReversalSignal(), ] ) - if signal == TrendSignalType.NEUTRALITY: return np.random.choice( [ @@ -405,7 +402,6 @@ def _generate_signal(self, signal: TrendSignalType): RsiNautralityRejectionSignal(), ] ) - return np.random.choice( [ RsiNautralityRejectionSignal(), diff --git a/strategy/generator/signal/pattern/candle_trend.py b/strategy/generator/signal/pattern/candle_trend.py index 239b438f..36476dce 100644 --- a/strategy/generator/signal/pattern/candle_trend.py +++ b/strategy/generator/signal/pattern/candle_trend.py @@ -6,6 +6,6 @@ @dataclass(frozen=True) -class CandleTrendSignal(Signal): - type: SignalType = SignalType.CandleTrend +class CandlestickTrendSignal(Signal): + type: SignalType = SignalType.CandlestickTrend candle: Parameter = CategoricalParameter(CandleTrendType) diff --git a/ta_lib/strategies/indicator/src/candle.rs b/ta_lib/strategies/indicator/src/candle.rs index e3472456..fe0f9232 100644 --- a/ta_lib/strategies/indicator/src/candle.rs +++ b/ta_lib/strategies/indicator/src/candle.rs @@ -23,7 +23,7 @@ pub enum CandleTrendType { THREE_ONE_TWO, } -pub fn candle_trend_indicator( +pub fn candlestick_trend_indicator( candle: &CandleTrendType, data: &OHLCVSeries, ) -> (Series, Series) { diff --git a/ta_lib/strategies/signal/src/pattern/candlestick_trend.rs b/ta_lib/strategies/signal/src/pattern/candlestick_trend.rs index 0e9c48fc..b7c81ab1 100644 --- a/ta_lib/strategies/signal/src/pattern/candlestick_trend.rs +++ b/ta_lib/strategies/signal/src/pattern/candlestick_trend.rs @@ -1,6 +1,6 @@ use base::prelude::*; use core::prelude::*; -use indicator::{candle_trend_indicator, CandleTrendType}; +use indicator::{candlestick_trend_indicator, CandleTrendType}; const DEFAULT_LOOKBACK: usize = 13; @@ -20,6 +20,6 @@ impl Signal for CandlestickTrendSignal { } fn generate(&self, data: &OHLCVSeries) -> (Series, Series) { - candle_trend_indicator(&self.candle, data) + candlestick_trend_indicator(&self.candle, data) } }