
이 전략은 평행선 교차 신호와 트렌드 필터를 기반으로 한 거래 시스템입니다. 단기 SMA ((9주기 및 15주기) 의 교차 신호와 장기 EMA ((200주기) 를 트렌드 필터로 결합하여 다른 시간 주기의 평행선 교차로 시장 트렌드를 포착합니다. 시스템은 또한 재입장 메커니즘을 포함하고 있으며, 트렌드가 지속될 때 재건 할 수 있습니다.
이 전략은 트리플레인 시스템을 사용하여 거래 결정을 내립니다.
이 전략은 복수의 평선 시스템과 트렌드 필터를 결합하여 전체적인 트렌드 추적 거래 시스템을 구축한다. 그것의 주요 장점은 강한 트렌드 시장에서 눈에 띄는 수익을 얻을 수 있다는 것, 동시에 평선 필터링과 재입장 메커니즘을 통해 시스템의 안정성을 높이는 것이다.
/*backtest
start: 2024-02-19 00:00:00
end: 2025-02-17 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("SMA Crossover with EMA Filter", overlay=true)
// Define indicators
sma9 = ta.sma(close, 9)
sma15 = ta.sma(close, 15)
ema200 = ta.ema(close, 200)
// Crossover conditions
bullish_crossover = ta.crossover(sma9, sma15) // Buy signal
bearish_crossover = ta.crossunder(sma9, sma15) // Sell signal
// Filters
above_ema200 = close > ema200
below_ema200 = close < ema200
// Buy condition (only above 200 EMA)
buy_signal = bullish_crossover and above_ema200
if buy_signal
strategy.entry("Buy", strategy.long)
// Sell condition (only below 200 EMA)
sell_signal = bearish_crossover and below_ema200
if sell_signal
strategy.entry("Sell", strategy.short)
// Exit condition if the signal reverses
exit_long = bearish_crossover
exit_short = bullish_crossover
if exit_long
strategy.close("Buy")
if exit_short
strategy.close("Sell")
// Re-entry condition when price crosses EMA 200 after a prior crossover
buy_reentry = ta.barssince(bullish_crossover) > 0 and above_ema200
sell_reentry = ta.barssince(bearish_crossover) > 0 and below_ema200
if buy_reentry
strategy.entry("Buy", strategy.long)
if sell_reentry
strategy.entry("Sell", strategy.short)
// Plot indicators
plot(sma9, color=color.blue, title="SMA 9")
plot(sma15, color=color.red, title="SMA 15")
plot(ema200, color=color.orange, title="EMA 200")