OPEN-SOURCE SCRIPT
EMA Cross 99

//version=6
indicator("EMA Strategie (Indikator mit Entry/TP/SL)", overlay=true, max_lines_count=500, max_labels_count=500)
// === Inputs ===
rrRatio = input.float(3.0, "Risk:Reward (TP/SL)", minval=1.0, step=0.5)
sess = input.session("0700-1900", "Trading Session (lokal)")
// === EMAs ===
ema9 = ta.ema(close, 9)
ema50 = ta.ema(close, 50)
ema200 = ta.ema(close, 200)
// === Session ===
inSession = not na(time(timeframe.period, sess))
// === Trend + Cross ===
bullTrend = (ema9 > ema200) and (ema50 > ema200)
bearTrend = (ema9 < ema200) and (ema50 < ema200)
crossUp = ta.crossover(ema9, ema50)
crossDown = ta.crossunder(ema9, ema50)
// === Pullback Confirm ===
longTouch = bullTrend and crossUp and (low <= ema9)
longConfirm = longTouch and (close > open) and (close > ema9)
shortTouch = bearTrend and crossDown and (high >= ema9)
shortConfirm = shortTouch and (close < open) and (close < ema9)
// === Entry Signale ===
longEntry = longConfirm and inSession
shortEntry = shortConfirm and inSession
// === SL & TP Berechnung ===
longSL = ema50
longTP = close + (close - longSL) * rrRatio
shortSL = ema50
shortTP = close - (shortSL - close) * rrRatio
// === Long Markierungen ===
if (longEntry)
// Entry
line.new(bar_index, close, bar_index+20, close, color=color.green, style=line.style_dotted, width=2)
label.new(bar_index, close, "Entry", style=label.style_label_left, color=color.green, textcolor=color.white, size=size.tiny)
// TP
line.new(bar_index, longTP, bar_index+20, longTP, color=color.green, style=line.style_solid, width=2)
label.new(bar_index, longTP, "TP", style=label.style_label_left, color=color.green, textcolor=color.white, size=size.tiny)
// SL
line.new(bar_index, longSL, bar_index+20, longSL, color=color.red, style=line.style_solid, width=2)
label.new(bar_index, longSL, "SL", style=label.style_label_left, color=color.red, textcolor=color.white, size=size.tiny)
// === Short Markierungen ===
if (shortEntry)
// Entry
line.new(bar_index, close, bar_index+20, close, color=color.red, style=line.style_dotted, width=2)
label.new(bar_index, close, "Entry", style=label.style_label_left, color=color.red, textcolor=color.white, size=size.tiny)
// TP
line.new(bar_index, shortTP, bar_index+20, shortTP, color=color.red, style=line.style_solid, width=2)
label.new(bar_index, shortTP, "TP", style=label.style_label_left, color=color.red, textcolor=color.white, size=size.tiny)
// SL
line.new(bar_index, shortSL, bar_index+20, shortSL, color=color.green, style=line.style_solid, width=2)
label.new(bar_index, shortSL, "SL", style=label.style_label_left, color=color.green, textcolor=color.white, size=size.tiny)
// === EMAs anzeigen ===
plot(ema9, "EMA 9", color=color.yellow, linewidth=1)
plot(ema50, "EMA 50", color=color.orange, linewidth=1)
plot(ema200, "EMA 200", color=color.blue, linewidth=1)
// === Alerts ===
alertcondition(longEntry, title="Long Entry", message="EMA Strategie: LONG Einstiegssignal")
alertcondition(shortEntry, title="Short Entry", message="EMA Strategie: SHORT Einstiegssignal")
indicator("EMA Strategie (Indikator mit Entry/TP/SL)", overlay=true, max_lines_count=500, max_labels_count=500)
// === Inputs ===
rrRatio = input.float(3.0, "Risk:Reward (TP/SL)", minval=1.0, step=0.5)
sess = input.session("0700-1900", "Trading Session (lokal)")
// === EMAs ===
ema9 = ta.ema(close, 9)
ema50 = ta.ema(close, 50)
ema200 = ta.ema(close, 200)
// === Session ===
inSession = not na(time(timeframe.period, sess))
// === Trend + Cross ===
bullTrend = (ema9 > ema200) and (ema50 > ema200)
bearTrend = (ema9 < ema200) and (ema50 < ema200)
crossUp = ta.crossover(ema9, ema50)
crossDown = ta.crossunder(ema9, ema50)
// === Pullback Confirm ===
longTouch = bullTrend and crossUp and (low <= ema9)
longConfirm = longTouch and (close > open) and (close > ema9)
shortTouch = bearTrend and crossDown and (high >= ema9)
shortConfirm = shortTouch and (close < open) and (close < ema9)
// === Entry Signale ===
longEntry = longConfirm and inSession
shortEntry = shortConfirm and inSession
// === SL & TP Berechnung ===
longSL = ema50
longTP = close + (close - longSL) * rrRatio
shortSL = ema50
shortTP = close - (shortSL - close) * rrRatio
// === Long Markierungen ===
if (longEntry)
// Entry
line.new(bar_index, close, bar_index+20, close, color=color.green, style=line.style_dotted, width=2)
label.new(bar_index, close, "Entry", style=label.style_label_left, color=color.green, textcolor=color.white, size=size.tiny)
// TP
line.new(bar_index, longTP, bar_index+20, longTP, color=color.green, style=line.style_solid, width=2)
label.new(bar_index, longTP, "TP", style=label.style_label_left, color=color.green, textcolor=color.white, size=size.tiny)
// SL
line.new(bar_index, longSL, bar_index+20, longSL, color=color.red, style=line.style_solid, width=2)
label.new(bar_index, longSL, "SL", style=label.style_label_left, color=color.red, textcolor=color.white, size=size.tiny)
// === Short Markierungen ===
if (shortEntry)
// Entry
line.new(bar_index, close, bar_index+20, close, color=color.red, style=line.style_dotted, width=2)
label.new(bar_index, close, "Entry", style=label.style_label_left, color=color.red, textcolor=color.white, size=size.tiny)
// TP
line.new(bar_index, shortTP, bar_index+20, shortTP, color=color.red, style=line.style_solid, width=2)
label.new(bar_index, shortTP, "TP", style=label.style_label_left, color=color.red, textcolor=color.white, size=size.tiny)
// SL
line.new(bar_index, shortSL, bar_index+20, shortSL, color=color.green, style=line.style_solid, width=2)
label.new(bar_index, shortSL, "SL", style=label.style_label_left, color=color.green, textcolor=color.white, size=size.tiny)
// === EMAs anzeigen ===
plot(ema9, "EMA 9", color=color.yellow, linewidth=1)
plot(ema50, "EMA 50", color=color.orange, linewidth=1)
plot(ema200, "EMA 200", color=color.blue, linewidth=1)
// === Alerts ===
alertcondition(longEntry, title="Long Entry", message="EMA Strategie: LONG Einstiegssignal")
alertcondition(shortEntry, title="Short Entry", message="EMA Strategie: SHORT Einstiegssignal")
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.