Professional Documents
Culture Documents
Trend Strength Indicator
Trend Strength Indicator
This indicator uses Heiken Ashi candle data to plot trend/momentum strength signals to your chart.
It is an experimental indicator I created a while ago to play around with the idea of merging Heiken Ashi
candle data with regular price action data.
I do not personally use this script for my live trading as I have not backtested its various use cases, but I
plan to get around to doing it eventually as I believe the concept has potential to be useful for trade
management.
How It Works
Bright Green: Heiken Ashi candle data is still putting in higher lows and higher highs, and the price closed
above the previous low.
Dark Green: Heiken Ashi candle closed green, but had a lower low or lower high (trend/momentum
weakening).
Bright Red: Heiken Ashi candle data is still putting in lower lows and lower highs, and the price closed
below the previous high.
Dark Red: Heiken Ashi candle closed red, but had a higher low or higher high (trend weakening).
Optional: I included a setting for allowing high RSI values to overrule Heiken Ashi values (enabled by
default).
Settings
Use HTF?
If this is enabled then the indicator will use higher-timeframe data to make its calculations.
Timeframe:
If Use HTF is enabled then this is the timeframe that will be used.
Plot As Line?
If this is enabled then the script will draw the trend-strength oscillator as a line instead of squares.
Fill Color?
If this is enabled then the indicator box will be filled with the appropriate color (instead of small
squares).
Draw On Candles Yet to Close?
If this is disabled then the script will not draw its signal on the current candle until the candle closes.
RSI Length:
This sets the RSI length for RSI overrides.
// @version=3
// Color data
hkRed = #CC0000
hkRedTrend = #FF0000
hkGreen = #00CC00
hkGreenTrend = #00FF00
// Heiken Ashi data
// Momentum analysis
bulltrend = hkhigh[1] > hkhigh[2] and hklow[1] > hklow[2] and security(tickerid, period, close[1]) >
security(tickerid, period, low[2]) and bullish[1]
beartrend = hklow[1] < hklow[2] and hkhigh[1] < hkhigh[2] and security(tickerid, period, close[1]) <
security(tickerid, period, high[2]) and bearish[1]
// Plot signal