Session King - ALMA with Session Filter — Strategy by backtestbay

By backtestbay

Performance Metrics

Description

A session-gated trend strategy that restricts entries to high-liquiditysession windows using ALMA direction bias, with standardised ATR exits(3 ATR stop, 6 ATR take profit — 2R fixed).WHAT MAKES THIS ORIGINALMost trend strategies fire entries continuously throughout the trading day.This strategy gates every entry through two independent filters before asignal is accepted: a directional bias filter (ALMA) and a session timingfilter. Neither filter alone is the edge — the combination is. ALMA withoutthe session gate fires too many signals in low-liquidity periods. The sessiongate without a directional filter trades noise in both directions. Togetherthey restrict entries to directional moves inside high-liquidity windowswhere volume and participation are highest.COMPONENTSALMA (Arnaud Legoux Moving Average, length 9): Direction baseline. Priceabove ALMA = long bias; price below = short bias. ALMA applies Gaussianweighting to reduce lag compared to EMAs of equivalent length, producingfewer whipsaws at signal transitions.Session Filter (toggleable): Entries are only permitted during definedhigh-liquidity windows. London open (05:45-09:45 GMT), NY AM (12:00-16:00GMT), and NY PM (19:00-21:00 GMT) can each be toggled independently.Outside these windows the strategy does nothing. Most false signals inforex and gold occur during low-volume inter-session periods.TTM Squeeze (optional, off by default): Based on John Carter's publishedTTM Squeeze concept. Compression detection (BB inside KC) is an independentimplementation using Pine built-ins only; Keltner Channel uses ATR viaWilder's method. No momentum histogram is included — only the compressiongate is used. When Bollinger Bands contract inside the Keltner Channel themarket is in compression and entries are blocked. When BB expands backoutside the KC entries are permitted again. Enables lower-frequency,post-compression entries when toggled on.Exits: Fixed 3 ATR stop-loss and 6 ATR take-profit (2R) on every trade.Position size is calculated so that 1% of equity is risked per trade atthe 3 ATR stop distance.WHY THIS COMBINATIONALMA provides direction bias with reduced lag. The session gate ensuresentries only occur when volume and institutional participation are highest.Fixed ATR exits keep risk consistent across instruments and timeframes andallow meaningful comparison of strategy performance across different marketconditions.HOW TO USEEnable the sessions that match your instrument. London + NY AM is thedefault for forex and gold. Enable TTM Squeeze for lower-frequency,higher-conviction setups. Best suited to 4H and 1H timeframes on XAUUSD,GBPUSD, EURUSD, and major indices.DEFAULT PROPERTIESATR Length: 14 | Stop: 3x ATR | Take Profit: 6x ATR (2R) | Risk: 1%Commission: 0.01% per side | Slippage: 1 tick | Initial capital: 10,000LIMITATIONSSession filtering significantly reduces trade count. On 4H timeframesexpect 15-40 trades per year. To reach 100+ trades for a statisticallymeaningful sample, backtest a minimum of 3-5 years on 1H or 8-10 yearson 4H. Past results do not guarantee future performance.

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView