This indicator plots an exponential moving average taken from a selected higher timeframe and colors both the line and the chart background by whether the close is above or below that average.
//@version=6
// Example script bundled with DegenView. Edit it freely.
// Reads an EMA from a longer timeframe with request.security and colours the chart
// by whether price is above or below it. A timeframe shorter than the chart's falls
// back to the chart's own.
indicator("Higher Timeframe Trend", overlay = true)
higherTimeframe = input.string("D", "Higher timeframe", options = ["60", "D", "W", "M"], group = "Trend", tooltip = "Use a timeframe at least as long as the chart's.")
length = input.int(20, "EMA length", minval = 1, group = "Trend")
usable = timeframe.in_seconds(higherTimeframe) >= timeframe.in_seconds()
timeframeToUse = usable ? higherTimeframe : timeframe.period
higherEma = request.security(syminfo.tickerid, timeframeToUse, ta.ema(close, length))
trendUp = close > higherEma
plot(higherEma, "Higher-timeframe EMA", color = trendUp ? color.green : color.red, linewidth = 2)
bgcolor(trendUp ? color.new(color.green, 92) : color.new(color.red, 92))
Overview
Higher Timeframe Trend requests the EMA through request.security and, when the chosen timeframe is shorter than the chart, falls back to the chart period. The main settings choose the higher timeframe from 60 minutes, daily, weekly, or monthly, and set the EMA length. It draws on the price chart. There are no trade signals or exit rules.
Higher-timeframe EMA via request.security
Green or red line and background by price versus EMA
Fallback to the chart timeframe when the selection is shorter
Timeframe choices of 60 minutes, daily, weekly, or monthly
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Higher timeframe
string
D
higherTimeframe
EMA length
int
20
length
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.
The Adaptive Laguerre Filter calculates a smoothed, dynamically adjusted trendline plotted directly on the main price chart. It dynamically adjusts its damping factor (alpha) based on recent price range variations and median percentile calculations over a spec
This script plots three moving averages on the price chart: a fast EMA or SMA with 10 periods, a slow EMA or SMA with 20 periods, and a trend EMA or SMA with 100 periods. It signals trend changes by drawing a white cross when the fast moving average crosses ab
This indicator plots four customizable moving averages directly on the main price chart using default lengths of 3, 8, 21, and 50 periods. It fills the space between adjacent averages in green or maroon depending on trend alignment. Additionally, it computes B
This indicator plots three exponential moving averages and ATR volatility envelopes on the price chart. It compares the fast and slow EMAs to shade a trend ribbon and marks confirmed upward and downward crossovers with triangle labels. Settings change the thre
Donald SPX - Options Trading is an overlay indicator designed for intraday SPX analysis. It plots a 200-period Weighted Moving Average (WMA) on the price chart while evaluating multi-timeframe market structure across Daily, 15-minute, 5-minute, and 2-minute ba
This multi-timeframe indicator calculates and plots 20-period and 60-period simple moving averages from the 60-minute timeframe directly onto the price chart. The 20-period average displays as a green line, while the 60-period average appears in blue. It serve