The Art of Detecting Market Tops and Bottoms
Presenting a New Technical Indicator For Market Reversals
Previously, I have published K’s Reversal Indicator I on TradingView, this article discusses another indicator which follows the same path, that is: detecting decent market tops and bottoms (in a timely manner). The first section discusses the intuition of the indicator and the second section shows how it’s used.
The Intuition of the Indicator
Markets are said to move randomly and even though this has soe truth in it, we can’t help but develop tools to help us predict market tops and bottoms (whether local or global). Active trading strategies and algorithms tell us that there is predictability in some strategies (with solid risk management habits). Technical indicators on the other hand, are merely helpers and can enhance convictions.
Previously, I have published K’s Reversal Indicator I on TradingView, this article discusses another indicator which follows the same path, that is: detecting decent market tops and bottoms (in a timely manner). The first step in creating the indicator is to calculate a 13-period simple moving average, then mark every instance where the close price is greater than the moving average with the number 1. This means that if the market has been above the moving average for three consecutive periods, the counter is 3.
The next step is to sum the counters using a rolling period of 21. Finally, you divide the number of 1’s by 21, which will give you the percentage of times where the close price was greater than the moving average.
The way to use the indicator is as follows:
A bullish signal is generated whenever K’s Reversal Indicator II equals 0 with the previous value greater than 0.
A bearish signal is generated whenever K’s Reversal Indicator II equals 1 with the previous value less than 1.
You can also check out my other newsletter The Weekly Market Sentiment Report that sends tactical directional views every weekend to highlight the important trading opportunities using a mix between sentiment analysis (COT reports, Put-Call ratio, Gamma exposure index, etc.) and technical analysis.
Visualizing the Indicator
As its predecessor, K’s Reversal Indicator I, this indicator uses overlay signals on the chart to facilitate their detection. This means that green arrows represent bullish signals and red arrows represent bearish signals.
The following Python-realized signal chart shows the indicator in action:
The blue line accompanying the price action is the 13-period moving average. You can notice that even though there are interesting tops and bottoms detected by the indicator, there are a few false signals (in this chart, we can count 3 bad signals out of 10).
Naturally, as with every indicator or technique, they are better used with other indicators and with a full risk management system that prevents you from losing your capital. Over the long-term, the indicator has a decent predictive ability, but it must be accompanied with other tools.
The following Python-realized signal chart shows another chart:
K’s Reversal Indicator II does not have theoretical targets nor invalidation events which is why it can be fit into any strategy. This is a double-edged sword as using it with the wrong entry/exit methods will yield negative results. However, using it right could yield good results (preferably short-term FX pairs that are known to be more ranging nature than trending).
If you are interested in the code in TradingView’s pine script, it’s as follows:
//@version=5
indicator("K's Reversal Indicator II", overlay = true)
ma_length = input(21, title = "Moving Average Length")
sma_value = ta.sma(close, ma_length)
var int[] storeArray = array.new_int(21, 0)
for i = 0 to 21 - 1
if close[i] > sma_value[i]
array.set(storeArray, i, 1)
else
array.set(storeArray, i, 0)
k = (array.get(storeArray, 0) +
array.get(storeArray, 1) +
array.get(storeArray, 2) +
array.get(storeArray, 3) +
array.get(storeArray, 4) +
array.get(storeArray, 5) +
array.get(storeArray, 6) +
array.get(storeArray, 7) +
array.get(storeArray, 8) +
array.get(storeArray, 9) +
array.get(storeArray, 10) +
array.get(storeArray, 11) +
array.get(storeArray, 12) +
array.get(storeArray, 13) +
array.get(storeArray, 14) +
array.get(storeArray, 15) +
array.get(storeArray, 16) +
array.get(storeArray, 17) +
array.get(storeArray, 18) +
array.get(storeArray, 19) +
array.get(storeArray, 20)) / 21
bullish_signal = k == 0 and k[1] > 0
bearish_signal = k == 1 and k[1] < 1
plotshape(bullish_signal, style = shape.triangleup, color = color.rgb(41, 180, 157), location = location.belowbar, size = size.small)
plotshape(bearish_signal, style = shape.triangledown, color = color.rgb(165, 42, 42), location = location.abovebar, size = size.small)
if bullish_signal
alert("Bullish Signal detected!).", alert.freq_once_per_bar)
if bearish_signal
alert("Bearish Signal detected!).", alert.freq_once_per_bar)
You can also check out my other newsletter The Weekly Market Analysis Report that sends tactical directional views every weekend to highlight the important trading opportunities using technical analysis that stem from modern indicators. The newsletter is free.
If you liked this article, do not hesitate to like and comment, to further the discussion!