//@version=6
// DAX / FDAX Germany Strategy
// github.com/trugurpala/pinescriptv6 — Author: Ugur Pala
//
// TR: Semboller: XETR:DAX (index) / EUREX:FDAX1! (futures)
// EN: Symbols: XETR:DAX (index) / EUREX:FDAX1! (futures)
//
// Seans / Session: 09:00–17:30 CET (08:00–16:30 GMT)
// Avrupalı trade için ideal — NYSE açılışından etkilenir
// Ideal for European traders — influenced by NYSE open
strategy("DAX Germany Strategy [trugurpala]",
overlay = true,
initial_capital = 25000,
default_qty_type = strategy.fixed,
default_qty_value = 1,
commission_type = strategy.commission.cash_per_contract,
commission_value = 5.0,
slippage = 2)
// ── Inputs ───────────────────────────────────────────────────────────────────
int fastLen = input.int(9, "Fast EMA", minval=1)
int slowLen = input.int(21, "Slow EMA", minval=1)
int atrLen = input.int(14, "ATR", minval=1)
float slMult = input.float(1.5, "SL Mult", step=0.1)
float tpMult = input.float(2.5, "TP Mult", step=0.1)
// ── Xetra Seans: 09:00–17:30 CET ─────────────────────────────────────────────
bool inSession = not na(time(timeframe.period, "0900-1730", "Europe/Berlin"))
bool sesEnd = inSession[1] and not inSession
if sesEnd
strategy.close_all(comment="Xetra Close")
// ── Hesaplamalar ──────────────────────────────────────────────────────────────
float fastEma = ta.ema(close, fastLen)
float slowEma = ta.ema(close, slowLen)
float atrVal = ta.atr(atrLen)
bool bullCross = ta.crossover(fastEma, slowEma) and inSession
bool bearCross = ta.crossunder(fastEma, slowEma) and inSession
// ── Entries ──────────────────────────────────────────────────────────────────
if bullCross
strategy.entry("Long", strategy.long)
strategy.exit("Long Exit", "Long",
stop=close - slMult*atrVal, limit=close + tpMult*atrVal)
if bearCross
strategy.entry("Short", strategy.short)
strategy.exit("Short Exit", "Short",
stop=close + slMult*atrVal, limit=close - tpMult*atrVal)
// ── Visuals ──────────────────────────────────────────────────────────────────
bgcolor(inSession ? na : color.new(color.gray, 96))
plot(fastEma, "Fast", fastEma > slowEma ? color.green : color.red, linewidth=2)
plot(slowEma, "Slow", fastEma > slowEma ? color.lime : color.orange, linewidth=2)
plotshape(bullCross, "Long", shape.triangleup, location.belowbar, color.green)
plotshape(bearCross, "Short", shape.triangledown, location.abovebar, color.red)