Indicator · Pine Script v5 · On the chart

Signal Strategy 15m

by tripolskypetr

This indicator generates trend-following trade signals on the price chart by combining moving average crossovers with multi-factor filters.

View on GitHub

GitHub stars72on the repository
Pine versionv5runs as is
Lines of code114
Settings9inputs
LicenceMIT
Last update3 days ago25 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 indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

114 lines of Pine Script v5 from packages/sidekick/content/config/source/timeframe_15m.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

timeframe_15m.pine
//@version=5
indicator("Signal Strategy 15m v1", overlay=true)

plotcandle(open, high, low, close, 
     color=close > open ? color.new(color.green, 70) : color.new(color.red, 70),
     wickcolor=color.new(color.gray, 70),
     bordercolor=color.new(color.gray, 70))


// === INPUTS ===
rsi_len = input.int(7, "RSI Length", minval=2)
ema_fast_len = input.int(5, "EMA Fast", minval=1)
ema_slow_len = input.int(13, "EMA Slow", minval=1)
ema_trend_len = input.int(50, "EMA Trend", minval=1)
atr_len = input.int(14, "ATR Length", minval=1)
vol_ma_len = input.int(20, "Volume MA Length", minval=1)

sl_mult = input.float(1.5, "SL ATR Multiplier", minval=0.5, step=0.1)
tp_mult = input.float(2.5, "TP ATR Multiplier", minval=0.5, step=0.1)
signal_valid_bars = input.int(5, "Signal Valid Bars", minval=1)

// === INDICATORS ===
rsi = ta.rsi(close, rsi_len)
ema_fast = ta.ema(close, ema_fast_len)
ema_slow = ta.ema(close, ema_slow_len)
ema_trend = ta.ema(close, ema_trend_len)
atr = ta.atr(atr_len)

// Volume filter - выше среднего
vol_ma = ta.sma(volume, vol_ma_len)
vol_spike = volume > vol_ma * 1.5

// Momentum confirmation
mom = ta.mom(close, 3)
mom_up = mom > 0
mom_down = mom < 0

// === TREND FILTER ===
trend_up = close > ema_trend and ema_fast > ema_trend
trend_down = close < ema_trend and ema_fast < ema_trend

// === ENTRY CONDITIONS ===
// Long: пересечение + RSI не перекуплен + тренд вверх + объём + momentum
long_cond = ta.crossover(ema_fast, ema_slow) and rsi > 40 and rsi < 65 and trend_up and vol_spike and mom_up

// Short: пересечение + RSI не перепродан + тренд вниз + объём + momentum  
short_cond = ta.crossunder(ema_fast, ema_slow) and rsi < 60 and rsi > 35 and trend_down and vol_spike and mom_down

// === SIGNAL MANAGEMENT ===
var int bars_since_signal = 0
var int last_signal = 0
var float entry_price = na
var float signal_atr = na

if long_cond
    last_signal := 1
    bars_since_signal := 0
    entry_price := close
    signal_atr := atr
else if short_cond
    last_signal := -1
    bars_since_signal := 0
    entry_price := close
    signal_atr := atr
else
    bars_since_signal += 1

// Signal expires faster on 15m
active_signal = bars_since_signal <= signal_valid_bars ? last_signal : 0

// === DYNAMIC SL/TP based on ATR ===
// sl = last_signal == 1 ? entry_price - signal_atr * sl_mult : last_signal == -1 ? entry_price + signal_atr * sl_mult : na
// tp = last_signal == 1 ? entry_price + signal_atr * tp_mult : last_signal == -1 ? entry_price - signal_atr * tp_mult : na

// === STATIC SL/TP for watch strategy ==
sl = last_signal == -1 ? close * 1.02 : close * 0.98
tp = last_signal == -1 ? close * 0.97 : close * 1.03

// === VISUALIZATION ===
line_color = active_signal == 1 ? color.green : active_signal == -1 ? color.red : color.gray

plot(ema_fast, "EMA Fast", color=color.new(color.blue, 50), linewidth=1)
plot(ema_slow, "EMA Slow", color=color.new(color.orange, 50), linewidth=1)
plot(ema_trend, "EMA Trend", color=color.new(color.white, 70), linewidth=2)

plotshape(long_cond, "Long", shape.triangleup, location.belowbar, color.green, size=size.small)
plotshape(short_cond, "Short", shape.triangledown, location.abovebar, color.red, size=size.small)

plot(close, "Active Signal", color=line_color, linewidth=6)

