Developing a Creative Technical Indicator
Discussing a New Technical Indicator and Coding it in TradingView
This article discusses one of the indicators of a set called the Rainbow Indicators which are structured and unique combinations of price-derived techniques aimed to help the trader predict reversals or to confirm the on-going trend. The indicator discussed is called the Blue indicator, a contrarian method based on the concept of slopes.
Creating the Blue Indicator
The slope of a time series is the rate of change between the current values and previous values. A rising market will generally have a positive slope until it approaches zero and starts turning negative which coincides with a falling market.
The Blue indicator calculates the slope of the market from a number of periods in the past (by default 14 or 21) and then applies the RSI (by default 14 or 21) on the slope to have a bounded calculation that aim to tell when the slope is losing momentum.
The Blue indicator is used as follows:
A bullish signal is generated whenever the indicator surpasses 30 after having been below it.
A bearish signal is generated whenever the indicator breaks 70 after having been above it.
For simplicity, the indicators of the Rainbow collection are charted in an overlay arrow-based technique where only confirmed signals are shown (as opposed to showing the indicator on its own).
If you want to see more of my work, you can visit my website for the books catalogue by simply following this link:
Coding the Blue Indicator
Pine Script is TradingView’s main coding language which is very user-friendly. We will code this indicator and check out its signals. The next Figure shows the Nifty50 with the signals generated from the indicator.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Sofien-Kaabar
//@version=5
indicator("Rainbow Collection - Blue", overlay = true)
lookback = input(defval = 21, title = 'Lookback')
lookback_rsi = input(defval = 21, title = 'RSI Lookback')
slope = (close - close[lookback]) / lookback
indicator = ta.rsi(slope, lookback_rsi)
buy = indicator > 30 and indicator[1] < 30 and indicator < 35
sell = indicator < 70 and indicator[1] > 70 and indicator > 65
plotshape(buy, style = shape.triangleup, color = color.blue, location = location.belowbar, size = size.small)
plotshape(sell, style = shape.triangledown, color = color.blue, location = location.abovebar, size = size.small)
The next Figure shows another signal chart on USDCAD.
You can also check out my other newsletter The Weekly Market Sentiment Report that sends weekly directional views every weekend to highlight the important trading opportunities using a mix between sentiment analysis (COT report, put-call ratio, etc.) and rules-based technical analysis.
If you liked this article, do not hesitate to like and comment, to further the discussion!