
이 전략은 평균선, MACD 및 RSI의 여러 지표에 기반한 트렌드 추적 거래 시스템이다. 그것은 빠른 지수 이동 평균 ((EMA) 와 느린 EMA의 교차로로 시장의 흐름을 식별하고 RSI 초과 구매 신호와 MACD 트렌드 확인을 결합하여 진입 시점을 찾는다. 전략은 주로 외환 시장을 대상으로 설계되어 여러 기술 지표의 조합으로 거래의 정확성과 신뢰성을 높인다.
전략은 50주기 및 200주기 이중 EMA 시스템을 주요 트렌드 판단 근거로 사용합니다. 빠른 EMA ((50주기) 에 느린 EMA ((200주기) 를 통과하면 상승 추세로 판단됩니다. 반대로 하향 추세입니다. 트렌드 방향을 확인 한 후, 전략은 14주기 RSI 지표와 12/26/9 파라미터를 설정 한 MACD 지표를 보조 확인 신호로 사용합니다. 구체적인 거래 규칙은 다음과 같습니다.
이것은 합리적이고 논리적으로 명확한 트렌드 추적 전략을 설계하고, 여러 가지 기술 지표의 조합을 통해 시장 추세를 더 잘 파악할 수 있습니다. 전략의 장점은 안정적인 트렌드 추적 능력과 명확한 신호 시스템이지만, 동시에 신호 지연 및 시장 환경에 대한 강한 의존성의 문제가 있습니다. 제안 된 최적화 방향으로 전략은 안정성을 유지하면서 적응력과 수익성을 더욱 향상시킬 수 있습니다.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-10 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/
// © YDMykael
//@version=6
//@version=5
strategy("TrendScalp Bot", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// Inputs for indicators
fastEMA = input.int(50, title="Fast EMA")
slowEMA = input.int(200, title="Slow EMA")
rsiPeriod = input.int(14, title="RSI Period")
macdFast = input.int(12, title="MACD Fast Length")
macdSlow = input.int(26, title="MACD Slow Length")
macdSignal = input.int(9, title="MACD Signal Length")
// Indicators
fastEMAValue = ta.ema(close, fastEMA)
slowEMAValue = ta.ema(close, slowEMA)
rsiValue = ta.rsi(close, rsiPeriod)
[macdLine, signalLine, _] = ta.macd(close, macdFast, macdSlow, macdSignal)
// Trend detection
isUptrend = fastEMAValue > slowEMAValue
isDowntrend = fastEMAValue < slowEMAValue
// Entry conditions
longCondition = isUptrend and rsiValue > 55 and macdLine > signalLine
shortCondition = isDowntrend and rsiValue < 45 and macdLine < signalLine
// Plot EMA
plot(fastEMAValue, color=color.blue, title="Fast EMA")
plot(slowEMAValue, color=color.red, title="Slow EMA")
// Buy/Sell signals
if (longCondition)
strategy.entry("Buy", strategy.long)
if (shortCondition)
strategy.entry("Sell", strategy.short)
// Exit on opposite signal
if (not isUptrend or not (macdLine > signalLine))
strategy.close("Buy")
if (not isDowntrend or not (macdLine < signalLine))
strategy.close("Sell")
// Alerts
alertcondition(longCondition, title="Buy Alert", message="TrendScalp Bot: Buy Signal")
alertcondition(shortCondition, title="Sell Alert", message="TrendScalp Bot: Sell Signal")