Indicator · Pine Script v5 · Own pane

Short Term Alpha Indicator

by jawauntb

Short Term Alpha Indicator calculates a weighted alpha from price change multiplied by volume, then derives EMAs at fast, medium, and slow lengths.

View on GitHub

GitHub stars3on the repository
Pine versionv5runs as is
Lines of code83
Settings0inputs
LicenceGPL-3.0
Last update2 years ago22 May 2024

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

83 lines of Pine Script v5 from short-term-alpha.pine, published under GPL-3.0. Keep the author's credit and licence lines when you reuse it.

short-term-alpha.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © jawauntb

//@version=5
indicator("Short Term Alpha indicator", shorttitle="AI", overlay=false)

// Define lengths for EMAs and other parameters
lenFast = 8
lenMedium = 30
lenSlow = 110
maPeriod = 20

// NADO parameters
length_nado = 14
mult = 1.0

// Define the weighted alpha
price_change = close - ((high + low + close) / 3)
weighted_alpha = ta.sma(price_change * volume, lenSlow)

// Calculate the EMA of the weighted alpha for the defined lengths
emaFast = ta.ema(weighted_alpha, lenFast)
emaMedium = ta.ema(weighted_alpha, lenMedium)
emaSlow = ta.ema(weighted_alpha, lenSlow)

// EMA bumps
rocFast = emaFast - emaFast[1]
rocMedium = emaMedium - emaMedium[1]
rocSlow = emaSlow - emaSlow[1]

// Define Sinusoidal/Trend and Noise Components
trend = ta.sma(close, length_nado)
volatility = ta.stdev(close, length_nado) * mult

// Define Transient Component
roc = ta.roc(close, length_nado)
transient = math.abs(roc) > volatility ? roc : na

// Percentile Rank Calculation Function
pctrank(series, period) =>
    lessThanCount = 0.0
    for i = 0 to period - 1
        if na(series[i]) or na(series)
            lessThanCount := na
            break
        else
            lessThanCount := series[i] < series ? lessThanCount + 1 : lessThanCount
    na(lessThanCount) ? na : lessThanCount / period * 100

// Normalized Components
normalizedTrend = pctrank(trend, length_nado)
normalizedVolatility = pctrank(volatility, length_nado)
nadoFunction = (normalizedTrend + normalizedVolatility) / 2

// Compute the percentile rank of the EMA bumps over a certain period
prFast = pctrank(rocFast, lenFast)
prMedium = pctrank(rocMedium, lenMedium)
prSlow = pctrank(rocSlow, lenSlow)

// Compute a moving average of these percentile ranks
maFast = ta.sma(prFast, maPeriod)
maMedium = ta.sma(prMedium, maPeriod)
maSlow = ta.sma(prSlow, maPeriod)

// Compute the final signal
signalFast = (prFast - maFast) * nadoFunction
signalMedium = (prMedium - maMedium) * nadoFunction
signalSlow = (prSlow - maSlow) * nadoFunction

// Compute the midline
midline = (signalFast + signalMedium + signalSlow) / 3

// Calculate a 20% kicker based on averages from 3 slower periods
kicker = midline * 0.20 * ((emaSlow / ta.sma(emaSlow, lenSlow)) + (emaMedium / ta.sma(emaMedium, lenMedium)) + (emaFast / ta.sma(emaFast, lenFast))) / 3

// Add kicker to the midline
finalMidline = midline + kicker

// Plot the signals and the final midline
plot(signalFast, color=color.green, title="Signal Fast")
plot(signalMedium, color=color.blue, title="Signal Medium")
plot(signalSlow, color=color.red, title="Signal Slow")
plot(finalMidline, color=color.black, title="Final Midline")

Overview

Short Term Alpha Indicator computes ROC values for the EMAs and applies percentile rank functions to identify deviations. These deviations produce three colored signals for fast, medium, and slow components, along with a midline value adjusted by a kicker factor. The indicator plots the signals and final midline in a separate pane below the price chart. It uses fixed parameters for lengths and periods with no user-adjustable inputs. The signals provide visual cues for potential short-term market moves but include no built-in buy or sell rules.

Details

Published by

jawauntb on GitHub

Draws

Separate pane below the chart

Markets

Stocks

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

MultiIndicator

by capissimo
114 stars

MultiIndicator combines multiple technical indicators into a single separate pane to save chart space. It calculates and displays market regime detection based on ordinary least squares regression, a Holt exponential smoothing crossover, normalized RSI, ADX, a

Indicator v4 Oscillators & momentumTrend
Updated 1 year ago · None stated GitHub repository of MultiIndicator
29 stars

The Supertrended RSI [AlgoAlpha] indicator plots the Relative Strength Index combined with a Supertrend overlay in a separate indicator pane. It first computes standard RSI, with an optional Hull Moving Average smoothing step, and computes a secondary moving a

Indicator v5 Oscillators & momentumTrend
Updated 11 months ago · Custom licence GitHub repository of Supertrended RSI [AlgoAlpha]

This indicator computes and plots multiple technical analysis features on a separate pane. It calculates EMA-based trend indicators including fast and slow EMAs along with their slope, momentum oscillators such as RSI, Stochastic RSI, and MACD histogram, WaveT

Indicator v6 TrendOscillators & momentum
Updated 3 days ago · MIT GitHub repository of Vein Feature Exporter Core 4H [WavesUnchained]

QQE + AK Trend + EFI

by realanthonyc
2 stars

This Pine Script indicator combines QQE, AK Trend, and EFI indicators. It calculates the QQE using RSI with smoothing and displays it as a histogram in a separate pane. The AK Trend line is formed by two exponential moving averages whose scale adjusts accordin

Indicator v6 Oscillators & momentumTrend
Updated 11 months ago · MPL-2.0 GitHub repository of QQE + AK Trend + EFI

DMI Improve

by JohnsonHsiao
1 stars

This indicator improves the standard Directional Movement Index by adjusting plus and minus directional movement calculations with a weight factor and SMA adjustments for sensitivity. It calculates and plots improved DI+ and DI- lines in a separate pane. Setti

Indicator v5 TrendOscillators & momentum
Updated 3 years ago · None stated GitHub repository of DMI Improve

More Oscillators & momentum 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