
이 전략은 무작위적으로 비교적 약한 지표 ((Stochastic RSI) 와 이동 평균 ((Moving Average) 을 결합한 트렌드 추적 거래 시스템이다. 이 전략은 이 두 가지 기술 지표의 교차 신호를 분석하여 시장 경향의 전환점을 결정하여 잠재적인 거래 기회를 잡는다. 이 전략은 여러 지표의 교차 검증 방식을 채택하여 가짜 신호의 간섭을 효과적으로 줄이고 거래의 정확성을 향상시킵니다.
전략의 핵심 논리는 두 가지 주요 지표 시스템에 기반합니다.
이 전략은 무작위적으로 비교적 강한 지표와 이동 평균 시스템을 결합하여 비교적 완전한 트렌드 추적 거래 시스템을 구축한다. 이 전략의 장점은 가짜 신호의 간섭을 효과적으로 줄일 수 있는 여러 지표의 교차 검증 메커니즘에 있다. 그러나 동시에 위험 관리에 주의를 기울여야 한다.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-25 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Quantuan_Research
//@version=6
version=6
strategy("Quantuan Research - Alpha", overlay=true, pyramiding=200, default_qty_value=1)
// Define Stochastic RSI settings
lengthRSI = input(17, title="RSI Length")
lengthStoch = input(20, title="Stochastic Length")
src = input(close, title="Source")
rsi = ta.rsi(src, lengthRSI)
k = ta.stoch(rsi, rsi, rsi, lengthStoch)
d = ta.sma(k, 3)
// Define MA settings
fastMALength = input(10, title="Fast MA Length")
slowMALength = input(20, title="Slow MA Length")
fastMA = ta.sma(close, fastMALength)
slowMA = ta.sma(close, slowMALength)
// Define long and short conditions
longCondition = k < 17 and d < 23 and k > d
shortCondition = k > 99 and d > 90 and k < d
// Create long and short signals
if longCondition//@
strategy.entry("Long", strategy.long)
if shortCondition
strategy.entry("Short", strategy.short)
// Add alerts for long and short signals
alertcondition(longCondition, title="Long Signal", message="Long signal generated")
alertcondition(shortCondition, title="Short Signal", message="Short signal generated")
// Plot Moving Averages with color based on trend
plot(fastMA, color = fastMA > slowMA ? color.new(color.rgb(0, 255, 170), 0) : color.new(color.rgb(255, 0, 0), 0), title = 'Fast MA')
plot(slowMA, color = color.new(color.rgb(255, 255, 0), 0), title = 'Slow MA')