Indicator · Pine Script v4 · On the chart

2 EMAs + RSI + Stochastic

by krosenfeld7

This indicator overlays trend and momentum signals directly on the price chart.

View on GitHub

GitHub stars5on the repository
Pine versionv4older, still runs
Lines of code34
Settings0inputs
LicenceApache-2.0
Last update3 years ago12 May 2023

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

34 lines of Pine Script v4 from 2_EMA+RSI+Stochastic/2_EMA+RSI+Stochastic.txt, published under Apache-2.0. Keep the author's credit and licence lines when you reuse it.

2_EMA+RSI+Stochastic.txt
//@version=4
// EMA Section
study(title="2 EMAs + RSI + Stochastic", shorttitle="2 EMAs + RSI + Stochastic", overlay=true)

ema50  = ema(close, 50)
ema200 = ema(close, 200)

emaLong  = ema50 > ema200 and close > ema50
emaShort = ema50 < ema200 and close < ema50

k = sma(stoch(close, high, low, 14), 3)
d = sma(k, 3)

stoLong  = crossover(k, d)
stoShort = crossover(d, k)

up = rma(max(change(close), 0), 14)
down = rma(-min(change(close), 0), 14)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))

rsiLong  = rsi < 50
rsiShort = rsi > 50

long  = emaLong  and stoLong  and rsiLong
short = emaShort and stoShort and rsiShort

if long
    label.new(x = bar_index, y = na, text = "Long", yloc = yloc.abovebar, color = color.green)
if short
    label.new(x = bar_index, y = na, text = "Short", yloc = yloc.abovebar, color = color.red)

// Alerts
alertcondition(long, title = "Long Signal", message = "Long @ {{timenow}}: {{ticker}} -> {{interval}}: {{close}}")
alertcondition(short, title = "Short Signal", message = "Short @ {{timenow}}: {{ticker}} -> {{interval}}: {{close}}")

Overview

2 EMAs + RSI + Stochastic calculates fifty-period and two-hundred-period exponential moving averages, a fourteen-period Stochastic oscillator smoothed with three-period simple moving averages, and a fourteen-period Relative Strength Index. Long and short signals trigger when price alignment with moving averages coincides with a Stochastic crossover and an RSI directional threshold. When triggered, the script places colored labels above bars and issues alerts. All indicator periods are hardcoded without configurable input settings, and the script contains no exit rules.

Details

Published by

krosenfeld7 on GitHub

Type

Indicator, Pine Script v4

Draws

On the price chart

Category

Trend, Oscillators & momentum, Moving averages

Markets

Any symbol

Timeframes

Any timeframe

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.

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

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
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

Daily Trend Filter

by agutinbaigo28
147 stars

Calculates market regime conditions by combining RSI, MACD, and ADX/DMI indicators. It evaluates whether the market is in a strong bullish, strong bearish, neutral, or non-trending regime. The script plots a colored line overlaying the close price to reflect t

Indicator v5 TrendOscillators & momentum
Updated 6 weeks ago · MIT GitHub repository of Daily Trend Filter

AAPP

by capissimo
114 stars

This indicator plots an adaptive moving average or scaled RSI divergence line directly on the price chart. It calculates dual RSI series to measure momentum divergence, scales the values to the chart's price range, and constructs an adaptive average filtered b

Indicator v4 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of AAPP

Signal Strategy 15m

by tripolskypetr
72 stars

This indicator generates trend-following trade signals on the price chart by combining moving average crossovers with multi-factor filters. It triggers entry alerts when fast and slow EMAs cross in the direction of a baseline trend EMA, confirmed by non-extrem

Indicator v5 TrendMoving averages
Updated 3 days ago · MIT GitHub repository of Signal Strategy 15m
56 stars

Double Screened Decision is a multi-timeframe trend and momentum indicator overlaid directly on the price chart. It dynamically selects a higher timeframe based on the active chart resolution to evaluate higher-timeframe MACD, Bollinger Bands, RSI, and Stochas

Indicator v5 TrendMoving averages Repaints
Updated 4 months ago · None stated GitHub repository of Double Screened Decision

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