// === OUTPUTS FOR BOT ===
plot(close, "Close", display=display.data_window)
plot(active_signal, "Signal", display=display.data_window)
plot(sl, "StopLoss", display=display.data_window)
plot(tp, "TakeProfit", display=display.data_window)
plot(1440, "EstimatedTime", display=display.data_window)  // 24 hour for 15m TF

// === DEBUG: INDICATOR DUMP ===
plot(rsi, "d_RSI", display=display.data_window)
plot(ema_fast, "d_EmaFast", display=display.data_window)
plot(ema_slow, "d_EmaSlow", display=display.data_window)
plot(ema_trend, "d_EmaTrend", display=display.data_window)
plot(atr, "d_ATR", display=display.data_window)
plot(volume, "d_Volume", display=display.data_window)
plot(vol_ma, "d_VolMA", display=display.data_window)
plot(vol_spike ? 1 : 0, "d_VolSpike", display=display.data_window)
plot(mom, "d_Mom", display=display.data_window)
plot(mom_up ? 1 : 0, "d_MomUp", display=display.data_window)
plot(mom_down ? 1 : 0, "d_MomDown", display=display.data_window)
plot(trend_up ? 1 : 0, "d_TrendUp", display=display.data_window)
plot(trend_down ? 1 : 0, "d_TrendDown", display=display.data_window)
plot(long_cond ? 1 : 0, "d_LongCond", display=display.data_window)
plot(short_cond ? 1 : 0, "d_ShortCond", display=display.data_window)
plot(bars_since_signal, "d_BarsSinceSignal", display=display.data_window)

Overview

Signal Strategy 15m triggers entry alerts when fast and slow EMAs cross in the direction of a baseline trend EMA, confirmed by non-extreme RSI levels, momentum direction, and an above-average volume spike. Signals remain active for a user-defined number of bars, highlighting the price line and calculating theoretical stop-loss and take-profit levels. Designed for bot integration, it outputs signals and levels to the Data Window without executing trades directly.

Details

Published by

tripolskypetr on GitHub

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Trend, Moving averages, Oscillators & momentum, Volume

Markets

Any symbol

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

algotradingbacktestbacktestingbacktesting-strategybacktesting-trading-strategiescryptofinancefinancial-analysisframeworklibrary

Settings

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

SettingTypeDefaultVariable
RSI Lengthint7rsi_len
EMA Fastint5ema_fast_len
EMA Slowint13ema_slow_len
EMA Trendint50ema_trend_len
ATR Lengthint14atr_len
Volume MA Lengthint20vol_ma_len
SL ATR Multiplierfloat1.5sl_mult
TP ATR Multiplierfloat2.5tp_mult
Signal Valid Barsint5signal_valid_bars
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

46 stars

This overlay indicator plots a SuperTrend using a 10-period ATR with a multiplier of 3, drawing up and down stop lines and a faint trend fill on the price chart. It compares a 9-period EMA with an 18-period EMA and a 12/26/9 MACD against its signal, and it req

Indicator v5 TrendOscillators & momentum
Updated 3 years ago · None stated GitHub repository of SuperTrend + MACD + EMA

Bte Acc

by f-cksociety
11 stars

Bte Acc is a chart indicator form of the PineCoders Backtesting and Trading Engine. It seeks an entry trigger from a main or alternate entry method, then checks trade direction, filters, date range, ATR readiness, and remaining capital before filling on the ne

Indicator v5 TrendOscillators & momentum Repaints
Updated 4 years ago · MPL-2.0 GitHub repository of Bte Acc
948 stars

The Adaptive RSI Moving Average (ARSIMA) is an overlay indicator that dynamically adjusts its smoothing factor based on the Relative Strength Index (RSI). When the RSI moves toward extreme overbought or oversold conditions, the smoothing factor increases to ma

Indicator v4 Moving averagesOscillators & momentum
Updated 10 days ago · GPL-3.0 GitHub repository of Adaptive RSI Moving Average

The Momentum Setup is a multi-indicator visual tool designed for trend and momentum analysis directly on the price chart. It combines Relative Strength Index (RSI), Money Flow Index (MFI), Commodity Channel Index (CCI), Supertrend, and a 250-bar percentage cha

Indicator v5 Oscillators & momentumTrend
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup - Ankush Bajaj Momentum Investing Setup
218 stars

TradersPost Trading Checklist is an overlay indicator that evaluates a suite of popular technical conditions for long and short trade setups. It checks session-anchored VWAP, fast and slow EMA alignments and crosses, 200 SMA, RSI overbought or oversold conditi

Indicator v6 Screeners & dashboardsTrend
Updated 3 months ago · None stated GitHub repository of TradersPost Trading Checklist

More indicators

Trade Your Charts With a Regulated Broker

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

Compare brokers