Strategy · Pine Script v6 · On the chart

PineForge — Borough New York Session

by pineforge-4pass· code credited to PineForge

This session-based strategy triggers long entries at the start of the New York trading session when trend and momentum conditions align.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code34
Settings3inputs
LicenceApache-2.0
Last update7 days ago23 Oct 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

34 lines of Pine Script v6 from validation/session-borough-new-york-01/strategy.pine, published under Apache-2.0. Keep the author's credit and licence lines when you reuse it.

strategy.pine
//@version=6
// SPDX-License-Identifier: Apache-2.0
// Copyright 2026 PineForge
// PineForge Owned Strategy: Borough New York Session
// An IANA New York session stays aligned through daylight-saving changes.
strategy("PineForge — Borough New York Session", overlay=true,
     initial_capital=100000,
     default_qty_type=strategy.fixed, default_qty_value=2,
     pyramiding=0, commission_type=strategy.commission.percent,
     commission_value=0.05, slippage=1,
     margin_long=100, margin_short=100,
     process_orders_on_close=false, calc_on_order_fills=false)

sessionWindow = input.session("0930-1600", "New York Session", group="Session")
trendLength = input.int(38, "Trend EMA Length", minval=5, group="Signal")
minimumRsi = input.float(52.0, "Minimum RSI", minval=20, maxval=80, step=1, group="Signal")

sessionStamp = time(timeframe.period, sessionWindow, "America/New_York")
inSession = not na(sessionStamp)
wasInSession = not na(sessionStamp[1])
sessionOpened = inSession and not wasInSession
sessionClosed = wasInSession and not inSession

trendLine = ta.ema(close, trendLength)
rsiValue = ta.rsi(close, 14)
eligibleOpen = sessionOpened and close > trendLine and rsiValue > minimumRsi

if strategy.position_size == 0 and eligibleOpen
    strategy.entry("Borough Long", strategy.long)
else if strategy.position_size > 0 and sessionClosed
    strategy.close("Borough Long", comment="New York session ended")

plot(trendLine, "Trend EMA", color=color.orange)
bgcolor(inSession ? color.new(color.blue, 92) : na, title="New York Session")

Overview

PineForge — Borough New York Session calculates a 38-period Exponential Moving Average and a 14-period RSI. A long position is taken at session open if the close is above the trend EMA and the RSI exceeds the configured minimum threshold. Positions are automatically closed at session end. The script plots the trend line on the price chart and shades the active session background. It features no stop-loss or take-profit parameters.

Details

Published by

pineforge-4pass on GitHub

Code credit

PineForge, as written in the script's header

Draws

On the price chart

Markets

Any symbol

Timeframes

M15-H1

Risk Notes

  • The strategy enters trades without a stop loss

Topics

algorithmic-tradingbacktestingparitypine-scriptpinescriptquantitative-financetest-corpustradingview

Settings

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

SettingTypeDefaultVariable
New York Sessionsession0930-1600sessionWindow
Trend EMA Lengthint38trendLength
Minimum RSIfloat52.0minimumRsi
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

106 stars

This intraday strategy enters positions based on an alignment of trend, momentum, and oscillator indicators. It triggers long entries when the Commodity Channel Index is above a positive threshold, a fast Relative Strength Index crosses above a slow RSI, price

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of CCI + EMA with RSI Cross Strategy
4 stars

This strategy calculates fast and slow exponential moving averages, the Relative Strength Index, and the Average True Range directly on the price chart. It enters long positions when the fast EMA crosses above the slow EMA with RSI above the minimum threshold

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of NQ Nasdaq Strategy [trugurpala]

Session Wicks

by g-moe
3 stars

This strategy calculates smoothed Heikin-Ashi candles alongside a moving average of the Relative Strength Index to enter trend reversals. It triggers long entries when smoothed Heikin-Ashi turns bullish while RSI trades above its moving average, and short entr

Strategy v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Session Wicks
1 stars

This intraday trading strategy combines fast, slow, and trend exponential moving averages with MACD, RSI, and ADX filters to generate trade signals during active trading sessions. It enters long positions when the fast EMA crosses above the slow EMA above the

Strategy v6 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Señales Intradía EMA + MACD v3
330 stars

2 EMA/SMA + RSI Strategy [Alorse] combines three configurable moving averages with a short-period Relative Strength Index filter. It plots fast, slow, and trend moving averages on the price chart. Long entries trigger when the fast moving average is above the

Strategy v4 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of 2 EMA/SMA + RSI Strategy [Alorse]

Acrypto - Weighted Strategy

by AlbertoCuadra
318 stars

This strategy plots on the price chart and opens long or short positions when a weighted score from MACD, Stochastic RSI, RSI, Supertrend and a moving-average crossover exceeds a user-set trigger. Each component has its own weight and candle delay. Entries can

Strategy v5 TrendOscillators & momentum
Updated 3 years ago · Custom licence GitHub repository of Acrypto - Weighted Strategy

More Sessions & time scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

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

Compare brokers