//@version=6
// GBP/USD — Market Structure + EMA Filter Strategy
// Author: Ugur Pala · github.com/trugurpala/pinescriptv6
// TradingView: https://tr.tradingview.com/u/trugurpala/
//
// TR: Pivot high/low kırılması ile market structure takibi.
// EMA filtresi ile trend yönünde işlem alınır.
// Cable (GBP/USD) için London seansında en etkili.
// EN: Market structure tracking via pivot high/low breakouts.
// EMA filter ensures trading in trend direction.
// Most effective during London session for Cable.
//
// Sembol / Symbol: FX:GBPUSD / OANDA:GBPUSD
// Önerilen TF / Recommended TF: 1H, 4H
strategy("GBP/USD Market Structure [trugurpala]",
overlay = true,
initial_capital = 10000,
default_qty_type = strategy.percent_of_equity,
default_qty_value = 2,
commission_type = strategy.commission.percent,
commission_value = 0.006,
slippage = 1)
// ── Inputs ───────────────────────────────────────────────────────────────────
int pivotLen = input.int(5, "Pivot Lookback", minval=2)
int trendLen = input.int(50, "Trend EMA", minval=10)
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)
// ── London + NY Seans ─────────────────────────────────────────────────────────
bool inSession = not na(time(timeframe.period, "0700-2000", "GMT"))
// ── Calculations ─────────────────────────────────────────────────────────────
float trendEma = ta.ema(close, trendLen)
float atrVal = ta.atr(atrLen)
float pivHigh = ta.pivothigh(high, pivotLen, pivotLen)
float pivLow = ta.pivotlow(low, pivotLen, pivotLen)
var float lastPH = na
var float lastPL = na
if not na(pivHigh)
lastPH := high[pivotLen]
if not na(pivLow)
lastPL := low[pivotLen]
// Kırılma sinyalleri — trend yönünde
bool bullBreak = not na(lastPH)
and ta.crossover(close, lastPH)
and close > trendEma
and inSession
and strategy.position_size == 0
bool bearBreak = not na(lastPL)
and ta.crossunder(close, lastPL)
and close < trendEma
and inSession
and strategy.position_size == 0
// ── Entries ──────────────────────────────────────────────────────────────────
if bullBreak
strategy.entry("Long", strategy.long)
strategy.exit("Long Exit", "Long",
stop = close - slMult * atrVal,
limit = close + tpMult * atrVal)
if bearBreak
strategy.entry("Short", strategy.short)
strategy.exit("Short Exit", "Short",
stop = close + slMult * atrVal,
limit = close - tpMult * atrVal)
// ── Visuals ──────────────────────────────────────────────────────────────────
plot(trendEma, "Trend EMA", color.new(color.orange, 20), linewidth=2)
plotshape(not na(pivHigh), "Pivot High", shape.triangledown,
location.abovebar, color.new(color.red, 40), size=size.tiny)
plotshape(not na(pivLow), "Pivot Low", shape.triangleup,
location.belowbar, color.new(color.green, 40), size=size.tiny)
plotshape(bullBreak, "Long", shape.triangleup, location.belowbar, color.green, size=size.normal)
plotshape(bearBreak, "Short", shape.triangledown, location.abovebar, color.red, size=size.normal)
bgcolor(not inSession ? color.new(color.gray, 96) : na)
// ── Alerts (alert() — strategy içinde çalışır) ───────────────────────────────
if bullBreak
alert("GBP/USD Structure Break Long — " + str.tostring(close, "#.#####"), alert.freq_once_per_bar)
if bearBreak
alert("GBP/USD Structure Break Short — " + str.tostring(close, "#.#####"), alert.freq_once_per_bar)
Overview
GBP/USD Market Structure [trugurpala] enters long when price crosses above the last pivot high while above a trend EMA, and short when price crosses below the last pivot low while below that EMA. Entries occur only during the London and New York window and only when the position is flat. ATR multiples set the stop and the take-profit. Pivot lookback, EMA length, ATR length, and those multiples are adjustable. It draws on the price chart. Comments recommend the one-hour and four-hour charts.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Pivot Lookback
int
5
pivotLen
Trend EMA
int
50
trendLen
ATR
int
14
atrLen
SL Mult
float
1.5
slMult
TP Mult
float
2.5
tpMult
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.
This strategy executes trades based on a combination of Smart Money Concepts, including Inverse Fair Value Gaps (IFVG) and Change in State of Delivery (CISD) structure breaks. Entries require confluence between IFVG flips, structural CISD breaks, a 20-period e
This futures trading strategy combines Fair Value Gap (FVG) detection filtered by Average True Range (ATR) with multi-timeframe Exponential Moving Averages (8, 55, and 165 lengths). It identifies entry setups during a defined intraday trading session window wh
This strategy enters long or short on the price chart when price is on the correct side of a 200-period EMA, MACD agrees, RSI is not at the opposing extreme, ADX exceeds a threshold, volume beats a 20-bar average, and close breaks the recent high or low. A tim
This strategy evaluates breakout and trend opportunities on the price chart using a weighted composite score of volume, trend, and candlestick structure. It tracks volume spikes, fast and slow EMAs, higher-timeframe EMA trend alignment, opening ranges, and ses
This strategy trades Nikkei 225 futures during a configurable overnight session, defaulting to 19:00–03:00 ET. It builds long and short trend conditions from an 8/21 EMA pair and a 200-period SMA, with RSI, momentum, an ATR-scaled breakout range, and a volume
This ICT-based strategy trades during the 9:45 AM to 10:15 AM New York session window. It calculates a daily bias using a 20-period daily EMA and tracks previous day highs and lows to identify liquidity sweeps. The script refines order block entry levels and m