
이 전략은 무작위 느린 지표 (Stochastic Slow Oscillator) 를 기반으로 한 거래 전략이며, 이동 평균 (Moving Average), 상대적으로 약한 지수 (RSI) 및 인공지능 (AI) 기술을 결합합니다. 이 전략은 무작위 느린 지표의 교차 신호를 통해 판단하며, 200 일 이동 평균에 대한 가격의 위치와 인공지능 모델에서 생성 된 신호를 고려하여 구매 신호를 결정합니다.
이 전략은 무작위 느린 지표, 이동 평균, 상대적으로 강한 지표와 인공 지능 기술을 결합하여 다중 요소 거래 전략을 구성한다. 전략은 무작위 지표를 사용하여 과매도 과매도 신호를 캡처하고, 트렌드 필터와 지능화 신호를 사용함으로써 전략의 안정성과 적응력을 향상시킨다. 전략에는 지표 실패와 모델 불확실성과 같은 특정 위험이 있지만, 지표 매개 변수를 최적화하고, 인공 지능 모델을 개선하고, 동적 위험 관리 조치 방법을 채택함으로써 전략의 성능과 위험 제어 능력을 더욱 향상시킬 수 있다.
/*backtest
start: 2024-03-12 00:00:00
end: 2024-04-11 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Stochastic Slow Strategy with More Entries and AI", overlay=true)
length = input.int(30, minval=1)
OverBought = input(40)
OverSold = input(19)
smoothK = input.int(18, minval=1)
smoothD = input.int(7, minval=1)
minKValue = input(12, title="Minimum K Value")
// Stochastic calculations
k = ta.sma(ta.stoch(close, high, low, length), smoothK)
d = ta.sma(k, smoothD)
co = ta.crossover(k, d)
cu = ta.crossunder(k, d)
// Trend filter (200-period simple moving average)
ema200 = ta.sma(close, 200)
// Define la función para calcular la señal de la red neuronal recurrente
rnn_signal(price_series) =>
// Aquí implementa tu modelo de red neuronal recurrente para generar la señal
// Puedes usar bibliotecas externas o implementar tu propio modelo aquí
// Ejemplo de señal aleatoria
signal = ta.rsi(price_series, 14) > 50 ? 1 : -1
// Devuelve la señal generada por la red neuronal recurrente
signal
// Calcula la señal utilizando la función definida anteriormente
ai_signal = rnn_signal(close)
// Entry conditions
longCondition = ta.crossover(close, ema200) and k < OverSold and k > minKValue and ai_signal == 1
shortCondition = ta.crossunder(close, ema200) and k > OverBought and k > minKValue and ai_signal == -1
if (not na(k) and not na(d))
if (co and k < OverSold and k > minKValue)
strategy.entry("LONG", strategy.long, comment="LONG")
strategy.exit("ExitLong", "LONG", profit = close * 500, loss = close * 200)
if (cu and k > OverBought and k > minKValue)
strategy.entry("SHORT", strategy.short, comment="SHORT")
strategy.exit("ExitShort", "SHORT", profit = close * 500, loss = close * 200)
if (longCondition)
strategy.entry("LongEntry", strategy.long, comment="LongEntry")
strategy.exit("ExitLongEntry", "LongEntry", profit = close * 500, loss = close * 200)
if (shortCondition)
strategy.entry("ShortEntry", strategy.short, comment="ShortEntry")
strategy.exit("ExitShortEntry", "ShortEntry", profit = close * 500, loss = close * 200)
// Plotting
plot(ema200, color=color.blue, title="200 SMA")