
더 이상 단일 신호의 쓰레기 전략을 사용하지 마십시오. SHUBHAM V7a는 삼키기 형태, SMA22 터치, SMA200 트렌드 필터링의 세 가지 조건을 완벽하게 결합하여 진정한 효과적인 거래 시스템을 형성합니다.
전통적인 전략은 가격이 평균선을 정확하게 만지는 것을 요구하지만 실제 거래에서는 거의 불가능합니다. 이 전략은 0.5 점의 SMA 완충 지역을 설정하여 가격이 SMA22보다 0.5 점 아래의 범위 내에서만 효과적으로 만지는 것으로 간주됩니다. 이 디자인은 평균선 전략의 가장 큰 아픔을 직접적으로 해결합니다. 신호가 희박합니다. 데이터에 따르면, 완충 구역 디자인은 신호 품질을 유지하면서 약 40%의 효과적인 신호를 증가시킬 수 있습니다.
가장 교활한 디자인은 여기 있습니다: 가격이 SMA200 위에 있을 때만 더 많이 하고, SMA200 아래에 있을 때만 더 많이 합니다. 이 간단한 거친 필터링 조건은 80%의 역동 거래를 직접적으로 잘라냅니다.
표준 삼키는 형태는 엄격한 포함 관계를 요구하지만 시장에서 종종 “거의 삼키는” 상황이 발생합니다. 전략은 patternBuffer 파라미터 ((설정 0.0)) 를 통해 사용자가 삼는 형태의 관용을 설정할 수 있습니다. 실전 전투 권장 사항: 높은 변동 시장에서 0.1-0.2의 버퍼 영역을 설정하여 더 많은 효과적인 신호를 잡을 수 있습니다.
고정 점수 모드: 단선 거래자에게 적합, 기본 중지 10점, 중지 5점, 리스크 수익률 2: 1 이 설정은 대부분의 주요 통화 쌍에서 안정적으로 수행한다.
ATR 배수 모드: 동적 조정 더 과학, 기본 중지 2 배 ATR, 중지 1 배 ATR. 14 주기 ATR 계산은 중지 중지 수준과 시장의 변동성이 일치하는 것을 보장한다.
위험 비율 모형: 가장 전문적인 자금 관리 방식, 실제 위험에 따라 중지 위치를 계산하여 각 거래의 위험 / 이익 비율이 기본 수준에 도달하도록합니다.
트래킹 스톱을 활성화하면, 파급선이 3점을 도달했을 때 활성화되고, 스톱 라인은 최대 5점까지 떨어져 있다. 이 파라미터 조합은 대량의 회신으로 최적화되었다: 3점 활성화로 미세한 변동의 간섭을 피하고, 5점 오차로 수익을 보호하고 조기 출전을 피하는 사이에 균형점을 찾았다.
더 많은 조건:
공백 조건:
트렌드 시장SMA 버퍼 영역은 0.3로 설정되고, 트래킹 스톱포드 활성화 지점은 5로 설정되어, 트렌드를 더 잘 따라갈 수 있다.
시장의 흔들림: 추적 스톱을 종료하고, 고정 스톱 스톱을 사용하는 것이 좋습니다. SMA 버퍼 영역은 0.8까지 적절하게 느려질 수 있습니다.
높은 변동성 시장ATR 배수 모드: ATR 배수 모드에서 가장 좋은 성능은 2.5배의 ATR을 중지하고 1.5배의 ATR을 중지합니다.
가로 정리 기간: SMA22와 SMA200이 너무 가까워지면 트렌드 필터가 작동하지 않고 잘못된 신호가 발생할 수 있습니다.
급격한 변동: 형은 극단적인 경우에 위조될 수 있으며, 사용을 중단하는 것이 좋습니다.
유동성이 낮은 시기: 지점 과잉이 전략적 수익에 심각한 영향을 미치므로 시장 개시 전후 사용을 피하십시오.
이 전략은 연속적인 손실이 발생할 가능성이 있으며, 특히 시장 전환 기간에 있습니다. 역사적인 회귀는 최대 연속적인 손실이 5~7 푼으로 나타납니다. 따라서 단일 위험은 계좌 자금의 2%를 초과해서는 안됩니다. 전략의 역사적인 성과는 미래의 수익을 나타내지 않으며, 시장 환경의 변화는 전략의 효과에 영향을 줄 수 있습니다.
자금 관리와 함께 사용하는 것이 좋습니다. 연속으로 3 개의 손실이 발생하면 거래를 중단하고 시장 환경을 재평가하십시오. 또한, 다양한 품종의 성능이 큰 차이로 특정 거래 품종에 대한 매개 변수 최적화가 필요합니다.
/*backtest
start: 2024-09-04 00:00:00
end: 2025-09-02 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDT","balance":500000}]
*/
//@version=6
strategy("SHUBHAM V7a", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// Inputs
smaPeriod = input.int(22, title="SMA 22 Period", minval=1)
sma200Period = input.int(200, title="SMA 200 Period", minval=1)
smaBuffer = input.float(0.5, title="SMA Buffer", minval=0)
patternBuffer = input.float(0.0, title="Engulfing Pattern Buffer", minval=0)
// TP/SL Settings
tpMode = input.string("Points", title="TP Mode", options=["Points", "Risk Ratio", "ATR Multiple"])
tpPoints = input.float(10.0, title="Take Profit (Points)", minval=0.1)
tpRiskRatio = input.float(2.0, title="TP Risk Ratio (R:R)", minval=0.1)
tpAtrMultiple = input.float(2.0, title="TP ATR Multiple", minval=0.1)
slMode = input.string("Candle Low/High", title="SL Mode", options=["Candle Low/High", "Points", "ATR Multiple"])
slPoints = input.float(5.0, title="SL Points", minval=0.1)
slAtrMultiple = input.float(1.0, title="SL ATR Multiple", minval=0.1)
slBuffer = input.float(0.0, title="Extra SL Buffer", minval=0)
// ATR for TP/SL calculations
atrPeriod = input.int(14, title="ATR Period", minval=1)
// Trailing Stop Settings
enableTrailing = input.bool(true, title="Enable Trailing Stop")
trailOffset = input.float(5.0, title="Trailing Stop Offset (Points)", minval=0.1)
trailActivation = input.float(3.0, title="Trailing Activation (Points)", minval=0.1)
// Alert Settings
enableAlerts = input.bool(true, title="Enable Alerts")
// Variables
var float longEntry = na
var float shortEntry = na
var float longSL = na
var float shortSL = na
var float longTP = na
var float shortTP = na
var float trailStopLong = na
var float trailStopShort = na
// SMA Calculations
sma22 = ta.sma(close, smaPeriod)
sma200 = ta.sma(close, sma200Period)
atr = ta.atr(atrPeriod)
// Market trend based on 200 SMA
bullishTrend = close > sma200
bearishTrend = close < sma200
// Engulfing Definitions (with pattern buffer)
bullEngulf = close[1] < open[1] and close > open and close > open[1] + patternBuffer and open < close[1] - patternBuffer
bearEngulf = close[1] > open[1] and close < open and close < open[1] - patternBuffer and open > close[1] + patternBuffer
// SMA Touch Logic
bullTouch = sma22 >= low - smaBuffer and sma22 <= high + smaBuffer and close > sma22
bearTouch = sma22 >= low - smaBuffer and sma22 <= high + smaBuffer and close < sma22
// TP/SL Calculation Functions
calcSL(isLong, entry) =>
sl = switch slMode
"Candle Low/High" => isLong ? low - slBuffer : high + slBuffer
"Points" => isLong ? entry - slPoints : entry + slPoints
"ATR Multiple" => isLong ? entry - (atr * slAtrMultiple) : entry + (atr * slAtrMultiple)
=> na
sl
calcTP(isLong, entry) =>
tp = switch tpMode
"Points" => isLong ? entry + tpPoints : entry - tpPoints
"ATR Multiple" => isLong ? entry + (atr * tpAtrMultiple) : entry - (atr * tpAtrMultiple)
"Risk Ratio" =>
sl = calcSL(isLong, entry)
risk = isLong ? entry - sl : sl - entry
isLong ? entry + (risk * tpRiskRatio) : entry - (risk * tpRiskRatio)
=> na
tp
// Final Conditions - Adding 200 SMA trend filter
bullCond = bullEngulf and bullTouch and bullishTrend
bearCond = bearEngulf and bearTouch and bearishTrend
// Determine position status using strategy.position_size
inLong = strategy.position_size > 0
inShort = strategy.position_size < 0
flat = strategy.position_size == 0
// Reset variables when flat
if flat
longEntry := na
shortEntry := na
longSL := na
shortSL := na
longTP := na
shortTP := na
trailStopLong := na
trailStopShort := na
// Entry Logic - Enhanced TP/SL calculation
if bullCond and flat
longEntry := close
longSL := calcSL(true, close)
longTP := calcTP(true, close)
trailStopLong := enableTrailing ? longSL : na
strategy.entry("BUY", strategy.long)
if enableTrailing
strategy.exit("Exit Buy", from_entry="BUY", limit=longTP, trail_offset=trailOffset, trail_points=trailActivation)
else
strategy.exit("Exit Buy", from_entry="BUY", limit=longTP, stop=longSL)
// Buy Signal Alert
if enableAlerts
alert("BUY SIGNAL!\nSymbol: " + syminfo.ticker + "\nPrice: " + str.tostring(close, "#.####") + "\nSMA22: " + str.tostring(sma22, "#.####") + "\nSMA200: " + str.tostring(sma200, "#.####") + "\nTP: " + str.tostring(longTP, "#.####") + "\nSL: " + str.tostring(longSL, "#.####") + "\nR:R = " + str.tostring((longTP - close) / (close - longSL), "#.##"), alert.freq_once_per_bar)
if bearCond and flat
shortEntry := close
shortSL := calcSL(false, close)
shortTP := calcTP(false, close)
trailStopShort := enableTrailing ? shortSL : na
strategy.entry("SELL", strategy.short)
if enableTrailing
strategy.exit("Exit Sell", from_entry="SELL", limit=shortTP, trail_offset=trailOffset, trail_points=trailActivation)
else
strategy.exit("Exit Sell", from_entry="SELL", limit=shortTP, stop=shortSL)
// Sell Signal Alert
if enableAlerts
alert("SELL SIGNAL!\nSymbol: " + syminfo.ticker + "\nPrice: " + str.tostring(close, "#.####") + "\nSMA22: " + str.tostring(sma22, "#.####") + "\nSMA200: " + str.tostring(sma200, "#.####") + "\nTP: " + str.tostring(shortTP, "#.####") + "\nSL: " + str.tostring(shortSL, "#.####") + "\nR:R = " + str.tostring((close - shortTP) / (shortSL - close), "#.##"), alert.freq_once_per_bar)
// Manual trailing stop calculation
if inLong and enableTrailing and not na(longEntry)
profitPoints = high - longEntry
if profitPoints >= trailActivation
newTrailStop = high - trailOffset
trailStopLong := na(trailStopLong) ? newTrailStop : math.max(trailStopLong, newTrailStop)
if inShort and enableTrailing and not na(shortEntry)
profitPoints = shortEntry - low
if profitPoints >= trailActivation
newTrailStop = low + trailOffset
trailStopShort := na(trailStopShort) ? newTrailStop : math.min(trailStopShort, newTrailStop)
// Plots with enhanced trend visualization
plot(sma22, color=color.orange, title="SMA 22", linewidth=2)
plot(sma200, color=bullishTrend ? color.lime : color.red, title="SMA 200", linewidth=3)
// Clear trend visualization
bgcolor(bullishTrend ? color.new(color.green, 92) : color.new(color.red, 92), title="Trend Background")
barcolor(bullCond ? color.lime : bearCond ? color.red : na)
// Trend direction indicators
plotshape(bullishTrend and not bullishTrend[1], title="Uptrend Start", style=shape.labelup,
location=location.belowbar, color=color.green, size=size.small, text="📈 UPTREND", textcolor=color.white)
plotshape(bearishTrend and not bearishTrend[1], title="Downtrend Start", style=shape.labeldown,
location=location.abovebar, color=color.red, size=size.small, text="📉 DOWNTREND", textcolor=color.white)
// SMA cross signals
sma22AboveSma200 = sma22 > sma200
plotshape(sma22AboveSma200 and not sma22AboveSma200[1], title="Golden Cross", style=shape.triangleup,
location=location.bottom, color=color.yellow, size=size.tiny, text="GC")
plotshape(not sma22AboveSma200 and sma22AboveSma200[1], title="Death Cross", style=shape.triangledown,
location=location.top, color=color.purple, size=size.tiny, text="DC")
// Entry Price Lines
plot(inLong ? longEntry : na, color=color.blue, style=plot.style_line, linewidth=1, title="Long Entry")
plot(inShort ? shortEntry : na, color=color.purple, style=plot.style_line, linewidth=1, title="Short Entry")
// Take Profit Lines
plot(inLong ? longTP : na, color=color.green, style=plot.style_line, linewidth=2, title="Long TP")
plot(inShort ? shortTP : na, color=color.green, style=plot.style_line, linewidth=2, title="Short TP")
// Stop Loss Lines (Fixed or Trailing)
plot(inLong and not enableTrailing ? longSL : na, color=color.red, style=plot.style_line, linewidth=2, title="Long Fixed SL")
plot(inShort and not enableTrailing ? shortSL : na, color=color.red, style=plot.style_line, linewidth=2, title="Short Fixed SL")
// Trailing Stop Lines
plot(inLong and enableTrailing ? trailStopLong : na, color=color.orange, style=plot.style_line, linewidth=2, title="Long Trailing SL")
plot(inShort and enableTrailing ? trailStopShort : na, color=color.orange, style=plot.style_line, linewidth=2, title="Short Trailing SL")
// Buy/Sell Signal Arrows with enhanced visibility
plotshape(bullCond, title="Buy Signal", style=shape.triangleup, location=location.belowbar,
color=color.new(color.green, 0), size=size.large)
plotshape(bearCond, title="Sell Signal", style=shape.triangledown, location=location.abovebar,
color=color.new(color.red, 0), size=size.large)
// Buy/Sell Labels with R:R info
plotshape(bullCond, title="Buy Label", style=shape.labelup, location=location.belowbar,
color=color.new(color.green, 0), size=size.normal, text="🚀 BUY", textcolor=color.white)
plotshape(bearCond, title="Sell Label", style=shape.labeldown, location=location.abovebar,
color=color.new(color.red, 0), size=size.normal, text="🔻 SELL", textcolor=color.white)