Indicator · Pine Script v5 · Own pane

Long Term Alpha Indicator

by jawauntb

The Long Term Alpha Indicator computes a weighted alpha from price change (close minus average of high low close) multiplied by volume and smoothed via simple moving average.

View on GitHub

GitHub stars3on the repository
Pine versionv5runs as is
Lines of code31
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

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

long-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(title="Long Term Alpha Indicator", overlay=false)

// Define EMA lengths
length1 = 110
length2 = 30
length3 = 8


// Define the weighted alpha
price_change = close - ((high + low + close) / 3)

weighted_alpha = ta.sma(price_change * volume, length1)

// Calculate the EMA of the weighted alpha for the defined lengths
ema1 = ta.ema(weighted_alpha, length1)
ema2 = ta.ema(weighted_alpha, length2)
ema3 = ta.ema(weighted_alpha, length3)

// Normalize to start from 50 and go unbounded
normalized_ema1 = 50 + (ema1 / ta.highest(ema1, length1) * 50)
normalized_ema2 = 50 + (ema2 / ta.highest(ema2, length2) * 50)
normalized_ema3 = 50 + (ema3 / ta.highest(ema3, length3) * 50)

// Plot the results
plot(normalized_ema1, color=color.rgb(127, 8, 8), linewidth=5, title="EMA 110 of Weighted Alpha")
plot(normalized_ema2, color=color.rgb(7, 68, 119), linewidth=4, title="EMA 30 of Weighted Alpha")
plot(normalized_ema3, color=color.rgb(8, 98, 11), linewidth=3, title="EMA 8 of Weighted Alpha")

Overview

Long Term Alpha Indicator produces EMAs of this weighted alpha at fixed lengths of 110 30 and 8. Each EMA is normalized to begin at 50 and extend unbounded before plotting as thick colored lines in a separate pane. The script offers a visual momentum gauge over long periods without entry or exit signals.

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

Aggregate Signal (v.2)

by capissimo
114 stars

Aggregate Signal (v.2) is an oscillator indicator that combines multiple technical factors into a single composite score. It scales OHLCV data using minimax normalization and evaluates indicators such as MACD, RSI, Stochastic, CCI, Momentum, On-Balance Volume,

Indicator v4 Oscillators & momentumMoving averages Repaints
Updated 1 year ago · None stated GitHub repository of Aggregate Signal (v.2)

Volume-Weighted MACD

by mihakralj
99 stars

This indicator plots a volume-weighted MACD in a separate pane. It subtracts a slow volume-weighted moving average of close from a faster one, then smooths that line with an exponential moving average to form the signal. A column histogram shows the gap betwee

Indicator v5 Oscillators & momentumMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Volume-Weighted MACD

PPO ATR Bands

by cryptorife
75 stars

PPO ATR Bands plots a percentage price oscillator in a separate pane. It compares a Hull average of typical price with a volume-weighted exponential average of Parabolic SAR, then scales three true-range bands around the slow average into matching oscillator l

Indicator v4 Oscillators & momentumMoving averages
Updated 3 years ago · GPL-3.0 GitHub repository of PPO ATR Bands

RSI-VWMA

by Zettt
43 stars

This indicator calculates the Relative Strength Index using a volume-weighted moving average of the closing price as its source. It plots the resulting oscillator in a separate pane alongside configurable overbought and oversold threshold lines. The plot line

Indicator v4 Oscillators & momentumMoving averages
Updated 1 year ago · None stated GitHub repository of RSI-VWMA

Trap Shorts - Hamza Naveed

by ProfHamzaNaveed
43 stars

This indicator tracks and visualizes cryptocurrency net positioning across multiple derivative exchanges, including Binance, BitMEX, and Kraken. It calculates aggregated net longs, net shorts, net delta, and ratio metrics, or an optional Position RSI, renderin

Indicator v5 VolumeOscillators & momentum
Updated 9 months ago · None stated GitHub repository of Trap Shorts - Hamza Naveed

NFI v6

by koradiyakaushal
12 stars

This Pine v4 study ports early NostalgiaForInfinity V6 conditions onto the price chart. It computes two Bollinger setups, several EMAs and SMAs, RSI, MFI, a percent SMA spread labeled EWO, a 14-period choppiness value, and short and longer volume medians. Fixe

Indicator v4 Moving averagesVolatility & bands
Updated 5 years ago · MIT GitHub repository of NFI v6

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