Machine Learning: Optimal RSI [YinYangAlgorithms]This Indicator, will rate multiple different lengths of RSIs to determine which RSI to RSI MA cross produced the highest profit within the lookback span. This ‘Optimal RSI’ is then passed back, and if toggled will then be thrown into a Machine Learning calculation. You have the option to Filter RSI and RSI MA’s within the Machine Learning calculation. What this does is, only other Optimal RSI’s which are in the same bullish or bearish direction (is the RSI above or below the RSI MA) will be added to the calculation.
You can either (by default) use a Simple Average; which is essentially just a Mean of all the Optimal RSI’s with a length of Machine Learning. Or, you can opt to use a k-Nearest Neighbour (KNN) calculation which takes a Fast and Slow Speed. We essentially turn the Optimal RSI into a MA with different lengths and then compare the distance between the two within our KNN Function.
RSI may very well be one of the most used Indicators for identifying crucial Overbought and Oversold locations. Not only that but when it crosses its Moving Average (MA) line it may also indicate good locations to Buy and Sell. Many traders simply use the RSI with the standard length (14), however, does that mean this is the best length?
By using the length of the top performing RSI and then applying some Machine Learning logic to it, we hope to create what may be a more accurate, smooth, optimal, RSI.
Tutorial:
This is a pretty zoomed out Perspective of what the Indicator looks like with its default settings (except with Bollinger Bands and Signals disabled). If you look at the Tables above, you’ll notice, currently the Top Performing RSI Length is 13 with an Optimal Profit % of: 1.00054973. On its default settings, what it does is Scan X amount of RSI Lengths and checks for when the RSI and RSI MA cross each other. It then records the profitability of each cross to identify which length produced the overall highest crossing profitability. Whichever length produces the highest profit is then the RSI length that is used in the plots, until another length takes its place. This may result in what we deem to be the ‘Optimal RSI’ as it is an adaptive RSI which changes based on performance.
In our next example, we changed the ‘Optimal RSI Type’ from ‘All Crossings’ to ‘Extremity Crossings’. If you compare the last two examples to each other, you’ll notice some similarities, but overall they’re quite different. The reason why is, the Optimal RSI is calculated differently. When using ‘All Crossings’ everytime the RSI and RSI MA cross, we evaluate it for profit (short and long). However, with ‘Extremity Crossings’, we only evaluate it when the RSI crosses over the RSI MA and RSI <= 40 or RSI crosses under the RSI MA and RSI >= 60. We conclude the crossing when it crosses back on its opposite of the extremity, and that is how it finds its Optimal RSI.
The way we determine the Optimal RSI is crucial to calculating which length is currently optimal.
In this next example we have zoomed in a bit, and have the full default settings on. Now we have signals (which you can set alerts for), for when the RSI and RSI MA cross (green is bullish and red is bearish). We also have our Optimal RSI Bollinger Bands enabled here too. These bands allow you to see where there may be Support and Resistance within the RSI at levels that aren’t static; such as 30 and 70. The length the RSI Bollinger Bands use is the Optimal RSI Length, allowing it to likewise change in correlation to the Optimal RSI.
In the example above, we’ve zoomed out as far as the Optimal RSI Bollinger Bands go. You’ll notice, the Bollinger Bands may act as Support and Resistance locations within and outside of the RSI Mid zone (30-70). In the next example we will highlight these areas so they may be easier to see.
Circled above, you may see how many times the Optimal RSI faced Support and Resistance locations on the Bollinger Bands. These Bollinger Bands may give a second location for Support and Resistance. The key Support and Resistance may still be the 30/50/70, however the Bollinger Bands allows us to have a more adaptive, moving form of Support and Resistance. This helps to show where it may ‘bounce’ if it surpasses any of the static levels (30/50/70).
Due to the fact that this Indicator may take a long time to execute and it can throw errors for such, we have added a Setting called: Adjust Optimal RSI Lookback and RSI Count. This settings will automatically modify the Optimal RSI Lookback Length and the RSI Count based on the Time Frame you are on and the Bar Indexes that are within. For instance, if we switch to the 1 Hour Time Frame, it will adjust the length from 200->90 and RSI Count from 30->20. If this wasn’t adjusted, the Indicator would Timeout.
You may however, change the Setting ‘Adjust Optimal RSI Lookback and RSI Count’ to ‘Manual’ from ‘Auto’. This will give you control over the ‘Optimal RSI Lookback Length’ and ‘RSI Count’ within the Settings. Please note, it will likely take some “fine tuning” to find working settings without the Indicator timing out, but there are definitely times you can find better settings than our ‘Auto’ will create; especially on higher Time Frames. The Minimum our ‘Auto’ will create is:
Optimal RSI Lookback Length: 90
RSI Count: 20
The Maximum it will create is:
Optimal RSI Lookback Length: 200
RSI Count: 30
If there isn’t much bar index history, for instance, if you’re on the 1 Day and the pair is BTC/USDT you’ll get < 4000 Bar Indexes worth of data. For this reason it is possible to manually increase the settings to say:
Optimal RSI Lookback Length: 500
RSI Count: 50
But, please note, if you make it too high, it may also lead to inaccuracies.
We will conclude our Tutorial here, hopefully this has given you some insight as to how calculating our Optimal RSI and then using it within Machine Learning may create a more adaptive RSI.
Settings:
Optimal RSI:
Show Crossing Signals: Display signals where the RSI and RSI Cross.
Show Tables: Display Information Tables to show information like, Optimal RSI Length, Best Profit, New Optimal RSI Lookback Length and New RSI Count.
Show Bollinger Bands: Show RSI Bollinger Bands. These bands work like the TDI Indicator, except its length changes as it uses the current RSI Optimal Length.
Optimal RSI Type: This is how we calculate our Optimal RSI. Do we use all RSI and RSI MA Crossings or just when it crosses within the Extremities.
Adjust Optimal RSI Lookback and RSI Count: Auto means the script will automatically adjust the Optimal RSI Lookback Length and RSI Count based on the current Time Frame and Bar Index's on chart. This will attempt to stop the script from 'Taking too long to Execute'. Manual means you have full control of the Optimal RSI Lookback Length and RSI Count.
Optimal RSI Lookback Length: How far back are we looking to see which RSI length is optimal? Please note the more bars the lower this needs to be. For instance with BTC/USDT you can use 500 here on 1D but only 200 for 15 Minutes; otherwise it will timeout.
RSI Count: How many lengths are we checking? For instance, if our 'RSI Minimum Length' is 4 and this is 30, the valid RSI lengths we check is 4-34.
RSI Minimum Length: What is the RSI length we start our scans at? We are capped with RSI Count otherwise it will cause the Indicator to timeout, so we don't want to waste any processing power on irrelevant lengths.
RSI MA Length: What length are we using to calculate the optimal RSI cross' and likewise plot our RSI MA with?
Extremity Crossings RSI Backup Length: When there is no Optimal RSI (if using Extremity Crossings), which RSI should we use instead?
Machine Learning:
Use Rational Quadratics: Rationalizing our Close may be beneficial for usage within ML calculations.
Filter RSI and RSI MA: Should we filter the RSI's before usage in ML calculations? Essentially should we only use RSI data that are of the same type as our Optimal RSI? For instance if our Optimal RSI is Bullish (RSI > RSI MA), should we only use ML RSI's that are likewise bullish?
Machine Learning Type: Are we using a Simple ML Average, KNN Mean Average, KNN Exponential Average or None?
KNN Distance Type: We need to check if distance is within the KNN Min/Max distance, which distance checks are we using.
Machine Learning Length: How far back is our Machine Learning going to keep data for.
k-Nearest Neighbour (KNN) Length: How many k-Nearest Neighbours will we account for?
Fast ML Data Length: What is our Fast ML Length? This is used with our Slow Length to create our KNN Distance.
Slow ML Data Length: What is our Slow ML Length? This is used with our Fast Length to create our KNN Distance.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
TDI
Waddah Attar Explosion with TDI First of all, a big shoutout to @shayankm, @LazyBear, @Bromley, @Goldminds and @LuxAlgo, the ones that made this script possible.
This is a version of Waddah Attar Explosion with Traders Dynamic Index.
WAE provides volume and volatility information. Also, WAE calculation was changed to a full-on MACD, to provide the momentum: the idea is to "assess" which MACD bars have significant momentum (i.e. crossover the Explosion Line)
TDI provides momentum, divergences as well as overbought and oversold areas. There is also a RSI on a different timeframe, for convergence.
Almost everything is editable:
- All moving averages are customizable, including the TRAMA, from @LuxAlgo
Waddah Attar Explosion_
- Three different crossing signals: histogram crossing contracting Explosion Line, expanding Explosion Line and ascending Explosion Line while both Bolling Bands are expanding; Explosion Line shows different color when expanding.
- Explosion line signals: Below DeadZone line and Exhaustion (highest value in a given lookback period). You can set a predefined EPL slope to filter out some noise.
- Deadzone signal : Deadzone squeeze ( lowst value in a given lookback period)
TDI:
- Overbought an Oversold signals. The OB and OS shapes have two colors, in order to display extreme signals on current timeframe or extreme signals on current and different time frame.
- Visual display of RSI outside the Bollinger Bands, and crossing of RSI Moving Average crossing of zero line.
I believe this combination is great for so many reasons!
Like the idea of TTM Squeeze? You can tune the Deadzone and Explosion lines to look for a volatility breakout
Like trading divergences or want to filter out extreme areas? The RSI is great for that
You like the using the MACD strategy but don't like the amount of false signals given? this WAE version filters some of them out.
If you are a Bollinger bands fan, you can customize both indicators to trade breakouts and/or mean reversion strategies, and filter out exhaustion of the bands expansion
This is my first publication, so give it a go and provide feedback if possible.
TDI w/ Variety RSI, Averages, & Source Types [Loxx]This hybrid indicator is developed to assist traders in their ability to decipher and monitor market conditions related to trend direction, market strength, and market volatility. Even though comprehensive, the Traders Dynamic Index (TDI) is easy to read and use. This version of TDI has 7 different types of RSI, 38 different types of Moving Averages, 33 source types, and 5 types of signals as well as alerts and coloring. Default RSI type is set to Jurik's RSX. This indicator can be used on any timeframe.
Green/Red line = RSI Price line
White line = Trade Signal line
Dark Green/Red lines = Volatility Band
Yellow line = Market Base Line
Gray dashed lines = Horizontal boundary lines, oversold/overbought
5 Signal Types w/ Alerts
Signal Crosses = Green/Red line crosses over or under White line
Floating Boundary Crosses = Green/Red line crosses over or under upper Dark Green/ lower Red lines
Horizontal Boundary Crosses = Green/Red line crosses over or under Gray dashed upper/lower lines
Floating Middle Crosses = Green/Red line crosses over or under Yellow line
Horizontal Middle Crosses = Green/Red line crosses over or under Gray dashed middle line
Manual Signal Types (no alerts included, this requires manual analysis)
Volatility Band Signals (Dark Green/Red lines) = When the Dark Green/Red lines are expanding, the market is strong and trending. When Dark Green/Red lines are constricting, the market is weak and in a range. When the Dark Green/Red lines are extremely tight in a narrow range, expect an economic announcement or other market condition to spike the market
Beyond these simple signal rules, there are various other signals or methods that can be used to derive long/short/exit signals from TDI included slope of the Green/Red line and bounces off the Yellow line.
Included
Loxx's Expanded Source Types
Loxx's Variety RSI
Loxx's Moving Averages
Signals
Alerts
Bar coloring
BTMM|TDIThis is the trader's dynamic index inspired by Steve Mauro's BTMM strategy.
In addition to the RSI, Trendline, Baseline, Volatility Bands I have also included additional trend biases that are painted in the background to provide more confluence when the markets break out in either direction.
For convenience, a position size calculator is included for all users to quickly calculate lot sizes on forex pairs with difference account balance currencies. The calculator works accurately on forex pairs. DO NOT USE for crypto or indices as some brokers have unique contract sizes that could not be fully incorporated into the tool.
There is also data table that displays historical values of the RSI, Trendline, Baseline, and an EMA vs Price scoring procedure that covers the current candle (t0) and up to 3 candles back. The table is meant to provide a snapshot view of either bullish or bearish dominance that can be deciphered with a quick glance.
TDI Hedge Strategy
This is the incomplete version but upon multiple requests, I have released it early. All of the strategy and alert functions are yet to be written and I'll get around to it soon.
This indicator aims to be the best TDI indicator on TradingView. It is a strategy or study. It will have all of the filter, entry, and exit conditions for the strategies around the TDI.
What is implemented
MFI or RSI: the MFI is a much better TDI baseline than the RSI, in my opinion, and very effective
EMA or SMA used for the moving averages on fast, slow, and volatility band
Dynamic timeframe: set a factor of current timeframe and indicator will analyse higher timeframe automatically
Manual timeframe: set a higher timeframe to analyse different to currently viewed
Features for later
conditions for TDI filters/entries/exits
Strategy functions to use built-in strategy tester
BTE signal plot for Backtesting & Trading Engine
alerts
Enjoy!
TDI - Traders Dynamic Index + RSI Divergences + Buy/Sell SignalsTraders Dynamic Index + RSI Divergences + Buy/Sell Signals
Credits to LazyBear (original code author) and JustUncleL (modifications)..
I added some new features:
1- RSI Divergences (Original code from 'Divergence Indicator')
2- Buy/Sell Signals with alerts (Green label 'Buy' - Red label 'Sell')
3- Background colouring when RSI (Green line) crosses above MBL (yellow line)
- Buy and Sell Signals are generated using Dean Malone's method (The Author of the TDI indicator) as mentioned in his PDF: (( www.forexfactory.com )), according to:
** Buy (Green Label) = RSI > 50, Red line, & Yellow line
** Sell (Red Label) = RSI < 50, Red line, & Yellow line
- I found that the best quality long trades generated when RSI crosses above red line, yellow line and they are all above 50, and vice versa for sell trades.
-I figured out another way to generate Buy/Sell Signals when RSI crosses above the yellow line, and you can stay with the trade till RSI crosses under the yellow line (I made a background colouring for that to be easily detected)
Hope you all wonderful trades..
مؤلف المؤشر هو (Dean Malone)
وكتب LazyBear كوده في tradingview
وأضاف JustUncleL بعض التعديلات عليه
أضفت إليه بعض المزايا الأخرى المتمثلة في:
1- رصد انحرافات مؤشر القوة النسبية
2- إشارات بيع وشراء بناء على طريقة مؤلف المؤشر
3- تظليل بالأخضر للمنطقة التي يعبر فيها مؤشر القوة النسبية الخط الأوسط (الخط الأصفر)
إشارات البيع والشراء تكون كالتالي:
** الشراء عندما يكون مؤشر القوة النسبية فوق الخط الأحمر وفوق خط الـ 50 وفوق الخط الأصفر
** البيع عندما يكون مؤشر القوة النسبية تحت الخط الأحمر وتحت خط الـ 50 وتحت الخط الأصفر
** أفضل إشارات الشراء حينما يعبر مؤشر القوة النسبية فوق الخط الأحمر والأصفر، ويكونوا جميعا فوق خط الـ 50، والعكس بالنسبة لإشارات البيع
يمكن استخدام المؤشر في دخول صفقات متوسط المدى، وذلك عندما يعبر مؤشر القوة النسبية فوق الخط الأصفر (قمت بتظليل المنطقة بالأخضر لسهولة رصدها) والخروج من الصفقة إذا نزل مؤشر القوة النسبية عن الخط الأصفر،
يرجى التنبه إلى أن الدخول والخروج يكون بأسباب فنية مدروسة، والمؤشر يدعم قراراتك فقط، ولا يمكن الاعتماد عليه منفردا في تحديد نقاط الدخول أوالخروج.
تجارة موفقة لكم جميعا :)
TDI - Traders Dynamic Index [SystemAlpha]Traders Dynamic Index with Divergence
Credits to the original code author LazyBear and modifications by JustUncleL
[BACKTEST]Traders Dynamic Index Indicator Alert by JustUncleLBy request, this script is a "strategy" version of my "Traders Dynamic Index Indicator Alert" script, made available for backtesting to help find optimal trade settings for a particular asset.
[RESEARCH] TDI with MAThis script is for research purposes. I have used the older RSI calculation (not the TV function) and added the possibility to not use only classic RMA for the RSI calculation but up to 17 different MAs. Added BBS basically TDI and Divergences from Libertus. Happy hunting and if you find something useful dons hesitate to share it :)
TDI @ByPuppyTherapySimilar to my last TDI but was made with the ability to select different bases for both EMAs / BBs.
Only viable bases as far as i have seen are SMA / EMA / KAMA the rest would need much more research.
tradingstrategyguides.com
Mainly graphical changes for my layout + added coloring for all signals that came to my mind.
TEMA / Sentiment crossovers seems to be working a bit better than EMA.
I will update it with more usefull stuff late after i see its performance trading.
TDI - Traders Dynamic Index - Roshan [Mehdi]This method is based on Mr. Roshan's technique which use TDI with upper timeframe
Traders Dynamic Index Indicator Alert v0.1 by JustUncleLThis is a trend trading indicator+alert utilising the Traders Dynamic Index (TDI), Price Action Channel (PAC) and Heikin Ashi candles.
About 6months ago I came across the use of TDI in "E.A.S.Y. Method" that I found in forexfactory forums: www.forexfactory.com
and I was able to set up a chart based on the specifications by using Kurbelklaus scripts. However, I found that the alerts were being generated one or two bars too late, so at that time I was not successful using it with Binary Options. A few months later I found a variation of the method in the forecfactory forums which is able to generate the alerts a bit earlier, so this indicator is a modification of that early detection version.
The indicator can optionally use Heikin Ashi candles only for all it's calculation. I would recommend viewing the chart with Heikin Ashi candles, these smooth out the trends and makes trends very clear.
I found that this method it works good with most currency pairs or commodities and with 5min+ timeframe charts. I would suggest expiry of 2 to 6 candles.
ALERT GENERATION:
=================
The TDI (Traders Dynamic Index)
---------------------------------------------
Volatility Band VB(34), color: Blue, buffer: UpZone, DnZone
Relative Strength Index RSI(13)
RSI PRICE LINE (2), color: Green, buffer: mab
RSI TRADE SIGNAL LINE (7), color: Red, buffer: mbb
MARKET BASE LINE MID VB(34), color: Orange, buffer: mid
Indicator SignalLevels:
-------------------------------
RSI_OversoldLevel : 22 (normally: 32)
RSI_OverboughtLevel : 78 (normally: 68)
Alert Conditions:
-----------------------
Strong Buy : yellow
Medium Buy : aqua
Weak Buy : blue
Strong Sell : fuchsia
Medium Sell : purple
Weak Sell : black
Hints on How to use:
----------------------------
- When a Medium or Strong alert is generated and MACD histogram colour matches the direction
of the alert (optional auto filter), then place trade in direction of alert candle and MACD.
- I use the multi-Hull MA's for overall trend direction confirmation.
- Best positions normally occur near the MACD(5,15,1) Histogram crossing the zero line.
- The optional coloured Dots along the bottom of the indicator represent the first alert
of this type that was generated in this sequence.
- It is advisable to trade in the direction of the main trend as indicated the HULL MA red cloud:
if red cloud underneath PAC then BULLISH trend, if red cloud above PAC then BEARISH trend.
- Selecting the HeiKin Ashi candles does affect the MACD and MA caculations, so if you select
normal candles the result chart will change. You can still Optionally select to use Heikin Ashi
for calculations.
- When using the Heikin Ashi candles, a good buy entry is indicated by long top wick and no bottom wick
for bull (green) candles and good sell entry is indicated by long bottom wick and no top wick for
bear (red) candles.
- When the MACD histogram is flat and close to zero line,
this indicates a ranging market, do NOT trade when this occurs.
- When the PAC channel on the main chart is spread apart widely, this is an indication
of extreme volatility and choppy chart, do NOT try to trade during these periods.
A choppy chart is also indicated by Heikin Ashi candles with long wicks on both sides
of the candles.
- You can specify what strength level Alerts are generated (default 2):
Level (1) means only generate Strong Alerts only.
Level (2) means generate Strong and Medium Alerts.
Level (3) means generate Strong, Medium and Weak Alerts.