Ex's DMI DivergenceThis indicator I am posting open for everyone to see and use.
This is a modified DMI indicator, It has a DMI+ and DMI- and a 3rd line that is the average divergance/convergance of the two.
This indicator is used to recognize periods of consolidation, directional strength and retracements/reversal
There are some key things to watch for:
-When the Div/Conv line is yellow it means that the DMI+/- average distance is moving closer together(converging)
-When the Div/Conv line is aqua it means that the DMI+/- average distance is moving further apart(diverging)
-One DMI must be below the top threshold and other DMI must be below at least the Top threshold(or bottom if you prefer) to be considered valid
Signs of condolidation/possible reversal/weak strength:
-When the DMI+/- are crossing at any location stay mindful of entries
-If both DMI's are above the threshold there is no clear direction
-When the DMI Div/Conv is yellow it means trend is slowing down and aqua means it is picking up
Directional Movement Index (DMI)
ADX DINGUE v5This is the updated script for PinceScrip V5
3x DMI and ADX indicator into 1.
You can turn on and off all 3x DMI and all 3x ADX and or customize their settings manually.
I also added my 3 line system, which is a homemade calculation from the DMI lines (P+N), and instead turns them into a single line.
There are also several options for histogram, ADX line, crosses, colors, overextended ...
---------------------
In closing, no indicator can give perfect signals, you need to use them in conjunction with other information to make better decisions.
I hope you like my indicators and that they help your trading.
If you have any questions please ask.
Thank you.
DMI (Multi timeframe) DI Strategy [KL]Directional Movement Index Strategy
Entry conditions:
- (a) when DI+ > DI- on timeframe #1, and
- (b) Confirmation: when DI+ > DI- on timeframe #2
In the shown example, timeframe1 was same as the chart (1H) and timeframe2 was 1D.
Stop Loss: ATR based trailing stop
About DMI
Can refer to Investopedia for general understanding.
Applications of DMI in this strategy:
- Assumes uptrend when DI+ is above DI- (when green DI+ lines above red DI-), vice versa for downtrend. This is checked in two different timeframes that can be set by user in settings.
- DX is ignored, it doesn't give a direction of the trend. But if DX was applied, it would be a good indicator for quantifying the strength of uptrend/downtrend. This measurement would typically be read along a threshold (i.e. if below 20, then market is likely consolidating). All of these have been commented out (ignored by pinescript's interpreter via //) in the codes, as said; we are not using DX for sake of simplicity.
Visualizations
To make the chart look cleaner, DMI plots have been simplified to just down/up arrows placed at bottom of the chart.
Referring to the example chart:
- Green arrows : when DI+ > DI- for both timeframes, implies uptrend
- Red arrows: other way around (DI+ < DI-), implies downtrend
ADX Heatmap & Di's + Fib Referencial by [JohnnySnow]For quicker and easier interpretation, ADX line is displayed in a heatmap style. The more absolute difference between both DIs, the more intense the color.
Because some people use 20 ADX reference and others use 25 ADX reference to confirm the trend, I just add both as reference lines in a 'golden box'
Additionally, reference lines were added with default values set to Fib levels
Imbalance, ADR Daily Target & ADR > 3X1 x ADR Movement Calculated on the Asian Session - Times can be altered to suit your parameters
Daily Target is set High from low of Asian Range and Low from High of Asian Range
0-3X ADR Calculated and Displayed from a point you select for the following days targets - can be set Bearish or Bullish and ADR parameters can be altered
Imbalance Finder - Can be switched on or off to show imbalance on current time frame - default is off
ADX + DMI with Fill and CrossoverBetter visuals for the ADX/DMI technical indicator.
I filled the DI+ and DI- with color to easily track the trend. Also, I added shapes (+) / (x) once the DI+ and DI- crossover each other.
You can also set two horizontal lines so you can easily track where the ADX value is at.
TASC 2021.12 Directional Movement w/Hann█ OVERVIEW
Presented here is code for the "Directional Movement w/Hann" indicator originally conceived by John Ehlers. The code is also published in the December 2021 issue of Trader's Tips by Technical Analysis of Stocks & Commodities (TASC) magazine.
Ehlers continues here his exploration of the application of Hann windowing to conventional trading indicators.
█ FEATURES
The rolling length can be modified in the script's inputs, as well as the width of the line.
█ NOTES
Calculations
The calculation starts with the classic definition of PlusDM and MinusDM. These directional movements are summed in an exponential moving average (EMA). Then, this EMA is further smoothed in a finite impulse response (FIR) filter using Hann window coefficients over the calculation period.
Background
The DMI and ADX indicators were designed by J. Welles Wilder and presented in his "New Concepts in Technical Trading Systems" book published in 1978.
Join TradingView!
DMI & ST DEV zone intersection [LM]Hello Traders,
This indicator uses two indicators st dev extremes and DMI extremes and visualize intersection of both indicators extreme zones using crosses. It means where cross is rendered intersection of extremes has occurred.
The standard deviation uses the same calculation as my Standard deviation zones Support & Resistance indicator, DMI indicator measures both the strength and direction of a price movement. I am using both indicators to find the intersection of extreme zones between them.
ST DEV settings:
source
tops setting
bottom setting
DMI settings:
length settings
extreme zone setting
Enjoy,
Lukas
BTC Dominance TrendThis simple script applies the DMI/ADX (trend) indicator to the Bitcoin Dominance Index (BTC.D) to check whether BTC is increasing its dominance or not on that day. It is meant to be applied to altcoins on medium intervals. I put it together to test the following hypothesis: On days when BTC dominance is on the rise, altcoins are harder to take off, because Bitcoin is draining the lifeblood out of them, so caution is needed when opening trades.
Olive background means BTC dominance is rising on that day, purple that it is decreasing. White background means it is not moving significantly in any direction.
You can change the resolution (i.e. apply the DMI/ADX to a different BTC.D interval), just make sure to lower the threshold as well. I hope you find a good use for it! Beware if you try to incorporate it in your strategy, it uses higher timeframe data and hence is prone to repainting.
MACD PlusMoving Average Convergence Divergence – MACD
The MACD is an extremely popular indicator used in technical analysis. It can be used to identify aspects of a security's overall trend. Most notably these aspects are momentum, as well as trend direction and duration. What makes the MACD so informative is that it is actually the combination of two different types of indicators. First, the MACD employs two Moving Averages of varying lengths (which are lagging indicators) to identify trend direction and duration. Then, it takes the difference in values between those two Moving Averages (MACD Line) and an EMA of those Moving Averages (Signal Line) and plots that difference between the two lines as a histogram which oscillates above and below a center Zero Line. The histogram is used as a good indication of a security's momentum.
Added Color Plots to Settings Pane.
Switched MTF Logic to turn ON/OFF automatically w/ TradingView's Built in Feature.
Added Ability to Turn ON/OFF Show MacD & Signal Line.
Added Ability to Turn ON/OFF Show Histogram.
Added Ability to Change MACD Line Colors Based on Trend.
Added Ability to Highlight Price Bars Based on Trend.
Added Alerts to Settings Pane.
Customized Alerts to Show Symbol, TimeFrame, Closing Price, MACD Crosses Up & MACD Crosses Down Signals in Alert.
Alerts are Pre-Set to only Alert on Bar Close.
Added ability to show Dots when MACD Crosses.
Added Ability to Change Plot Widths in Settings Pane.
Added in Alert Feature where Cross Up if above 0 or cross down if below 0 (OFF By Default).
Squeeze Pro
Traditionally, John Carter's version uses 20 period SMAs as the basis lines on both the BB and the KC.
In this version, I've given the freedom to change this and try out different types of moving averages.
The original squeeze indicator had only one Squeeze setting, though this new one has three.
The gray dot Squeeze, call it a "low squeeze" or an "early squeeze" - this is the easiest Squeeze to form based on its settings.
The orange dot Squeeze is the original from the first Squeeze indicator.
And finally, the yellow dot squeeze, call it a "high squeeze" or "power squeeze" - is the most difficult to form and suggests price is under extreme levels of compression.
Colored Directional Movement Index (CDMI) , a custom interpretation of J. Welles Wilder’s Directional Movement Index (DMI), where :
DMI is a collection of three separate indicators ( ADX , +DI , -DI ) combined into one and measures the trend’s strength as well as its direction
CDMI is a custom interpretation of DMI which presents ( ADX , +DI , -DI ) with a color scale - representing the trend’s strength, color density - representing momentum/slope of the trend’s strength, and triangle up/down shapes - representing the trend’s direction. CDMI provides all the information in a single line with colored triangle shapes plotted on the bottom. DMI can provide quality information and even trading signals but it is not an easy indicator to master, whereus CDMI simplifies its usage. The CDMI adds additional insight of verifying/confirming the trend as well as its strength
Label :
Displaying the trend strength and direction
Displaying adx and di+/di- values
Displaying adx's momentum (growing or falling)
Where tooltip label describes "howto read colored dmi line"
Ability to display historical values of DMI readings displayed in the label.
Added "Expert Trend Locator - XTL"
The XTL was developed by Tom Joseph (in his book Applying Technical Analysis ) to identify major trends, similar to Elliott Wave 3 type swings.
Blue bars are bullish and indicate a potential upwards impulse.
Red bars are bearish and indicate a potential downwards impulse.
White bars indicate no trend is detected at the moment.
Added "Williams Vix Fix" signal. The Vix is one of the most reliable indicators in history for finding market bottoms. The Williams Vix Fix is simply a code from Larry Williams creating almost identical results for creating the same ability the Vix has to all assets.
The VIX has always been much better at signaling bottoms than tops. Simple reason is when market falls retail traders panic and increase volatility , and professionals come in and capitalize on the situation. At market tops there is no one panicking... just liquidity drying up.
The FE green triangles are "Filtered Entries"
The AE green triangles are "Aggressive Filtered Entries"
DMI Trade Zone [Alorse]Through the DMI Trade Zone you can find safe areas to trade in the Spot market.
The logic behind the indicator is:
- If the Positive Directional Movement (+DI) is greater than the Negative Directional Movement (-DI) then the Average Directional Movement Index (ADX) will be green with an opaque white background.
- If the Positive Directional Movement (+DI) is less than the Negative Directional Movement (-DI) then the Average Directional Movement Index (ADX) will be red.
DMI - VisualBasically, when the background is:
White = no defined direction
Light blue = up.
Dark blue = well defined up
Light red = down
Dark red = well defined down
Blue/red centered circle = change of direction
Red circle on top = possible short entry
Blue circle at the bottom = possible long entry
//Português
Basicamente, quando o fundo é:
Branco = sem direção definida
Azul claro = alta
Azul escuro = alta bem definida
Vermelho claro = baixa
Vermelho escuro = baixa bem definida
Círculo azul/vermelho centrado = mudança da direção
Círculo vermelho no topo = possível entrada de short
Círculo azul na parte inferior = possível entrada de long
DMI Swings (by Coinrule)The Directional Movement Index is a handy indicator that helps catch the direction in which the price of an asset is moving. It compares the prior highs and lows to draw three lines:
Positive directional line (+DI)
Negative directional line (-DI)
Average direction index (ADX)
DMI is simple to interpret. When +DI > - DI, it means the price is trending up. On the other hand, when -DI > +DI, the trend is weak or moving on the downside.
The ADX does not give an indication about the direction but about the strength of the trend.
Typically values of ADX above 25 mean that the trend is steeply moving up or down, based on the -DI and +D positioning. This script aims to capture swings in the DMI, and thus, in the trend of the asset, using a contrarian approach.
ENTRY
-DI is greater than +DI
ADX is greater than 45
EXIT
+DI is greater than -DI
ADX is greater than 45
Trading on high values of ADX, the strategy tries to spot extremely oversold and overbought conditions. Values of ADX above 45 may suggest that the trend has overextended and is may be about to reverse.
Our backtests suggest that this script performs well for very short-term scalping strategies on low time frames, such as the 1-minute.
The script considers a 0.1% trading fee to make results more realistic to those you can expect from live market conditions. So realistically, live results should be similar to backtested results.
You can plug this script directly into your crypto exchange using TradingView Signals on Coinrule.
Trade Safely!
Buy/Sell RatingIdentifies prices above and below input percentile thresholds over the input length of time. Use to identify buy/sell opportunities relative to recent pricing. Also provides percent of price distance from moving average over the same length.
ADX / RSI Strategy by Trade Rush (created by SirPoggy) This is one of many new strategies coming soon which were seen on Trade Rush
This one is the ADX / RSI Strategy seen here:
https:www.youtube.com/watch?v=uSkGE0ujyn4
While the strategy has been modified slightly to use the DMI instead of the ADX, the core of the strategy is essentially the same
Long signals are generated when the RSI is above 70, close is above the 200EMA, and the ADX is above 25 (added is the plus DMI over 25 and minus DMI below 20)
Stop loss is placed below /above the 21 EMA, however, there is a deviation required to ensure price is not too close to where a stop loss would be placed.
Short signals are generated when the RSI is below 30, close is below the 200EMA, and the ADX is above 25 (added is the minus DMI over 25 and plus DMI below 20)
I do not recommend using this strategy but I have provided this code for educational purposes.
Thanks!
Let me know which strategy you'd like coded next in the comments below.
Trader Pressure Index (TPX)This is my take on the script by RedK
I kept the algorithm exactly the same, but changed the layout and the default look back period. Most important is that the resulting line, the TPX, is now a histogram with green and red staves.
To put the histogram on a logical place in the graph, I changed the way the control/dominance level is implemented, it now lowers or highers the whole graph, this way the zero level becomes the ‘no interest’ level.
I added two horizontal lines at a distance of 40 because I feel that this is sort of an oversold / overbought indication. In practice not very convincing, but provides a visual comparison.
In this layout I explain that grass is growing on bull hills peaking up behind the foreground and blood is dripping from the bear hills.
Enjoy.
[kai]ADXIt is an indicator that makes it easy to understand the change of ADX by adding a moving average to the famous indicator ADX.
Since ADX and DI have a part where the calculation formula of DI + and DI- is fixed to one bar, there was a problem that it does not make much sense to increase the length.
The biggest feature of this indicator is that it allows you to calculate multiple bars by increasing the multipler option.
For example, by setting multipler = 4 in the 1-hour time frame, it is possible to resemble the calculation result of the 4-hour bar in a multi-time frame.
How to use this Inge is the same as how to use ADX and DI
When ADX (orange) GX (blue circle), take a position in the direction of DI (green zone, red zone),
I think the payment is good when ADX (blue) is DX (orange circle)
when DI +(green), DI-(red) is 35 or more, contrarian is dangerous.
有名なインジケーターのADXに移動平均を付けてADXの変化をわかりやすくしたインジケーターです
ADXとDIはDI+,DI-の計算式がバー一本固定の部分があるので、lengthを増やしてもあまり意味がない問題がありました
このインジではmultiplerオプションを増やすことによって、複数のバーを計算できるようにしたのが最大の特徴になります
例えば1時間足でmultipler=4にすることでかなりマルチタイムフレームの4時間足の計算結果に似せることができます
このインジの使い方は、ADX、DIの使い方と同じです
ADX(オレンジ)がGX(青丸)した時にDI(緑塗り、赤塗り)の方向にポジションを取って、
ADX(青)がDX(オレンジ丸)した時に、決済がよいと思います
DI+(緑),DI-(赤)が35以上の時に逆張りは危険です
(JS) Triple StochasticSo I ended up adding a ton of stuff to my prior Double Stochastic script which you can see here .
The concept of the Double was to smooth out the existing Stochastic by applying a Stochastic to the existing Stochastic (hence the Double). My concept for the Triple Stochastic is much different. It combines a regular stochastic, stochastic RSI, and the double stochastic to get a smoothed output based on all 3.
Also - since I love being able to see a Squeeze (see my Squeeze Pro indicators - Squeeze Pro 2 & Squeeze Pro Overlays ) I added the Squeeze to the Stochastic (the dots). If you're unfamiliar with how a Squeeze works, or what it is, check out my links for explanation. A quick explanation however is that the Squeeze is an indicator that was invented by John Carter that detects price compression before a big move out of a range. This is done by using Bollinger Bands and Keltner Channels, the BB shrink inside the KC. The color of the dots represent the depth of the BB in the KC, white (or black) being the lightest squeeze, red being the standard squeeze, and yellow being the strongest squeeze. Now on to the indicator:
The first thing you'll notice is the options available for the type of Stochastic you'd like to use:
Standard : This is a regular Stochastic
Stochastic RSI : This is the standard Stochastic RSI
Double : This is the Stochastic on top of a Stochastic from the prior version
Triple : This is simply an average of all 3 of the above combined together
(Top indicator shows the Triple Stochastic)
The options "K", "D", and "Smooth" are the settings from a regular Stochastic used to set up the type of Stochastic you choose to use.
Now let's say you're not sure how one type performs compared to another, or you like the quickest momentum change but also like to see the smoothest trend, or you want to use the same types of Stochastic and watch for them to cross like moving averages - for these reasons I added the ability to add a second Stochastic for comparison.
(2nd indicator shows a fast and slow Triple Stochastic together)
Quite obviously, the "K 2", "D 2", and "Smooth 2" are what is used in order to set the parameters for the second Stochastic.
Now another thing I added was the option to replace the regular Stochastic and instead look at the distance between the K and D. By turning off "Use K% and D%" you get to see this in action. To put it simply, a cross above zero would indicate a positive Stochastic crossover, and a cross below zero would represent the opposite. There's also an option titled "SMA Length using Difference" which, to smooth this out a bit, allows you to apply a moving average to the distance. By setting it at 1 you'd see the actual distance between K and D.
(3rd indicator shows the K and D distance used as a plot)
Another thing I wanted to do was add a different type of background that wasn't based on the indicator itself. I decided to use ADX & DMI which is a great way to determine the trend. When you select "ADX/DMI BG" the BG colors will change from being based on the indicator to being based on ADX and DMI.
(The 3rd indicator also shows the ADX/DMI BG being used).
And now finally the last feature I decided to add takes us back to the Squeeze. Essentially it is just the Stochastic shown through the lens of Squeeze momentum, as I ended up plugging the Stochastic output into the Squeeze momentum formula to create an oscillator. By selecting "Use Oscillator" you will see this in action as well.
(Bottom indicator shows the oscillator addition)
Directional Movement Index color alertThis script is changed from the classic DMI.
I add 4 colors and setup two alerts as well.
- +DI cross up -DI is a long signal
- +DI cross down -DI is a short signal
- ADX keeps increasing means strong trend
- ADX keeps decreasing means swing
Smoothed Directional Movement IndexThis indicator is a variation of the default DMI indicator, the main difference being that the signals are smoothed by SMAs.
It also has additional bullish (green) and bearish (red) background coloring which would be noisy on a standard DMI indicator.
If both lines converge it is bullish, otherwise bearish.
Increase / decrease the threshold should you want more conservative / optimistic background coloring.
Directional Movement Index and ADXDMI (ADX) consists of three indicators that measure a trend’s strength and direction. Three lines compose the Direction Movement Index (DMI): ADX (white/gray line), DI+ (green line), and DI- (orange line). The Average Directional Index (ADX) line shows the strength of the trend. The higher the ADX value, the stronger the trend. The ADX line is white when it has a positive slope, otherwise it is gray.
The Plus Direction Indicator (DI+) and Minus Direction Indicator (DI-) show the current price direction. When the DI+ is above DI-, the current price momentum is up. When the DI- is above DI+, the current price momentum is down.
Trend detection: When the background has a bluish color there is an upward trend, and when the background has a reddish color there is a downward trend.
Includes an information panel that shows the current value and trend of some well-known indicators.
DMI with Oversold/Overbought markingModification of original DMI indicator, simply marking background in case of finding Overbought or Oversold levels - this happens when ADX is above both DI+ and DI- values.
CHOP Zone Entry Strategy + DMI/PSAR ExitThis is a Strategy with associated visual indicators and Long/Short and Reverse/Close Position Alerts for the Choppiness Index (CHOP) . It is used to determine if the market is choppy (trading sideways) or not choppy (trading within a trend in either direction). CHOP is not directional, so a DMI script was ported into this strategy to allow for trend confirmation and direction determination; it consists of an Average Directional Index (ADX) , Plus Directional Indicator (+DI) and Minus Directional Indicator (-DI) . In addition, a Parabolic SAR is also included to act as a trailing stop during any strong trends.
Development Notes
---------------------------
This indicator, and most of the descriptions below, were derived largely from the TradingView reference manual. Feedback and suggestions for improvement are more than welcome, as well are recommended Input settings and best practices for use.
www.tradingview.com
www.tradingview.com
www.tradingview.com
Recommend using the below DMI and PSAR indicators in conjunction with this script to fully visualize and understand how entry and exit conditions are chosen. Variable inputs should correlate between the scripts for uniformity and visual compatibility.
THANKS to LazyBear and his Momentum Squeeze script for helping me quickly develop a momentum state model for coloring the Chop line by trend.
Strategy Description
---------------------------
CHOP produces values that determine whether the market is choppy or trending . The closer the value is to 100 , the higher the choppiness levels , while the closer it is to 0 , the stronger the market is trending . Territories for both levels, and their associated upper and lower thresholds, are popularly defined using the Fibonacci Retracements, 61.8 and 38.2.
Basic Use
---------------------------
CHOP is often used to confirm the market condition to help you stay out of sideways markets and only enter when there is movement or imminent explosions. When readings are above the upper threshold, continued sideways movement may be expected, while readings below the lower threshold are typically indicative of a continuing trend. It is also used to anticipate upcoming trendiness changes, with the general belief that extended periods of consolidation (sideways movement) are followed by extended periods of strong, trending, directional movement, and vice versa.
One limitation in this index is that you must be cautious in deciding whether the range or trend will likely continue, or if it will reverse.
Confidence in price action and trend is higher when two or more indicators are in agreement -- while this strategy combines CHOP with both DMI and PSAR, we would still recommend pairing with other indicators to determine entry or exit trade opportunities.
Recommend also choosing 'Once Per Bar Close' when creating alerts.
Inputs
---------------------------
Strategy Direction - an option to only trade Short, Long, Both, or only in the direction of the Trend (Follow Trend is the Default).
Sensitivity - an incremental variable to test whether the past n candles are in the same trend state before triggering a delayed long or short alert (1 is the Default). Can help filter out noise and reduces active alerts.
Show Chop Index - two visual styles are provided for user preference, a visible Chop line with a background overlay, or a compact column and label only view.
Chop Lookback Period - the time period to be used in calculating CHOP (14 is the Default).
Chop Offset - changing this number will move the CHOP either forwards or backwards relative to the current market (0 is the Default).
Smooth Chop Line and Length - if enabled, the entered time period will be used in calculating a smooth average of the index (Enabled and 4 are the Defaults).
Color Line to Trend Direction - toggles whether the index line is colored to visually depict the current trend direction (Enabled is the Default).
Color Background - toggles the visibility of a background color based on the index state (Enabled is the Default).
Enable DMI Option - if enabled, then entry will be confirmed by and dependent on the ADX Key Level, with any close or reversal confirmed by both ADX and +/-DI to determine whether there is a strong trend present or not (Enabled is the Default).
ADX Smoothing - the time period to be used in calculating the ADX which has a smoothing component (14 is the Default).
DI Length - the time period to be used in calculating the DI (14 is the Default).
ADX Key Level - any trade with the ADX above the key level is a strong indicator that it is trending (23 to 25 is the suggested setting).
Enable PSAR Option - enables trailing stop loss orders (Enabled is the Default).
PSAR Start - the starting value for the Acceleration Force (0.015 is our chosen Default, 0.02 is more common).
PSAR Increment - the increment in which the Acceleration Force will move (0.001 is our chosen Default, 0.02 is more common).
PSAR Max Value - the maximum value of the Acceleration Factor (0.2 is the Default).
Color Candles Option - an option to transpose the CHOP condition levels to the main candle bars. Note that the outer red and green border will still be distinguished by whether each individual candle is bearish or bullish during the specified timeframe.
Note too that if both DMI and PSAR are deselected, then close determinations will default to a CHOP reversal strategy (e.g., close long when below 38.2 and close short when above 61.8). Though if either DMI or PSAR are enabled, then the CHOP reversal for close determination will automatically be disabled.
Indicator Visuals
---------------------------
For the candle colors, black indicates tight chop (45 to 55), yellow is loose chop (38.2 to 45 and 55 to 61.8), dark purple is trending down (< 38.2), and dark blue is trending up (> 61.8).
The background color has additional shades to differentiate a wider range of more levels…
• < 30 is dark purple
• 30 to 38.2 is purple
• 38.2 to 45 is light purple
• 45 to 55 is black
• 55 to 61.8 is light blue
• 61.8 to 70 is blue
• > 70 is dark blue
Long, Short, Close, and Reverse labels are plotted on the Chop line, which itself can be colored based on the trend. The chop line can also be hidden for a clean and compact, columnar view, which is my preferred option (see example image below).
Visual cues are intended to improve analysis and decrease interpretation time during trading, as well as to aid in understanding the purpose of this strategy and how its inclusion can benefit a comprehensive trading plan.
DMI and Trend Strength
---------------------------
To analyze trend strength, the focus should be on the ADX line and not the +DI or -DI lines. An ADX reading above 25 indicates a strong trend , while a reading below 20 indicates a weak or non-existent trend . A reading between those two values would be considered indeterminable. Though what is truly a strong trend or a weak trend depends on the financial instrument being examined; historical analysis can assist in determining appropriate values.
DMI exits trade when ADX is below the user selected key level (e.g., default is 25) and when the +/- DI lines cross (e.g., -DI > +DI exits long position and +DI > -DI exits short position).
PSAR and Trailing Stop
---------------------------
PSAR is a time and price based indicator that excels at measuring direction and duration, though not the actual strength of a trend, which is why we use this in conjunction with DMI. It is also included in this script as a trailing stop option to maximize gains during strong trends and to mitigate any false ADX strengthening signals.
This creates a parabola that is located below the candle during a Bullish trend and above during a Bearish trend. A buy or reversal is signaled when the price crosses above or below the Parabolic SAR.
Long/Short Entry
---------------------------
1. CHOP must be over 61.8 (long) or under 38.2 (short).
2. If DMI is enabled, then the ADX signal line must be above the user selected Key Level (default is 25).
3. If Sensitivity is selected, then that past candle must meet the criteria in step 1, as well as all the intermediate candles in between.
4. If "Follow Trend" is selected and PSAR is enabled, then a long position can only open when the momentum and PSAR are in an uptrend, or short when both are in a downtrend, to include all intermediate candles if the Sensitivity option is set on a past candle.
Close/Reverse
---------------------------
1. If DMI is enabled, then a close flag will be raised when the ADX signal drops below the Key Level (of 25), and -DI crosses over +DI (if long), or +DI crosses over -DI (if short).
2. If PSAR is enabled, then a close flag will be raised when the current trend state is opposite the last state.
3. If both DMI and PSAR are disabled, then a close flag will be raised if the Chop line drops under 38.2 (if long) or goes over 61.8 (if short).
4. If a Long or Short Entry is triggered on the same candle as any of the above close flags, then the position will be reversed, else the position will be closed.
Strategy Alerts
---------------------------
1. Long Entry
2. Short Entry
3. Reverse
4. Close
The provided backtest result is based on a position sizing of 10% equity with 100k initial capital. When testing SPX, disabling the DMI performed the best, but EURUSD performed poorly without it enabled, and TSLA had a small reduction in net profit. Timeframe likewise differed between commodities with TSLA performing best at 30M, SPX at 15M, and EURUSD at 4H. I do not plan on using this as a standalone strategy, but I also was expecting better results with the inclusion of EMI and PSAR to compliment the CHOP. Key elements of this script will likely be included in future, more holistic strategies.
Disclaimer
---------------------------
Past performance may not be indicative of future results. Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting. This post and the script are not intended to provide any financial advice. Trade at your own risk.
No known repainting, though there may be if an offset is introduced in the Inputs. I did my best not to code any other variables that repaint, but cannot fully attest to this fact.