Strategy · Pine Script v6 · On the chart

DAX Germany Strategy [trugurpala]

by trugurpala

This strategy trades exponential moving average crossovers tailored for the German DAX market during Xetra session hours.

View on GitHub

GitHub stars4on the repository
Pine versionv6current
Lines of code55
Settings5inputs
LicenceMIT
Last update2 months ago3 Aug 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

55 lines of Pine Script v6 from global-markets/10_dax_germany.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

10_dax_germany.pine
//@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)

Overview

DAX Germany Strategy [trugurpala] enters long positions on bullish EMA crossovers and short positions on bearish crossovers, provided the bar falls within 09:00 to 17:30 CET. Positions are managed with ATR-based stop-loss and take-profit targets, and all open trades are closed automatically at the end of the trading session. Plots include both EMAs, entry markers, and session background shading directly on the price chart.

Details

Published by

trugurpala on GitHub

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Trend, Moving averages, Sessions & time

Markets

Indices

Timeframes

M15-H1

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

aialgorithmic-tradingclaude-codecodexcoding-agentsgithub-copilotopen-sourcepine-scriptpine-script-v6technical-analysis

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Fast EMAint9fastLen
Slow EMAint21slowLen
ATRint14atrLen
SL Multfloat1.5slMult
TP Multfloat2.5tpMult
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

257 stars

Donald - Test Logic Futures is an overlay strategy designed for intraday futures trading. It combines kernel regression functions with exponential moving averages to evaluate price retracements and entry timing. Trades are filtered by session execution windows

Strategy v5 TrendMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of Donald - Test Logic Futures

Andean Scalping

by hasnocool
106 stars

Andean Scalping is a Pine Script v5 strategy template designed for backtesting trading signals. It features session and date-range filtering, directional trade toggles for long and short entries, and optional trend filtering tools including higher-timeframe EM

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Andean Scalping

This strategy plots a 90-period simple moving average from the daily and four-hour charts plus a daily session VWAP on the price chart. It enters long when VWAP is above the daily average and the four-hour VWAP crosses above its average, and short in the oppos

Strategy v5 TrendMoving averages Repaints
Updated 3 years ago · MIT GitHub repository of 1D Bullish Buy 4H Bearish Sell Session
4 stars

This strategy executes trades on 5-minute index futures using Exponential Moving Averages, RSI, ADX, and volume filters across multiple timeframes. It supports trend pullback and VWAP reversion regimes with entry confirmation on breakout of prior high or low p

Strategy v6 TrendMean reversion
Updated yesterday · None stated GitHub repository of Lucid 100K Prop Bot (MES 5m)

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers