// TV_RUN_NEEDED: tv_trades.csv missing — capture in TradingView:
// Symbol: SPY TF: 5m Range: 2024-01-02..2024-03-29
// Save List of Trades → tv_trades.csv in this directory.
//@version=6
strategy("Session islastbar flatten", overlay=true,
default_qty_type=strategy.fixed, default_qty_value=1)
// Enter on SMA crossover within session; flatten all positions on the
// last bar of the session (session.islastbar) to avoid overnight holds.
if session.ismarket
if ta.crossover(ta.sma(close, 9), ta.sma(close, 21))
strategy.entry("Long", strategy.long)
// Flatten on last session bar — session.islastbar_regular == session.islastbar
// in engine (single session string; see session_time.hpp limitation comment).
if session.islastbar
strategy.close_all()
Overview
To avoid holding positions overnight, it automatically exits all open trades on the final bar of the session using the session.islastbar conditional check. The indicator plots overlays directly on the main price chart. Created as a validation probe for Pine Script engine testing, it lacks stop loss or take profit risk controls, relying strictly on session timing for position exits.
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 overlay strategy offers two selectable entry modes: a Bollinger squeeze on typical price and a simple moving-average cross. It filters trades by weekday, session, date range, and an optional news window, and can restrict direction or invert the side. Risk
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
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
This intraday strategy implements Mark Fisher's Opening Range Breakout (ORB) methodology tailored for index futures like ES and NQ. It calculates session opening ranges, volume z-scores, and VWAP bands to plot support, resistance, and confirmation levels on th
P404 Smoke is a price-chart strategy that sequences an optional higher-timeframe EMA bias, a liquidity range from recent pivots, a sweep of buy-side or sell-side liquidity, and a market structure shift within a set bar window. Comments state it then looks for
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