QuantraSystems

Simple Neural Network Transformed RSI [QuantraAI]

Simple Neural Network Transformed RSI


Introduction

The Simple Neural Network Transformed RSI (ɴɴᴛ ʀsɪ) stands out as a formidable tool for traders who specialize in lower timeframe trading.
It is an innovative enhancement of the traditional RSI readings with simple neural network smoothing techniques.

This unique blend results in fairly accurate signals, tailored for swift market movements. The ɴɴᴛ ʀsɪ is particularly resistant to the usual market noise found in lower timeframes, ensuring a clearer view of short-term trends.
Furthermore, its diverse range of visualization options adds versatility, making it a valuable tool for traders seeking to capitalize on short-duration market dynamics.




Legend

In the Image you can see the BTCUSD 1D Chart with the ɴɴᴛ ʀsɪ in Trend Following Mode to display the current trend. This is visualized with the barcoloring.
Its Overbought and Oversold zones start at 50% and end at 100% of the selected Standard Deviation (default σ = 2), which can indicate extremely rare situations which can lead to either a softening momentum in the trend or even a mean reversion situation.
Here you can also see the original Indicator line and the Heikin Ashi transformed Indicator bars - more on that now.


Notes

Quantra Standard Value Contents:

To draw out all the information from the indicator calculation we have added a Heikin-Ashi (HA) Candle Visualization.
This HA transformation smoothens out the indicator values and gives a more informative look into Momentum and Trend of the Indicator itself.
This allows early entries and exits by observing the HA transformed Indicator values.

To diversify, different visualization options are available, either a classic line, HA transformed or Hybrid, which contains both of the previous.

To make Quantra's Indicators as useful and versatile as possible we have created options
to change the barcoloring and thus the derived signal from the indicator based on different modes.

Option to choose different Modes:
  • Trend Following (Indicator above mid line counts as uptrend, below is downtrend)
  • Extremities (Everything going beyond the Deviation Bands in a Mean Reversion manner is highlighted)
  • Candles (Color of HA candles as barcolor)
  • Reversion (HA ONLY) (Reversion Signals via the triangles if HA candles change state outside of the Deviation Bands)
    - Reversion Signals are indicated by the triangles in the Heikin-Ashi or Hybrid visualization when the HA Candles revert
    from downwards to upwards or the other way around OUTSIDE of the SD Bands.
    Depending on the Indicator they signal OB/OS areas and can either work as high probability entries and exits for Mean Reversion trades or
    indicate Momentum slow downs and potential ranges.
    Please use another indicator to confirm this.




Case Study

To effectively utilize the NNT-RSI, traders should know their style and familiarize themselves with the available options.

As stated above, you have multiple modes available that you can combine as you need and see fit.

In the given example mostly only the mode was used in an isolated fashion.
Trend Following:
Purely relied on State Change - Midline crossover
Could be combined with Momentum or Reversion analysis for better entries/exits.

Extremities:
Ideal entry/exit is in the accordingly colored OS/OB Area, the Reversion signaled the latest possible entry/exit.

HA Candles:
Specifically applicable for strong trends. Powerful and fast tool.
Can whip if used as sole condition.

Reversions:
Shows the single entry and exit bars which have a positive expected value outcome.
Can also be used as confirmation or as last signal.


Please note that we always advise to find more confluence by additional indicators.
Traders are encouraged to test and determine the most suitable settings for their specific trading strategies and timeframes.
In the showcased trades the default settings were used.



Methodology
The Simple Neural Network Transformed RSI uses a simple neural network logic to process RSI values, smoothing them for more accurate trend analysis.
This is achieved through a linear combination of RSI values over a specified input length, weighted evenly to produce a neural network output.

// Simple neural network logic (linear combination with weighted aggregation)
var float[] inputs = array.new_float(nnLength, na)
for i = 0 to nnLength - 1
    array.set(inputs, i, rsi1[i])
nnOutput = 0.0
for i = 0 to nnLength - 1
    nnOutput := nnOutput + array.get(inputs, i) * (1 / nnLength)
    nnOutput

This output is then compared against a standard or dynamic mean line to generate trend following signals.
Mean  = ta.sma(nnOutput, sdLook)
cross = useMean? 50 : Mean


The indicator also incorporates Heikin Ashi candlestick calculations to provide additional insights into market dynamics, such as trend strength and potential reversals.
// Calculate Heikin Ashi representation
ha = ha(
     na(nnOutput[1]) ? nnOutput : nnOutput[1],
     math.max(nnOutput, nnOutput[1]),
     math.min(nnOutput, nnOutput[1]),
     nnOutput)


Standard deviation bands are used to create dynamic overbought and oversold zones, further enhancing the tool's analytical capabilities.
// Calculate Dynamic OB/OS Zones
stdv_bands(_src, _length, _mult) =>
    float basis = ta.sma(_src, _length)
    float dev   = _mult * ta.stdev(_src, _length)
    [basis, basis + dev, basis - dev]


[_, u1, l1] = stdv_bands(nnOutput, sdLook,sdMult/2)
[_, u2, l2] = stdv_bands(nnOutput, sdLook, sdMult)

The Standard Deviation bands take defined parameters from the user, in this case sigma of ideally between 2 to 3,
to help the indicator detect extremely improbable conditions and thus take an inversely probable signal from it to forward to the user.

The parameter settings and also the visualizations allow for ample customizations by the trader.





For questions or recommendations, please feel free to seek contact in the comments.

Release Notes:
Renamed "NN Input Length" to
"NN Smoothing Length" to prevent ambiguity around its function.
Release Notes:
Added custom alerts!
Alerts are based upon the selected bar coloring option in the user menu.
Release Notes:
Added monochrome colors and the option for user-defined color themes.
Release Notes:
Added 'Dynamic' capabilities.
Added 'Compressed Signal Mode'.
Release Notes:
Updated Dynamic Function Library.
Updated header name tag.

No statements or claims aim to be financial advice,
neither are any signals from us or our indicators.


Want to learn Trading, Investing or system building?
Join the Community! 👇

discord.gg/FMZDM3bZ9T
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?