Trend Detector can plot up to three moving averages, each with its own type (SMA, EMA, RMA, WMA or VWMA), length, source and timeframe, defaulting to 15, 60 and 240 minutes.
1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
131 lines of Pine Script v5 from trend_detector.pinescript, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
A table lists whether each selected average is trending up or down. An option waits for the chosen timeframe to close before plotting, which removes gaps. Table position, frame, border and text colors are adjustable. It draws on the price chart.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Plot
bool
true
trendDetectorSwitch
Position
string
position.top_right
trendDetectorPosition
Frame Color
color
color.new(color.white, 80)
trendDetectorFrameColor
Frame Width
int
2
trendDetectorFrameWidth
Border Color
color
color.new(color.white, 80)
trendDetectorBorderColor
Border Width
int
2
trendDetectorBorderWidth
Text Color
color
color.new(color.white, 60)
trendDetectorTextColor
Plot
bool
false
ma1Switch
Show Trend Data
bool
true
ma1ShowTrendData
Type
string
EMA
ma1Type
Length
int
20
ma1Length
Source
source
close
ma1Source
Show all 31 settings
Setting
Type
Default
Variable
Timeframe
timeframe
15
ma1Timeframe
Color
color
color.new(color.red, 0)
ma1Color
Wait TF Close
bool
true
ma1WaitTF
Plot
bool
false
ma2Switch
Show Trend Data
bool
true
ma2ShowTrendData
Type
string
EMA
ma2Type
Length
int
20
ma2Length
Source
source
close
ma2Source
Timeframe
timeframe
60
ma2Timeframe
Color
color
color.new(color.orange, 0)
ma2Color
Wait TF Close
bool
true
ma2WaitTF
Plot
bool
false
ma3Switch
Show Trend Data
bool
true
ma3ShowTrendData
Type
string
EMA
ma3Type
Length
int
20
ma3Length
Source
source
close
ma3Source
Timeframe
timeframe
240
ma3Timeframe
Color
color
color.new(color.yellow, 0)
ma3Color
Wait TF Close
bool
true
ma3WaitTF
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.
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
This indicator plots five moving averages of a chosen source on the price chart, defaulting to EMA lengths 10, 20, 30, 40 and 50. The user can switch the average type to SMA, WMA or HMA and recolor each line. Wide translucent glows sit under the lines, and sof
Calculates exponential moving averages for fast, pivot, and slow lengths along with optional 50, 100, and 200 simple moving average context lines. It visualizes bullish and bearish ribbon fills on the main price chart alongside MACD calculations to generate ea
This indicator analyzes historical candle direction and price range over a configurable lookback window to gauge market trend. It categorizes trend direction using candle count, price range sum, or both. Signals are filtered using a Simple Moving Average to en
This indicator evaluates market momentum and risk by calculating trend metrics and volatility stats, displaying them in an on-chart table pane. It measures short-term and long-term trend strength via two MACD configurations built on three customizable EMA leng
Market Monitor - 15m is a directional bias chart overlay designed for 15-minute intraday chart analysis. It calculates a triple exponential moving average ribbon with EMA cloud shading, session VWAP with multiplier bands, prior day levels, a 30-minute opening