//version=5
strategy("Onursal 4H Stratejisi 🚀 (TR Etiketli)", overlay=true,
margin_long=100, margin_short=100,
default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// ==== Parametreler ====
emaLength = input.int(200, "EMA Uzunluğu")
rsiLength = input.int(14, "RSI Periyodu")
rsiBuy = input.int(45, "RSI AL Eşiği", minval=1, maxval=99)
rsiSell = input.int(55, "RSI SAT Eşiği", minval=1, maxval=99)
slPct = input.float(2.0, "Stop Loss %", step=0.1)
tpPct = input.float(4.0, "Take Profit %", step=0.1)
// ==== İndikatörler ====
ema = ta.ema(close, emaLength)
rsi = ta.rsi(close, rsiLength)
// ==== Sinyaller ====
longSignal = close > ema and rsi < rsiBuy
shortSignal = close < ema and rsi > rsiSell
// ==== Pozisyon bazlı SL/TP ====
inLong = strategy.position_size > 0
inShort = strategy.position_size < 0
avg = strategy.position_avg_price
longStop = inLong ? avg * (1 - slPct/100) : na
longLimit = inLong ? avg * (1 + tpPct/100) : na
shortStop = inShort ? avg * (1 + slPct/100) : na
shortLimit= inShort ? avg * (1 - tpPct/100) : na
if (longSignal and not inLong)
strategy.entry("AL", strategy.long)
if (shortSignal and not inShort)
strategy.entry("SAT", strategy.short)
strategy.exit("TP/SL AL", from_entry="AL", stop=longStop, limit=longLimit)
strategy.exit("TP/SL SAT", from_entry="SAT", stop=shortStop, limit=shortLimit)
// ==== Görseller ====
plot(ema, color=color.orange, title="EMA 200")
plotshape(longSignal, title="AL", style=shape.triangleup, color=color.green, size=size.large, location=location.belowbar, text="AL")
plotshape(shortSignal, title="SAT", style=shape.triangledown, color=color.red, size=size.large, location=location.abovebar, text="SAT")
// ---- Türkçe durum etiketleri ----
trendUp = close > ema
trendDown = close < ema
dipBuy = trendDown and rsi <= (rsiBuy - 5)
holdCond = trendUp and rsi > rsiBuy and rsi < 70
waitCond = trendDown and rsi < rsiSell
if (dipBuy)
label.new(bar_index, low, "DİP AL 🟣", style=label.style_label_up, color=color.purple, textcolor=color.white)
else if (holdCond)
label.new(bar_index, close, "TUT 🔵", style=label.style_label_left, color=color.blue, textcolor=color.white)
else if (waitCond)
label.new(bar_index, close, "BEKLE 🟠", style=label.style_label_left, color=color.orange, textcolor=color.white)
else if (rsi >= 70 and trendUp)
label.new(bar_index, high, "YÜKSEK SAT 🔴", style=label.style_label_down, color=color.red, textcolor=color.white)
strategy("Onursal 4H Stratejisi 🚀 (TR Etiketli)", overlay=true,
margin_long=100, margin_short=100,
default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// ==== Parametreler ====
emaLength = input.int(200, "EMA Uzunluğu")
rsiLength = input.int(14, "RSI Periyodu")
rsiBuy = input.int(45, "RSI AL Eşiği", minval=1, maxval=99)
rsiSell = input.int(55, "RSI SAT Eşiği", minval=1, maxval=99)
slPct = input.float(2.0, "Stop Loss %", step=0.1)
tpPct = input.float(4.0, "Take Profit %", step=0.1)
// ==== İndikatörler ====
ema = ta.ema(close, emaLength)
rsi = ta.rsi(close, rsiLength)
// ==== Sinyaller ====
longSignal = close > ema and rsi < rsiBuy
shortSignal = close < ema and rsi > rsiSell
// ==== Pozisyon bazlı SL/TP ====
inLong = strategy.position_size > 0
inShort = strategy.position_size < 0
avg = strategy.position_avg_price
longStop = inLong ? avg * (1 - slPct/100) : na
longLimit = inLong ? avg * (1 + tpPct/100) : na
shortStop = inShort ? avg * (1 + slPct/100) : na
shortLimit= inShort ? avg * (1 - tpPct/100) : na
if (longSignal and not inLong)
strategy.entry("AL", strategy.long)
if (shortSignal and not inShort)
strategy.entry("SAT", strategy.short)
strategy.exit("TP/SL AL", from_entry="AL", stop=longStop, limit=longLimit)
strategy.exit("TP/SL SAT", from_entry="SAT", stop=shortStop, limit=shortLimit)
// ==== Görseller ====
plot(ema, color=color.orange, title="EMA 200")
plotshape(longSignal, title="AL", style=shape.triangleup, color=color.green, size=size.large, location=location.belowbar, text="AL")
plotshape(shortSignal, title="SAT", style=shape.triangledown, color=color.red, size=size.large, location=location.abovebar, text="SAT")
// ---- Türkçe durum etiketleri ----
trendUp = close > ema
trendDown = close < ema
dipBuy = trendDown and rsi <= (rsiBuy - 5)
holdCond = trendUp and rsi > rsiBuy and rsi < 70
waitCond = trendDown and rsi < rsiSell
if (dipBuy)
label.new(bar_index, low, "DİP AL 🟣", style=label.style_label_up, color=color.purple, textcolor=color.white)
else if (holdCond)
label.new(bar_index, close, "TUT 🔵", style=label.style_label_left, color=color.blue, textcolor=color.white)
else if (waitCond)
label.new(bar_index, close, "BEKLE 🟠", style=label.style_label_left, color=color.orange, textcolor=color.white)
else if (rsi >= 70 and trendUp)
label.new(bar_index, high, "YÜKSEK SAT 🔴", style=label.style_label_down, color=color.red, textcolor=color.white)
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
