Simple Neural Network Transformed RSI [QuantraSystems]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 )
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 ) ? nnOutput : nnOutput ,
math.max(nnOutput, nnOutput ),
math.min(nnOutput, nnOutput ),
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)
= stdv_bands(nnOutput, sdLook,sdMult/2)
= 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.
Индекс относительной силы (RSI)
Best scalping toolExplanation:
This script is a comprehensive indicator that combines three essential technical analysis tools: Money Flow Index (MFI), Relative Strength Index (RSI), and Bollinger Bands (Bollinger %B). It provides insights into market conditions related to cross points of mfi,rsi and B%B.
A buy condition is created when the last candle RSI and MFI are under the bollinger bands, and then in the actual candle the RSI cross up the bollinger low band.
A sell condition is created when the last candle RSI and MFI are above the bollinger bands, and then in the actual candle the RSI cross down the bollinger high band.
Key Components:
MFI (Money Flow Index):
Utilizes the MFI indicator based on a specified length.
Overbought and oversold levels (80 and 20, respectively).
RSI (Relative Strength Index): (Adapted to the mfi chart)
Allows selection of different moving average types (SMA, EMA, etc.) for the RSI calculation.
RSI along with upper and lower bands (70 and 30).
Bollinger Bands:
Provides upper and lower Bollinger Bands based on the RSI's standard deviation.
Visualization Options:
Allows the user to choose between show the buy (green arrow) and the sell (red arrow) .
How It Works:
The indicator amalgamates these three powerful technical indicators to help traders identify potential entry or exit points. The green arrow its a buy signal and the red arrow is a sell signal.
By offering configurable settings and clear visual cues, this indicator assists traders in recognizing critical market conditions and potential trading opportunities.
Disclaimer: This indicator should be used as a tool in a broader trading strategy and not solely for making trading decisions. It's recommended to combine it with other technical or fundamental analysis for comprehensive trading decisions.
Amazing Oscillator (AO) [Algoalpha]Description:
Introducing the Amazing Oscillator indicator by Algoalpha, a versatile tool designed to help traders identify potential trend shifts and market turning points. This indicator combines the power of the Awesome Oscillator (AO) and the Relative Strength Index (RSI) to create a new indicator that provides valuable insights into market momentum and potential trade opportunities.
Key Features:
Customizable Parameters: The indicator allows you to customize the period of the RSI calculations to fine-tune the indicator's responsiveness.
Visual Clarity: The indicator uses user-defined colors to visually represent upward and downward movements. You can select your preferred colors for both bullish and bearish signals, making it easy to spot potential trade setups.
AO and RSI Integration: The script combines the AO and RSI indicators to provide a comprehensive view of market conditions. The RSI is applied to the AO, which results in a standardized as well as a less noisy version of the Awesome Oscillator. This makes the indicator capable of pointing out overbought or oversold conditions as well as giving fewer false signals
Signal Plots: The indicator plots key levels on the chart, including the RSI threshold(Shifted down by 50) at 30 and -30. These levels are often used by traders to identify potential trend reversal points.
Signal Alerts: For added convenience, the indicator includes "x" markers to signal potential buy (green "x") and sell (red "x") opportunities based on RSI crossovers with the -30 and 30 levels. These alerts can help traders quickly identify potential entry and exit points.
Composite RSI [KFB Quant]The Composite RSI (CRSI) is a momentum oscillator that combines 5 adjustable RSI's. It also has a Z-Score to make it easier to identify potential market extremes.
How to adjust the indicator
Inside the Length & Impact Configuration tab you can adjust the length and impact of each RSI as well as the Z-Score length specific to your needs. The default length inputs are 7, 14, 30, 60, 90 (RSI 1 - RSI 5) and the default impact is set to 1.0 for all RSI's. Default length for Z-Score is 360.
Inside the Style Configuration tab you can pick what you want to display(plot). The options are: CRSI, Z-Score, Overview Table and the individual RSI's.
Inside the Color Configuration tab you can customize the color of each plot.
How the script works
CRSI = rsi_sum / imp_sum
Z-Score = (crsi - crsi_mean) / crsi_stdev
rsi_sum = (rsi_1 -50) + (rsi_2 -50) + (rsi_3 -50) + (rsi_4 -50) + (rsi_5 -50)
imp_sum = imp_1 + imp_2 + imp_3 + imp_4 + imp_5
crsi_mean = Average of the crsi over the defined period in Z-Score Length
crsi_stdev = StDev of crsi over the defined period in Z-Score Length
This is not financial advice. Trading is risky & most traders lose money. Past performance does not guarantee future results. This indicator is for informational & educational purposes only.
Christmas Toolkit [LuxAlgo]It's that time of the year... and what would be more appropriate than displaying Christmas-themed elements on your chart?
The Christmas Toolkit displays a tree containing elements affected by various technical indicators. If you're lucky, you just might also find a precious reindeer trotting toward the tree, how fancy!
🔶 USAGE
Each of the 7 X-mas balls is associated with a specific condition.
Each ball has a color indicating:
lime: very bullish
green: bullish
blue: holding the same position or sideline
red: bearish
darkRed: very bearish
From top to bottom:
🔹 RSI (length 14)
rsi < 20 - lime (+2 points)
rsi < 30 - green (+1 point)
rsi > 80 - darkRed (-2 points)
rsi > 70 - red (-1 point)
else - blue
🔹 Stoch (length 14)
stoch < 20 - lime (+2 points)
stoch < 30 - green (+1 point)
stoch > 80 - darkRed (-2 points)
stoch > 70 - red (-1 point)
else - blue
🔹 close vs. ema (length 20)
close > ema 20 - green (+1 point)
else - red (-1 point)
🔹 ema (length 20)
ema 20 rises - green (+1 point)
else - red (-1 point)
🔹 ema (length 50)
ema 50 rises - green (+1 point)
else - red (-1 point)
🔹 ema (length 100)
ema 100 rises - green (+1 point)
else - red (-1 point)
🔹 ema (length 200)
ema 200 rises - green (+1 point)
else - red (-1 point)
The above information can also be found on the right side of the tree.
You'll see the conditions associated with the specific X-mas ball and the meaning of color changes. This can also be visualized by hovering over the labels.
All values are added together, this result is used to color the star at the top of the tree, with a specific color indicating:
lime: very bullish (> 6 points)
green: bullish (6 points)
blue: holding the same position or sideline
red: bearish (-6 points)
darkRed: very bearish (< -6 points)
Switches to green/lime or red/dark red can be seen by the fallen stars at the bottom.
The Last Switch indicates the latest green/lime or red/dark red color (not blue)
🔶 ANIMATION
Randomly moving snowflakes are added to give it a wintry character.
There are also randomly moving stars in the tree.
Garland rotations, style, and color can be adjusted, together with the width and offset of the tree, put your tree anywhere on your chart!
Disabling the "static tree" setting will make the needles 'move'.
Have you happened to see the precious reindeer on the right? This proud reindeer moves towards the most recent candle. Who knows what this reindeer might be bringing to the tree?
🔶 SETTINGS
Width: Width of tree.
Offset: Offset of the tree.
Garland rotations: Amount of rotations, a high number gives other styles.
Color/Style: sets the color & style of garland stars.
Needles: sets the needle color.
Static Tree: Allows the tree needles to 'move' with each tick.
Reindeer Speed: Controls how fast the deer moves toward the most recent bar.
🔶 MESSAGE FROM THE LUXALGO TEAM
It has been an honor to contribute to the TradingView community and we are always so happy to see your supportive messages on our scripts.
We have posted a total of 78 script publications this year, which is no small feat & was only possible thanks to our team of Wizard developers @alexgrover + @dgtrd + @fikira , the development team behind Pine Script, and of course to the support of our legendary community.
Happy Holidays to you all, and we'll see ya next year! ☃️
RSI/MFI Ultimate MAHello!
Today, I want to discuss a special indicator that I've developed. centers around a weighted moving average based on RSI/MFI.
1. Development Purpose
The primary goal of this indicator is to provide clearer insights into bullish and bearish signals in the market. It applies a weight to the RSI (Relative Strength Index) and MFI (Money Flow Index) values to offer more sensitive and predictive trend signals than traditional moving averages.
2. Usefulness
This indicator aids traders in identifying market volatility and bullish or bearish trends more easily. It is particularly responsive to market volatility, providing more accurate information for trading decisions.
3. Real-World Usage Examples
When applied to actual market data, this indicator clearly delineates bullish or bearish sections with its weighted moving average line. For instance, an upward trending moving average line indicates a bullish signal, while a downward trend suggests bearish momentum.
4. Meaning of Parameter Values
option: Allows choosing between RSI or MFI, each analyzing different market signals.
osc_len: Adjusting the oscillator length alters sensitivity.
ma_len: Setting the moving average length helps to modulate responsiveness to market fluctuations.
weight: Changing the weight fine-tunes the sensitivity of the moving average line.
By adjusting these parameters, the indicator can be customized to suit various market conditions.
Wishing you a successful trading day. Thank you!
[PUZ]Relativ Strength Index [MTB]Here I provide you with my new RSI indicator.
This RSI has some advantages over the normal Tadingview RSI.
The RSI is usually calculated exclusively on a Candel Close basis. My RSI is calculated on a Candel Close, Open, High, Low basis, which makes it look a little smoother. Furthermore, there are not only 3 support and resistance lines but a total of 7 where the rsi can bounce. These lines can all be set variably under the Style settings.
In addition, the RSI also shows divergences and hidden divergences via red and blue lines.
There is also the option to make trend settings
Option one involves determining the trend based on various selectable moving averages. You can also select the time frame for trend determination.
The trend is shown by coloring the background in the RSI green and red. Of course you can also switch the background on and off.
The second trend option is to determine a Fibbonacci line which is displayed red or green on LVL 100 depending on the trend direction.
In this trend calculation you can also select the time frame yourself and you can use the sensitivity to determine how many previous candels are taken into account to determine the trend.
If a candel close occurs above the 0.5 and 0.236 Fibb LVL, the trend turns green.
If a candel close occurs below the 0.5 and 0.786 Fibb LVL, the trend turns red.
A final additional feature is an output module where the RSI data is scaled between 0 and 1 in order to further process this data in future scripts.
A huge thank you goes out to djmad for providing his math library and another thank you to jdehorty for providing his MLExtension library
Custom RSI with RMA SmoothingCustom RSI with RMA Smoothing is smoothing the classic Relative Strength Index to enhance the effectiveness of using the RSI for trend-following through noise reduction.
Principle:
1. RSI is smoothed by the Rolling Moving Average (RMA) and averaged Gains & Losses instead of the classic RSI calculation.
2. A RMA is plotted over the RSI where the crossovers can be entry and exit points.
How is RSI smoothed by the RMA:
1. Outside the common price sources a few new options like hhhlc or hlcc can be chosen where the emphasis is more on the high or the close of the chosen period.
2. Calculation of Price Change: After selecting the price source, the indicator calculates the price change by subtracting the previous period's price from the current price.
3. RMA Smoothing of Price Change: The key step in smoothing the RSI is the application of the Running Moving Average (RMA) to the price change. The length of this RMA is set by the user and determines the extent of smoothing. RMA is a type of moving average that gives more weight to recent data points, making it more responsive to new information while still smoothing out short-term fluctuations.
4. Determining Gains and Losses: The smoothed price change is then used to calculate the gains and losses for each period. Gains are considered when the smoothed price change is positive, and losses when it is negative.
5. Averaging Gains and Losses: These gains and losses are further smoothed by calculating their respective RMAs over the user-defined RSI length. This step is crucial as it dampens the impact of short-term price spikes and drops, giving a more stable and reliable measure of price momentum.
6. RSI Calculation: The standard RSI formula (100 - ) is then applied to these smoothed values. This results in the initial RSI value, which is already more stable than a typical RSI due to the previous smoothing steps.
7. Final RMA Smoothing of RSI: In a final layer of refinement, the RSI itself is smoothed using another RMA, over a length specified by the user. This additional smoothing further reduces the impact of short-term volatility and sharp price movements, providing a more coherent and interpretable RSI line.
Perfect RSIOverview:
The "Enhanced RSI" is a comprehensive TradingView indicator designed to provide traders with a nuanced and detailed analysis of market conditions using the Relative Strength Index (RSI). It amalgamates various RSI calculation methods to offer a more robust and adaptable approach to technical analysis.
Originality:
This script is unique in its synthesis of multiple RSI calculation techniques, including Regular RSI, Dynamic RSI, DMI RSI, Wilder's RSI, TSI RSI, Momentum RSI, and PPO RSI. By combining these methods, the script creates a distinctive and versatile tool for traders seeking a holistic view of RSI dynamics.
How It Works:
Diverse RSI Calculations:
Regular RSI: Calculates standard RSI with user-defined length and source.
Dynamic RSI: Adjusts RSI dynamically based on price movement direction.
DMI RSI: Uses Directional Movement Index for RSI calculation.
Wilder's RSI: Implements Wilder's smoothing technique for RSI.
TSI RSI: Utilizes True Strength Index for RSI calculation.
Momentum RSI: Calculates RSI based on momentum.
PPO RSI: Applies Percentage Price Oscillator for RSI calculation.
Composite RSI:
Combines the individual RSIs into three composite indices (RSI1, RSI2, RSI) using a weighted average approach.
Dynamic Level Adjustment:
Uses the correlation coefficient to dynamically adjust overbought and oversold levels, enhancing adaptability to market changes.
Visualization and Background Coloring:
Visualizes overbought and oversold zones on the chart.
Adjusts background color based on these conditions for clearer interpretation.
How to Use:
Installation:
Copy and paste the script into the Pine Editor on TradingView.
Adjust parameters as needed.
Analysis:
Utilize the "Enhanced RSI" as a comprehensive analysis tool for RSI dynamics.
Consider it as a confirmation tool alongside other technical indicators.
Customization:
Experiment with different RSI lengths and methods to align with your trading strategy.
Backtest the script to validate its effectiveness.
Considerations:
Complexity:
The script is sophisticated; users are advised to understand each calculation method before reliance.
Parameter Sensitivity:
Effectiveness may vary based on chosen parameters; thorough backtesting and parameter optimization are recommended.
Gradient Value Overlay
This script helps with identifying certain conditions without cluttering too much of the candles.
Some use cases:
It helps identify rsi low and high values.
Directional price movement becoming difficult.
low and high volume.
it uses a percent rank to distinguish low and high values.
It then uses a gradient to match the percentile rank to heatmap type colors.
i.e. dark blue for lowest volume, white for highest volume.
Current options are:
max bars to use.
approximate color - This value will attempt to give an approximation of what the color might be for the candle close.
e.g. If you're on the 1-hour chart, and only 30 minutes have past, it will multiple the current volume by 1.5. As time passes, if no volume comes in eventually, it will multiply current volume by 1.
This approximate value is only set to work with volume-based options.
option - select the type of value you'd like to see the gradient for.
timeframe - get values from a different chart timeframe.
on/off - turns the gradient on or off.
Gradient type - color wheel or heatmap. Currently these are the only two gardient options.
color wheel's colors for low to high values:
color wheel's current colors:
dark blue
purple
pink
red
orange
yellow
green
teal
white
heatmap's current colors from low values to high values:
dark blue
purple
pink
red
orange
yellow
white
reverse gradient - will reverse the colors so dark blue will be the high value and white will be the low value. Some charts based on previous data; you might need to switch the gradient colors.
moving average length while inside timeframe - an exponential moving average is applied to the values. At 1, there is no moving average applied.
Use case for this is to smooth out the gradient.
An example use case - if your currently on the 1-hour chart, you can set the timeframe to 1 minute and then the moving average length inside timeframe to 60. You will then be seeing the color sixty 1-minute bars.
current timeframe moving average length - an exponential moving average applied to current gradient (helps with smoothing gradient).
Smooth, further smooths values.
There is no set rule for what moving average lengths to use. Adjust timeframe, and moving average lengths to get an insight.
RSI-Divergence Goggles [Trendoscope®]🎲 Introducing the RSI-Divergence Goggle
🎯 Revolutionizing Divergence Analysis in Trading
While the concept of divergence plays a crucial role in technical analysis, existing indicators in the community library have faced limitations, particularly in simultaneously displaying divergence lines on both price and oscillator graphs. This challenge stems from the fact that RSI and other oscillators are typically plotted in a separate pane from the price chart. Traditional Pine Script® indicators are confined to a single pane, thus restricting comprehensive divergence analysis.
🎯 Our Innovative Solution: RSI on the Price Pane
The RSI-Divergence Goggle breaks through these limitations. Our innovative approach involves plotting the RSI directly onto the price pane within a movable and resizable widget. This groundbreaking feature allows for the simultaneous drawing of zigzag patterns on both price and the oscillator, enabling the effective calculation and visualization of divergence lines on both.
🎯 The Foundation: Our Divergence Research and Rules
Our journey into divergence research began three years ago with the launch of the "Zigzag Trend Divergence Detector." The foundational rules established with this script remain pertinent and form the basis of all our subsequent divergence-based indicators.
🎯 Understanding Divergence: Key Concepts
Divergence Varieties : We identify two main types - Bullish Divergence (and its hidden counterpart) occurs at pivot lows, while Bearish Divergence (and its hidden version) appears at pivot highs.
Contextual Occurrence : Bullish divergence is a phenomenon of downtrends, whereas bearish divergence is unique to uptrend. Conversely, hidden bullish divergence arises in uptrends, and hidden bearish divergence in downtrends.
Oscillator Behavior : In standard divergence scenarios, the oscillator lags behind price, signaling potential reversals. In hidden divergence cases, the oscillator leads, suggesting trend continuation.
🎯 Visual Insights: Divergence and Hidden Divergence
For a clearer understanding, refer to our visual guides:
🎯 A Word of Caution
While divergence is a powerful tool, it's not a standalone guarantee of trend reversals or continuations. We recommend using these patterns in conjunction with support and resistance levels, as demonstrated in our "Divergence Based Support Resistance" implementation.
🎯 Using the RSI-Divergence Goggles
Upon applying the indicator to your chart, you'll be prompted to select two corner points, defining the widget's placement and size. This widget is the stage for your RSI plotting and divergence calculations. Choose these points carefully to ensure they encompass your area of interest without overlapping important price bars.
An example as below.
🎯 Innovative Features:
Plotting RSI: RSI values are scaled from 0 to 100 within the widget. This unique plotting may not align with individual bar values, but pivot labels and tooltips provide detailed RSI and retracement ratio information.
Zigzag and Pivots: Our adjusted RSI plots determine the zigzag pivot highs and lows, which may not always correspond with visible price pivots. However, calculations based on close prices ensure minimal deviation.
Divergence Display: Divergence types are identified following our established rules, with a simple moving average employed to discern the prevailing trend.
🎯 Trend Detection Mechanism
A simple moving average is used as base for determining the trend. If the difference between moving averages of the alternate pivots is positive, then the sentiment is considered to be uptrend. Else, we consider the sentiment to be in downtrend.
This is a simple method to identify trend, implemented via this indicator. The indicator does not provide alternative methods to identify trend. This is something that we can explore in the future.
🎯 Interactive and Customizable
The RSI-Divergence Goggle isn't just a static tool; it's an interactive feature on your chart. You can move or resize the widget, allowing for dynamic analysis and focused study on different chart segments.
Major Currency RSI Indicator (MCRSI)Experience the power of multi-dimensional analysis with our Multi-Currency RSI Indicator (MCRSI). This innovative tool allows traders to simultaneously track and compare the Relative Strength Index (RSI) of eight different currencies in a single chart.
The MCRSI calculates the RSI for USD (DXY), EUR (EXY), JPY (JXY), CAD (CXY), AUD (AXY), NZD (ZXY), GBP (BXY), and CHF (SXY), covering a broad range of the forex market. Each RSI line is color-coded for easy differentiation and equipped with labels at the last bar for a clutter-free view.
Our indicator is designed with user-friendly customization features. You can easily adjust the length of the RSI and the time frame according to your trading strategy. It also handles gaps in the chart data with the barmerge.gaps_on option, ensuring accurate and consistent RSI calculations.
Whether you are a novice trader seeking to understand market dynamics better or an experienced trader wanting to diversify your technical analysis, the MCRSI offers a unique perspective of the forex market. This multi-currency approach can help identify potential trading opportunities that could be missed when analyzing currencies in isolation.
Harness the power of multi-currency RSI analysis with our MCRSI Indicator. It's time to step up your trading game!
Features:
Tracks 8 different currencies simultaneously
Color-coded RSI lines for easy identification
Customizable RSI length and time frame
Handles gaps in chart data
Last bar labels for a clutter-free view
Ideal for forex traders of all experience levels
How to Use:
Add the MCRSI to your TradingView chart.
Adjust the RSI length and time frame as needed.
Monitor the RSI lines and their intersections for potential trading signals.
Happy trading!
Advanced Dynamic Threshold RSI [Elysian_Mind]Advanced Dynamic Threshold RSI Indicator
Overview
The Advanced Dynamic Threshold RSI Indicator is a powerful tool designed for traders seeking a unique approach to RSI-based signals. This indicator combines traditional RSI analysis with dynamic threshold calculation and optional Bollinger Bands to generate weighted buy and sell signals.
Features
Dynamic Thresholds: The indicator calculates dynamic thresholds based on market volatility, providing more adaptive signal generation.
Performance Analysis: Users can evaluate recent price performance to further refine signals. The script calculates the percentage change over a specified lookback period.
Bollinger Bands Integration: Optional integration of Bollinger Bands for additional confirmation and visualization of potential overbought or oversold conditions.
Customizable Settings: Traders can easily customize key parameters, including RSI length, SMA length, lookback bars, threshold multiplier, and Bollinger Bands parameters.
Weighted Signals: The script introduces a unique weighting mechanism for signals, reducing false positives and improving overall reliability.
Underlying Calculations and Methods
1. Dynamic Threshold Calculation:
The heart of the Advanced Dynamic Threshold RSI Indicator lies in its ability to dynamically calculate thresholds based on multiple timeframes. Let's delve into the technical details:
RSI Calculation:
For each specified timeframe (1-hour, 4-hour, 1-day, 1-week), the Relative Strength Index (RSI) is calculated using the standard 14-period formula.
SMA of RSI:
The Simple Moving Average (SMA) is applied to each RSI, resulting in the smoothing of RSI values. This smoothed RSI becomes the basis for dynamic threshold calculations.
Dynamic Adjustment:
The dynamically adjusted threshold for each timeframe is computed by adding a constant value (5 in this case) to the respective SMA of RSI. This dynamic adjustment ensures that the threshold reflects changing market conditions.
2. Weighted Signal System:
To enhance the precision of buy and sell signals, the script introduces a weighted signal system. Here's how it works technically:
Signal Weighting:
The script assigns weights to buy and sell signals based on the crossover and crossunder events between RSI and the dynamically adjusted thresholds. If a crossover event occurs, the weight is set to 2; otherwise, it remains at 1.
Signal Combination:
The weighted buy and sell signals from different timeframes are combined using logical operations. A buy signal is generated if the product of weights from all timeframes is equal to 2, indicating alignment across timeframe.
3. Experimental Enhancements:
The Advanced Dynamic Threshold RSI Indicator incorporates experimental features for educational exploration. While not intended as proven strategies, these features aim to offer users a glimpse into unconventional analysis. Some of these features include Performance Calculation, Volatility Calculation, Dynamic Threshold Calculation Using Volatility, Bollinger Bands Module, Weighted Signal System Incorporating New Features.
3.1 Performance Calculation:
The script calculates the percentage change in the price over a specified lookback period (variable lookbackBars). This provides a measure of recent performance.
pctChange(src, length) =>
change = src - src
pctChange = (change / src ) * 100
recentPerformance1H = pctChange(close, lookbackBars)
recentPerformance4H = pctChange(request.security(syminfo.tickerid, "240", close), lookbackBars)
recentPerformance1D = pctChange(request.security(syminfo.tickerid, "1D", close), lookbackBars)
3.2 Volatility Calculation:
The script computes the standard deviation of the closing price to measure volatility.
volatility1H = ta.stdev(close, 20)
volatility4H = ta.stdev(request.security(syminfo.tickerid, "240", close), 20)
volatility1D = ta.stdev(request.security(syminfo.tickerid, "1D", close), 20)
3.3 Dynamic Threshold Calculation Using Volatility:
The dynamic thresholds for RSI are calculated by adding a multiplier of volatility to 50.
dynamicThreshold1H = 50 + thresholdMultiplier * volatility1H
dynamicThreshold4H = 50 + thresholdMultiplier * volatility4H
dynamicThreshold1D = 50 + thresholdMultiplier * volatility1D
3.4 Bollinger Bands Module:
An additional module for Bollinger Bands is introduced, providing an option to enable or disable it.
// Additional Module: Bollinger Bands
bbLength = input(20, title="Bollinger Bands Length")
bbMultiplier = input(2.0, title="Bollinger Bands Multiplier")
upperBand = ta.sma(close, bbLength) + bbMultiplier * ta.stdev(close, bbLength)
lowerBand = ta.sma(close, bbLength) - bbMultiplier * ta.stdev(close, bbLength)
3.5 Weighted Signal System Incorporating New Features:
Buy and sell signals are generated based on the dynamic threshold, recent performance, and Bollinger Bands.
weightedBuySignal = rsi1H > dynamicThreshold1H and rsi4H > dynamicThreshold4H and rsi1D > dynamicThreshold1D and crossOver1H
weightedSellSignal = rsi1H < dynamicThreshold1H and rsi4H < dynamicThreshold4H and rsi1D < dynamicThreshold1D and crossUnder1H
These features collectively aim to provide users with a more comprehensive view of market dynamics by incorporating recent performance and volatility considerations into the RSI analysis. Users can experiment with these features to explore their impact on signal accuracy and overall indicator performance.
Indicator Placement for Enhanced Visibility
Overview
The design choice to position the "Advanced Dynamic Threshold RSI" indicator both on the main chart and beneath it has been carefully considered to address specific challenges related to visibility and scaling, providing users with an improved analytical experience.
Challenges Faced
1. Differing Scaling of RSI Results:
RSI values for different timeframes (1-hour, 4-hour, and 1-day) often exhibit different scales, especially in markets like gold.
Attempting to display these RSIs on the same chart can lead to visibility issues, as the scaling differences may cause certain RSI lines to appear compressed or nearly invisible.
2. Candlestick Visibility vs. RSI Scaling:
Balancing the visibility of candlestick patterns with that of RSI values posed a unique challenge.
A single pane for both candlesticks and RSIs may compromise the clarity of either, particularly when dealing with assets that exhibit distinct volatility patterns.
Design Solution
Placing the buy/sell signals above/below the candles helps to maintain a clear association between the signals and price movements.
By allocating RSIs beneath the main chart, users can better distinguish and analyze the RSI values without interference from candlestick scaling.
Doubling the scaling of the 1-hour RSI (displayed in blue) addresses visibility concerns and ensures that it remains discernible even when compared to the other two RSIs: 4-hour RSI (orange) and 1-day RSI (green).
Bollinger Bands Module is optional, but is turned on as default. When the module is turned on, the users can see the upper Bollinger Band (green) and lower Bollinger Band (red) on the main chart to gain more insight into price actions of the candles.
User Flexibility
This dual-placement approach offers users the flexibility to choose their preferred visualization:
The main chart provides a comprehensive view of buy/sell signals in relation to candlestick patterns.
The area beneath the chart accommodates a detailed examination of RSI values, each in its own timeframe, without compromising visibility.
The chosen design optimizes visibility and usability, addressing the unique challenges posed by differing RSI scales and ensuring users can make informed decisions based on both price action and RSI dynamics.
Usage
Installation
To ensure you receive updates and enhancements seamlessly, follow these steps:
Open the TradingView platform.
Navigate to the "Indicators" tab in the top menu.
Click on "Community Scripts" and search for "Advanced Dynamic Threshold RSI Indicator."
Select the indicator from the search results and click on it to add to your chart.
This ensures that any future updates to the indicator can be easily applied, keeping you up-to-date with the latest features and improvements.
Review Code
Open TradingView and navigate to the Pine Editor.
Copy the provided script.
Paste the script into the Pine Editor.
Click "Add to Chart."
Configuration
The indicator offers several customizable settings:
RSI Length: Defines the length of the RSI calculation.
SMA Length: Sets the length of the SMA applied to the RSI.
Lookback Bars: Determines the number of bars used for recent performance analysis.
Threshold Multiplier: Adjusts the multiplier for dynamic threshold calculation.
Enable Bollinger Bands: Allows users to enable or disable Bollinger Bands integration.
Interpreting Signals
Buy Signal: Generated when RSI values are above dynamic thresholds and a crossover occurs.
Sell Signal: Generated when RSI values are below dynamic thresholds and a crossunder occurs.
Additional Information
The indicator plots scaled RSI lines for 1-hour, 4-hour, and 1-day timeframes.
Users can experiment with additional modules, such as machine-learning simulation, dynamic real-life improvements, or experimental signal filtering, depending on personal preferences.
Conclusion
The Advanced Dynamic Threshold RSI Indicator provides traders with a sophisticated tool for RSI-based analysis, offering a unique combination of dynamic thresholds, performance analysis, and optional Bollinger Bands integration. Traders can customize settings and experiment with additional modules to tailor the indicator to their trading strategy.
Disclaimer: Use of the Advanced Dynamic Threshold RSI Indicator
The Advanced Dynamic Threshold RSI Indicator is provided for educational and experimental purposes only. The indicator is not intended to be used as financial or investment advice. Trading and investing in financial markets involve risk, and past performance is not indicative of future results.
The creator of this indicator is not a financial advisor, and the use of this indicator does not guarantee profitability or specific trading outcomes. Users are encouraged to conduct their own research and analysis and, if necessary, consult with a qualified financial professional before making any investment decisions.
It is important to recognize that all trading involves risk, and users should only trade with capital that they can afford to lose. The Advanced Dynamic Threshold RSI Indicator is an experimental tool that may not be suitable for all individuals, and its effectiveness may vary under different market conditions.
By using this indicator, you acknowledge that you are doing so at your own risk and discretion. The creator of this indicator shall not be held responsible for any financial losses or damages incurred as a result of using the indicator.
Kind regards,
Ely
Easy RSI Trend - The trend is your friend till the endThis indicator detects the trend for you and keeps you out of choppy markets. It does not give you a signal, rather it tells you for what kind of signals to look for on the top right of the screen: "Only Longs" or "Only Shorts"
If there is no trend or if a trend is overextended (overbought, oversold) it tells you: "No trade allowed"
The indicator does this by scanning the 4h and daily RSI. Both are displayed in a small table in the bottom right of the screen. The upper cell is the 4h RSI and the other the daily RSI value.
AGAIN: This indicator does not give you a signal. It only tells you the direction in which you should trade. It should be used with an indicator or a strategy that gives you a clear signal.
OneThingToRuleThemAll [v1.4]This script was created because I wanted to be able to display a contextual chart of commonly used indicators for scalping and swing traders, with the ability to control the visual representation on the charts as their cross-overs, cross-unders, or changes of state happen in real time. Additionally, I wanted the ability to control how or when they are displayed. While looking through other community projects, I found they lacked the ability to full customize the output controls and values used for these indicators.
The script leverages standard RSI/MACD/VWAP/MVWAP/EMA calculations to help a trader visually make more informed decisions on entering or exiting a trade, depending on their understanding on what the indicators represent. Paired with a table directly on the chart, it allows a trader to quickly reference values to make more informed decisions without having to look away from the price action or look through multiple indicator outputs.
The main functionality of the indicator is controlled within the settings directly on the chart. There a user can enable the visual representations, or disable, and configure how they are displayed on the charts by altering their values or style types.
Users have the ability to enable/disable visual representations of:
The indicator chart
RSI Cross-over and RSI Reversals
MACD Uptrends and Downtrends
VWAP Cross-overs and Cross-unders
VWAP Line
MVWAP Cross-overs and Cross-unders
MVWAP Line
EMA Cross-overs and Cross-unders
EMA Line
Some traders like to use these visual indications as thresholds to enter or exit trades. Its best to find out which ones work the best with the security you are trying to trade. Personally, I use the table as a reference in conjunction with the RSI chart indicators to help me decide a logical trailing stop if I am scalping. Some users might like the track EMA200 crossovers, and have visual representations on the chart for when that happens. However, users may use the other indicators in other methods, and this script provides the ability to be able to configure those both visually and by value.
The pine script code is open source and itself is fairly straightforward, it is mostly written to provide the ultimate level of control the the user of the various indicators. Please reach out to me directly if you would like a further understanding of the code and an explanation on anything that may be unclear.
Enjoy :)
-dead1.
RSI MFI MultiTimeframe Oversold/OverboughtHello Traders,
This indicator is designed to easily visualize the overbought/oversold states of RSI and MFI across multiple timeframes.
The indicator is very straightforward.
The deeper the red, the closer it is to 0, and the deeper the green, the closer it is to 100. The intermediate values are rendered in a transparent gray to focus on the key regions.
However, I understand that traders may have an interest in knowing the most recent state of the oscillator, whether it was overbought or oversold.
For this reason, I have included the 'Gradient Color' option in the color settings.
By turning off this option, you can easily see at a glance which region the oscillator was in most recently.
(Gradient Color Option Off)
In addition, I know that many traders are interested in the actual RSI/MFI values across multiple timeframes.
Thus, I have displayed the RSI/MFI values for each timeframe on the far right.
Furthermore, although the name of this indicator is RSI MFI MultiTimeframe Oversold/Overbought, I have also included the Stochastic RSI as an option, as I find it personally useful.
Feel free to use it if you find it helpful.
Unbound RSIUnbound RSI
Description
The Unbound RSI or de-oscillated RSI indicator is a novel technical analysis indicator that combines the concepts of the Relative Strength Index (RSI) and moving averages, applied directly over the price chart. This indicator is unique in its approach by transforming the oscillatory nature of the RSI into a format that aligns with the price action, thereby offering a distinctive view of market momentum and trends.
Key Features
Multi-Length RSI Analysis: Incorporates three different lengths of RSI (short, medium, and long), providing insights into the momentum and trend strength at various timeframes.
Deoscillation of RSI: The RSI for each length is 'deoscillated' by adjusting its scale to align with the actual price movements. This is achieved by shifting and scaling the RSI values, effectively merging them with the price line.
Average True Range (ATR) Scaling: The deoscillation process includes scaling by the Average True Range (ATR), making the indicator responsive to the asset’s volatility.
Optional Smoothing: Provides an option to apply a simple moving average (SMA) smoothing to each deoscillated RSI line, reducing noise and highlighting more significant trends.
Dynamic Moving Average (MA) Baseline: Features a moving average calculated from the medium length (default value) de-oscillated RSI, serving as a dynamic baseline to identify overarching trends.
How It’s Different
Unlike standard RSI indicators that oscillate in a fixed range, this indicator transforms the RSI to move in tandem with the price, offering a unique perspective on momentum and trend changes. The use of multiple timeframes for RSI and the inclusion of a dynamic MA baseline provide a multifaceted view of market conditions.
Potential Usage
Trend Identification: The position of the price in relation to the different deoscillated RSI lines and the MA baseline can indicate the prevailing market trend.
Momentum Shifts: Crossovers of the price with the deoscillated RSI lines or the MA baseline can signal potential shifts in momentum, offering entry or exit points.
Volatility Awareness: The ATR-based scaling of the deoscillated RSI lines means the indicator adjusts to changes in volatility, potentially offering more reliable signals in different market conditions.
Comparative Analysis: By comparing the short, medium, and long deoscillated RSI lines, traders can gauge the strength of trends and the convergence or divergence of momentum across timeframes.
Best Practices
Backtesting: Given its novel nature, it’s crucial to backtest the indicator across different assets and market conditions.
Complementary Tools: Combine with other technical analysis tools (like support/resistance levels, other oscillators, volume analysis) for more robust trading signals.
Risk Management: Always use sound risk management strategies, as no single indicator provides foolproof signals.
Dynamic Trend Fusion (DTF)The "Dynamic Trend Fusion" (DTF) indicator is a powerful technical analysis tool for traders. It stands out from other indicators due to its adaptability and ability to provide insights into different trading styles. Users can choose from various trading options such as "Short-term Trading," "Long-term Trading," "Aggressive Short-term," "Conservative Long-term," "Balanced Approach," "High Sensitivity," "Low Sensitivity," "Day Trading," and "Swing Trading." These options allow traders to customize the indicator to suit their specific trading strategies.
DTF combines the Moving Average Convergence Divergence (MACD) and Relative Strength Index (RSI) indicators, normalizing them to a similar scale for a comprehensive view of market conditions. It then calculates a combined value and smoothes it using a moving average.
One of its standout features is the ability to identify bullish and bearish states, which is represented visually on the chart. When the indicator detects a transition from a bullish to a bearish state or vice versa, the color of the line changes.
Additionally, DTF offers alert conditions, notifying users when the market shifts into a bullish or bearish state, allowing for timely decision-making.
In summary, the DTF indicator sets itself apart by providing traders with a versatile tool that can be tailored to various trading styles and offers clear visual signals for trend changes, enhancing trading precision and efficiency.
Multi-data oscillatorThe multi-data oscillator is a tool created to help traders visualize clearly how an oscillator works and moves considering different input parameters.
In this tool, you can choose to visualize the script as the RSI, the CCI, the LOC indicator, a custom-created formula that simply shows the location of the data considering X past values, or the average of all of these three indicators.
In the settings, you can choose both the length of the indicator and the smoothing factor.
Additionally, the indicator has a gradient color that changes considering the deviation and the variance of the different lines used to calculate the average line, displayed with more thickness.
[KVA]nRSIThe nRSI stands as a groundbreaking enhancement of the traditional Relative Strength Index (RSI), specifically engineered for traders seeking a more refined and accurate tool in fast-moving markets.
Customizable Price Change Period (n): Unlike the traditional RSI which solely relies on a fixed period for average gains and losses, the nRSI introduces an additional parameter, n, to calculate price changes.
This adaptation focuses on minimizing market noise, sharpening the indicator's sensitivity to genuine trends and patterns.
Enhanced Signal Precision : By reducing the influence of short-term price spikes and fluctuations, the nRSI delivers a more precise signal. This precision is particularly crucial in volatile market conditions, where traditional indicators may be swayed by transient movements.
Ideal Usage
Strategic Trading Decisions : Ideal for traders who need to filter out insignificant price movements to make more strategic, informed trading decisions.
Reliable Divergence Spotting : Enhanced noise reduction aids in identifying more reliable divergences, key for predicting potential market reversals.
Trend Confirmation : The smoothed RSI, assisted by the moving average, becomes an invaluable tool for confirming the validity of market trends, minimizing false signals.
Harmonic Trend Fusion [kikfraben]📈 Harmonic Trend Fusion - Your Personal Trading Assistant
This versatile tool combines multiple indicators to provide a holistic view of market trends and potential signals.
🚀 Key Features:
Multi-Indicator Synergy: Benefit from the combined insights of Aroon, DMI, MACD, Parabolic SAR, RSI, Supertrend, and SMI Ergodic Oscillator, all in one powerful indicator.
Customizable Plot Options: Tailor your chart by choosing which signals to visualize. Whether you're interested in trendlines, histograms, or specific indicators, the choice is yours.
Color-Coded Trends: Quickly identify bullish and bearish trends with the color-coded visualizations. Stay ahead of market movements with clear and intuitive signals.
Table Display: Stay informed at a glance with the interactive table. It dynamically updates to reflect the current market sentiment, providing you with key information and trend direction.
Precision Control: Fine-tune your analysis with precision control over indicator parameters. Adjust lengths, colors, and other settings to align with your unique trading strategy.
🛠️ How to Use:
Customize Your View: Select which indicators to display and adjust plot options to suit your preferences.
Table Insights: Monitor the dynamic table for real-time updates on market sentiment and trend direction.
Indicator Parameters: Experiment with different lengths and settings to find the combination that aligns with your trading style.
Whether you're a seasoned trader or just starting, Harmonic Trend Fusion equips you with the tools you need to navigate the markets confidently. Take control of your trading journey and enhance your decision-making process with this comprehensive trading assistant.
MACD_RSI_trend_followingINFO:
This indicator can be used to build-up a strategy for trading of assets which are currently in trending phase.
My preference is to use it on slowly moving assets like GOLD and on higher timeframes, but practice may show that we find more usefull cases.
This script uses two indicators - MACD and RSI, as the timeframe that those are extracted for is configurable (defaults with the Chart TF, but can be any other selected by the user).
The strategy has the following simple idea - buy if any if the conditions below is true:
The selected TF MACD line crosses above the signal line and the TF RSI is above the user selected trigger value
The selected TF MACD line is above the signal line and the TF RSI crosses above the user selected trigger value
Once we're in position we wait for the selected TF MACD line to cross below the signal line, and then we set a SL at the low of that bar
DETAILS and USAGE:
In the current implementation I find two possible use cases for the indicator:
as a stand-alone indicator on the chart which can also fire alerts that can help to determine if we want to manually enter/exit trades based on them
can be used to connect to the Signal input of the TTS (TempalteTradingStrategy) by jason5480 in order to backtest it, thus effectively turning it into a strategy (instructions below in TTS CONNECTIVITY section)
In the example below we see a position opened at the bar after the buy indicator from the script has been triggered, and then later after the SL indicator from the script has been triggered a SL has been set on the lower wick of the closing candle, and the position eventually got closed once the price hit that level. Note that most of the drawing on the example snapshot below are from the TTS indicator following the buy/sell/SL conditions themseves:
Trading period can be selected from the indicator itself to limit to more interesting periods.
Arrow indications are drawn on the chart to indicate the trading conditions met in the script - green arrow for a buy signal indication and orange for LTF crossunder to indicate setting of SL.
SETTINGS:
Leaving all of the settings as in vanilla use case, as both the MACD and RSI indicator's settings follow the default ones for the stand-alone indicators themselves.
The start-end date is a time filter that can be extermely usefull when backtesting different time periods.
Pesonal preference is using the script on a D/W timeframe, while the indicator is configured to use Monthly chart.
The default value of the RSI filter is left to 50, which can be changed. I.e. if the RSI is above 50 we have a regime filter based on the MACD criteria.
EXTERNAL LIBRARIES:
The script uses a couple of external libraries:
HeWhoMustNotBeNamed/enhanced_ta/14 - collection of TA indicators
jason5480/tts_convention/3 - more details about the Template Trading Strategy below
I would like to highly appreciate and credit the work of both HeWhoMustNotBeNamed and jason5480 for providing them to the community.
TTS SETTINGS (NEEDED IF USED TO BACKTEST WITH TTS):
The TempalteTradingStrategy is a strategy script developed in Pine by jason5480, which I recommend for quick turn-around of testing different ideas on a proven and tested framework
I cannot give enough credit to the developer for the efforts put in building of the infrastructure, so I advice everyone that wants to use it first to get familiar with the concept and by checking
by checking jason5480's profile www.tradingview.com
The TTS itself is extremely functional and have a lot of properties, so its functionality is beyond the scope of the current script -
Again, I strongly recommend to be thoroughly epxlored by everyone that plans on using it.
In the nutshell it is a script that can be feed with buy/sell signals from an external indicator script and based on many configuration options it can determine how to execute the trades.
The TTS has many settings that can be applied, so below I will cover only the ones that differ from the default ones, at least according to my testing - do your own research, you may find something even better :)
The current/latest version that I've been using as of writing and testing this script is TTSv48
Settings which differ from the default ones:
from - False (time filter is from the indicator script itself)
Deal Conditions Mode - External (take enter/exit conditions from an external script)
🔌Signal 🛈➡ - MACD_RSI_trend_following: 🔌Signal to TTSv48 (this is the output from the indicator script, according to the TTS convention)
Sat/Sun - true (for crypto, in order to trade 24/7)
Order Type - STOP (perform stop order)
Distance Method - HHLL (HigherHighLowerLow - in order to set the SL according to the strategy definition from above)
The next are just personal preferenes, you can feel free to experiment according to your trading style
Take Profit Targets - 0 (either 100% in or out, no incremental stepping in or out of positions)
Dist Mul|Len Long/Short- 10 (make sure that we don't close on profitable trades by any reason)
Quantity Method - EQUITY (personal backtesting preference is to consider each backtest as a separate portfolio, so determine the position size by 100% of the allocated equity size)
Equity % - 100 (note above)
RSI & Backed-Weighted MA StrategyRSI & MA Strategy :
INTRODUCTION :
This strategy is based on two well-known indicators that work best together: the Relative Strength Index (RSI) and the Moving Average (MA). We're going to use the RSI as a trend-follower indicator, rather than a reversal indicator as most are used to. To the signals sent by the RSI, we'll add a condition on the chart's MA, filtering out irrelevant signals and considerably increasing our winning rate. This is a medium/long-term strategy. There's also a money management method enabling us to reinvest part of the profits or reduce the size of orders in the event of substantial losses.
RSI :
The RSI is one of the best-known and most widely used indicators in trading. Its purpose is to warn traders when an asset is overbought or oversold. It was designed to send reversal signals, but we're going to use it as a trend indicator by increasing its length to 20. The RSI formula is as follows :
RSI (n) = 100 - (100 / (1 + (H (n)/L (n))))
With n the length of the RSI, H(n) the average of days closing above the open and L(n) the average of days closing below the open.
MA :
The Moving Average is also widely used in technical analysis, to smooth out variations in an asset. The SMA formula is as follows :
SMA (n) = (P1 + P2 + ... + Pn) / n
where n is the length of the MA.
However, an SMA does not weight any of its terms, which means that the price 10 days ago has the same importance as the price 2 days ago or today's price... That's why in this strategy we use a RWMA, i.e. a back-weighted moving average. It weights old prices more heavily than new ones. This will enable us to limit the impact of short-term variations and focus on the trend that was dominating. The RWMA used weights :
The 4 most recent terms by : 100 / (4+(n-4)*1.30)
The other oldest terms by : weight_4_first_term*1.30
So the older terms are weighted 1.30 more than the more recent ones. The moving average thus traces a trend that accentuates past values and limits the noise of short-term variations.
PARAMETERS :
RSI Length : Lenght of RSI. Default is 20.
MA Type : Choice between a SMA or a RWMA which permits to minimize the impact of short term reversal. Default is RWMA.
MA Length : Length of the selected MA. Default is 19.
RSI Long Signal : Minimum value of RSI to send a LONG signal. Default is 60.
RSI Short signal : Maximum value of RSI to send a SHORT signal. Default is 40.
ROC MA Long Signal : Maximum value of Rate of Change MA to send a LONG signal. Default is 0.
ROC MA Short signal : Minimum value of Rate of Change MA to send a SHORT signal. Default is 0.
TP activation in multiple of ATR : Threshold value to trigger trailing stop Take Profit. This threshold is calculated as multiple of the ATR (Average True Range). Default value is 5 meaning that to trigger the trailing TP the price need to move 5*ATR in the right direction.
Trailing TP in percentage : Percentage value of trailing Take Profit. This Trailing TP follows the profit if it increases, remaining selected percentage below it, but stops if the profit decreases. Default is 3%.
Fixed Ratio : This is the amount of gain or loss at which the order quantity is changed. Default is 400, which means that for each $400 gain or loss, the order size is increased or decreased by a user-selected amount.
Increasing Order Amount : This is the amount to be added to or subtracted from orders when the fixed ratio is reached. The default is $200, which means that for every $400 gain, $200 is reinvested in the strategy. On the other hand, for every $400 loss, the order size is reduced by $200.
Initial capital : $1000
Fees : Interactive Broker fees apply to this strategy. They are set at 0.18% of the trade value.
Slippage : 3 ticks or $0.03 per trade. Corresponds to the latency time between the moment the signal is received and the moment the order is executed by the broker.
Important : A bot has been used to test the different parameters and determine which ones maximize return while limiting drawdown. This strategy is the most optimal on BITSTAMP:ETHUSD with a timeframe set to 6h. Parameters are set as follows :
MA type: RWMA
MA Length: 19
RSI Long Signal: >60
RSI Short Signal : <40
ROC MA Long Signal : <0
ROC MA Short Signal : >0
TP Activation in multiple ATR : 5
Trailing TP in percentage : 3
ENTER RULES :
The principle is very simple:
If the asset is overbought after a bear market, we are LONG.
If the asset is oversold after a bull market, we are SHORT.
We have defined a bear market as follows : Rate of Change (20) RWMA < 0
We have defined a bull market as follows : Rate of Change (20) RWMA > 0
The Rate of Change is calculated using this formula : (RWMA/RWMA(20) - 1)*100
Overbought is defined as follows : RSI > 60
Oversold is defined as follows : RSI < 40
LONG CONDITION :
RSI > 60 and (RWMA/RWMA(20) - 1)*100 < -1
SHORT CONDITION :
RSI < 40 and (RWMA/RWMA(20) - 1)*100 > 1
EXIT RULES FOR WINNING TRADE :
We have a trailing TP allowing us to exit once the price has reached the "TP Activation in multiple ATR" parameter, i.e. 5*ATR by default in the profit direction. TP trailing is triggered at this point, not limiting our gains, and securing our profits at 3% below this trigger threshold.
Remember that the True Range is : maximum(H-L, H-C(1), C-L(1))
with C : Close, H : High, L : Low
The Average True Range is therefore the average of these TRs over a length defined by default in the strategy, i.e. 20.
RISK MANAGEMENT :
This strategy may incur losses. The method for limiting losses is to set a Stop Loss equal to 3*ATR. This means that if the price moves against our position and reaches three times the ATR, we exit with a loss.
Sometimes the ATR can result in a SL set below 10% of the trade value, which is not acceptable. In this case, we set the SL at 10%, limiting losses to a maximum of 10%.
MONEY MANAGEMENT :
The fixed ratio method was used to manage our gains and losses. For each gain of an amount equal to the value of the fixed ratio, we increase the order size by a value defined by the user in the "Increasing order amount" parameter. Similarly, each time we lose an amount equal to the value of the fixed ratio, we decrease the order size by the same user-defined value. This strategy increases both performance and drawdown.
Enjoy the strategy and don't forget to take the trade :)