Scalper's toolkit - ATR WidgetWidget specifically designed for scalping. Many settings to fit the instrument and view preferences to make it fit into your chart window how you like, even on mobile.
** I have 5 other features to add into this in the very near future, as I use this as my primary tool for Risk reward. This script will be updated in the near future as more features are coded into it. See bottom for notes on plans
Features:
Displays a quick view of the ATR value on the chart, in decimal PIPs or directly in Points - a key value for scalping using the DOM for point value settings and one click trading on fast time frames.
Automatic calculation of stop and target distance for a predetermined Risk Reward Ratio (Set with the settings panel), and then also displayed in PIPs or Points for easy use in quick trading.
Works on most all instruments/pairs/cryptos with multiple precision levels for correct values to be shown in the widget.
Fully customizable -
ATR period Base setting, just like a normal ATR indicator
Display in : PIPs or Points
ATR based stop distance, using a multiplier. 2 is the most common multiplier used, and the default setting.
Risk Reward Calculation using the Stop Loss value.
-Quickly helps with proper target and stop sizing for the volatility in the price on the current trade entry point.
-Set to any ratio you wish, from 1:0.1 all the way to 1:100 or more, unlimited R ratio settings to fit your strategy and risk tolerances.
Position anywhere on the chart window with 9 preset locations available (Pine script limitation)
Show as a column layout or a row layout
Customize the Size, with 5 preset widget sizes, from tiny to huge (Pine script limitation)
-Mobile Friendly - Tiny or Small may be too small on PC, but can be used for Mobile so the widget does not become too large over the chart.
Custom text, background, and boarder colors
Custom Boarder Size - 0 size is no boarder
Set up:
-Open the settings panel.
First section is the basic settings for the ATR - the length (Default is 14) and to use a PIP value display, or Point value display.
Here you also see a "Precision" Setting. **Because each instrument returns different precision ATR values, it is difficult to determine with code what those values will be ahead of time to do the math in the background. Even some 2 decimal instruments return 5 decimal ATR values, so this setting filters that** Just use the dropdown and choose how many decimal places the instrument has from 2 - 5 decimals
The second section is for risk and reward calculations, and can be disabled if you do not want to see these values.
The first value is the "ATR Multiplier" Typically, a 2x multiplier is used on the ATR to determine how far away to place your stop loss from the entry, placing it out of harm's way from normal market activity.
The second value is the Reward target distance, based from the stop loss size. This quickly calculates your target to match your intended reward ratio, saving some manual work to calculate this by hand every trade.
** Note: because of the math used in the code, you may see odd values on some instruments, like indexes. If you have the precision correct, try changing the "Show in Pips" to "Show in Points", as this may solve the issue.
The last two sections are purely for how the widget looks and how/where it shows on the screen. These can be set however you like. To have no boarder, just set the "Frame size" value to 0.
Additional Updates planned:
Pip value calculation (2 feature uses)
-This will serve 2 purposes. The widget will calculate the value of the trade based on the lot size. It will also have a risk limit, so if the ATR get's too high for the current risk settings, It will show red to warn you of a high risk situation before you trade.
Example, you have a set limit of 3 dollars per trade using .02 lot sizing. If the ATR get's too high, The Stop value will be more risk than you would like to use at that trade sizing. Reduce the trade size, or wait for ATR to come lower.
Purpose 2: lot size calculation, so if you wanted to maximize the use of risk available. If you wanted to risk 600 for example, it would use the ATR you have set for the risk, and determine the proper lot size for the amount of volatility in the market. This way, you Risk Exactly, or as close as possible to 600 for the the current trade conditions.
Extra use for this value: Show the Current trade amounts at risk and for gain in money values on the side of the pip/point value. Know what you're risking and also trading for in monetary value.
ATR candle Comparison- Early momentum Detection (2 feature uses)
Will show an additional section on the bottom of the widget to show how each candle compares to the one before, up to the last 5, and show if ATR went down, up, or stayed the same over the last 5 candles.
Show an additional symbol to indicate the current candle status in comparison to the close of the last candle. Real time of if the ATR is getting larger, smaller, or staying the same.
Rata-Rata Rentang Sebenarnya / Average True Range (ATR)
Grid Range Volatility BasedThis TradingView Pine script implements a grid range volatility based indicator that displays dynamic horizontal lines on the chart. The lines are calculated based on the average true range (ATR) of the security being plotted, and the range can be adjusted using an input parameter. The distance between the top and bottom lines is displayed as a percentage in a dynamic label that updates with each new bar.
The script allows the user to choose whether to use red or black lines, and also provides options to set the number of days for range calculations, and the calculation type (either ATR(1) or ATR(x)). The script is designed to work with stocks, forex, and other securities that have price data.
To use this script, simply attach it to a chart and adjust the input parameters to suit your analysis needs. The dynamic lines and percentage label will be displayed on the chart, providing a visual representation of the range volatility of the security being plotted. The values of the highest and lowest lines can also be displayed as labels on the price axis, providing additional context for the range volatility.
Volatility Spike EstimatorPlots the Average True Range (ATR), its historical mean, the upper threshold for a volatility spike, and uses background color to show the likelihood of a volatility spike based on the current ATR value.
Green background indicates an increased likelihood of a volatility spike, while red background means a spike might have already occurred or be in progress.
Update: In this version, we added a short-term ATR calculation with an adjustable input parameter, shortTermATRLength. The likelihood of a volatility spike is now estimated based on the short-term ATR instead of the original ATR. This change makes the indicator more sensitive to recent market conditions and can help detect potential volatility spikes more quickly.
ATR-Stepped, Another New Adaptive Moving Average [Loxx]ATR-Filtered, Another New Adaptive Moving Average is a modification of @cheatcountry's "Another New Adaptive Moving Average " shown below
I've added AT- stepped filtering. This is a standard ATR filter that works by requiring movement by XX multiple of ATR before registering a trend flip. I've also included Loxx's Expanded Source Types. You can read about those here:
From @cheatcountry on A New Adaptive Moving Average
The New Adaptive Moving Average was created by Scott Cong (Stocks and Commodities Mar 2023) and this is a companion indicator to my previous script
This indicator still works off of the same concept as before with effort vs results but this indicator takes a slightly different approach and instead defines results as the absolute difference between the closing price and a closing price x bars ago. As you can see in my chart example, this indicator works great to stay with the current trend and provides either a stop loss or take profit target depending on which direction you are going in. As always, I use darker colors to show stronger signals and lighter colors to show normal signals. Buy when the line turns green and sell when it turns red.
Included
Alerts
Signals
Loxx's Expanded Source Types
Volatility Percentile (H-LINES)A simple script that adjusts the Volatility Percentile Indicator visibly in order to better accommodate entries/exits and certain trading setups/strategies.
--------------------------------------------------------------------------------------------------------------------------------------------------------
TL;DR - Remember after a full reset, we are looking for initial crosses UP on the UpperSwingline and crosses DOWN on the LowerSwingline for primary and secondary signal derivation.
Vice versa also works great but the prior method mentioned is a little more consistent in my experience, but you should mess around and optimise this for your own setups and strategies anyway.
--------------------------------------------------------------------------------------------------------------------------------------------------------
ORIGINAL SCRIPT HERE:
^Click image for a redirect to that script.
ALL CREDIT GOES TO: www.tradingview.com
He wrote everything so give credit where it's due, good bit of kit this here script is.
--------------------------------------------------------------------------------------------------------------------------------------------------------
HOW I USE MY VISUALLY ALTERED VERSION OF THIS SCRIPT
First of all, the alterations I've made seem only to be consistently viable with renko charts though if you can get the sought after results using candles or any other chart type then perfect, but be wary. All my back-testing done only with LinReg, HMA and SWMA - ATR type settings exclusively on renko charts. The changes I've made to the original script essentially just turns it visibly into an oscillator and uses a couple horizontal lines to generate signals, very simple - absolutely nothing has changed in the actual code of calculating this indicator.
What I believe my adjustments have achieved is quite simple. A full reset/oscillation on the indicator tries to map the strongest parts of a move or at least the part of the move where volume and the rate of transactions is at its peak to even facilitate said move. *take this statement with a pinch of salt though I do believe it's interacting with accumulation/distribution patterns, which is expected of volatility*
For ease of communication let's refer to the area between the the first UpperSwingline cross to the subsequent LowerSwingline cross, as the primary move. Then afterwards when it crosses the UpperSwingline again to make the full reset, the area in between those two points referred to as the secondary move.
Though more interestingly/practically the indicator ends up giving you two signals. In order for this to work we have to first decide that a spike up in volatility which crosses the UpperSwingline implies a significant level of interest at that price level. Usually that means a reversal is brewing, if price has already moved, trended and is approaching a certain area of value; which causes a spike of new positions to be taken, then you know that this is a level where contrarians are looking to enter. Now here's the tricky part, when volatility crosses the LowerSwingline price action becomes a little more open for interpretation, the way I personally like to look at this secondary signal is the potential for an exhaustion period to prolong itself a little longer. I know that's not the perfect analysis for what's going on, a more in-depth look into what's going on would best be described using Elliott Wave Theory, if a cross on the UpperSwingline near a significant area of value gives us a reversal trade lets just assume for the sake of argument that a new Elliott Wave can begin forming here. Making the move from that initial UpperSwngline cross to the cross on the LowerSwingline, the area that encompasses those two points: the impulse wave. After this point my analogy kind of falls apart and sadly my knowledge just isn't what it needs to be in order for me to properly analyse what's going on here but I must digress. Price after crossing the LowerSwingline up until the point where it makes a full reset by crossing the UpperSwingline again, within this area price seems to do either one of two things:
Situation 1 - Most likely occurs after a major trend reversal from major support/resistance or area of value (price has trended to new territory, maybe spent time a little time consolidating but hasn't broken the key level, momentum shifts, price action breaks current structure and you get the signal that primary move is a reversal) = Exhaustion Period, price will continue in direction of primary move during the secondary move. This here is for our trend-followers, you wanna take a continuation trade? Just wait for the pullback/rally to hit a FiB retracement level and enter - or any other means to find a decent support/resistance to enter.
Situation 2 - Most likely occurs when market enters a range or consolidation (price was previously seen as being at either a discount or premium so Situation 1 could have already played out and now you're looking at a full reset after that, imagine this spot to be the centre line of a linear regression channel or bang in the middle of your range, could even occur if price breaks a key moving average and decides it ought to consolidate around it for a while. Basically at any point where a somewhat prolonged consolidation is expected and not a quick reversal) = Corrective Wave, price will move against the direction of primary move during the secondary move. Now you might be expecting me to say this ones for you reversal traders but not really, if this is occurring then there probably isn't a definitive direction the market has chosen so you can use this opportunity to take range trades in the direction or against the direction of whatever the current trend or latest trend was depending on whatever slight bias you may have. <--- Situation 2 is very useful for finding cleaner entries if you do have a trend bias, say price underwent Situation 1, is now at key moving average but your bias is that it will break and continue up, so you wait and allow the secondary move of Situation 2 to take your entry to a much better R:R before entering a position.
--------------------------------------------------------------------------------------------------------------------------------------------------------
Ladder ATRThis indicator shows the upwards (green) and downward (red) volatility of the market. It is a moving average of the true range values like the ATR indicator does but with a twist! For the upwards volatility, only the green candles are taken into account, and for the downwards only the red candles are.
To the best of my knowledge, this technique had been introduced by HeWhoMustNotBeNamed in his "Supertrend - Ladder ATR" publication where the different types of volatility helped to improve the "trend reversal" conditions compared to the "Supertrend" indicator.
However, the actual "Ladder ATR" values were hard to see. This indicator shows the actual upward and downward volatility making it easy to reason about long and short price moves and potential biases in each direction.
In layman's terms this indicator "Ladder ATR" is to the "Supertrend - Ladder ATR" what the "Average True Range" indicator is to the "Supertrend" indicator.
I11L - Better Buy Low Volatility or High Volatility?This Pine Script code defines a TradingView strategy called "I11L - Better Buy Low Volatility or High Volatility?". The strategy aims to study the difference between buying when an asset's volatility is low and when it is high. It allows the user to select whether to buy during low or high volatility periods by changing the input variable mode.
Here's a brief explanation of the System:
The strategy is initialized with relevant settings such as overlay, pyramiding, default quantity type, initial capital, and others.
The mode input allows the user to choose between "Buy low Volatility" and "Buy high Volatility" options.
volatilityTargetRatio is the user-defined threshold to be used for making buy decisions. A value of 1 equals the average ATR (Average True Range) for the security. A lower value indicates lower volatility.
atrLength is the number of periods to calculate the ATR.
sellAfterNBarsLength sets the number of bars to hold the position before selling it.
The script calculates the ATR using the ta.atr() function, and then divides it by the closing price to normalize the value. It also calculates the simple moving average (SMA) of the normalized ATR over a period of 5 times the ATR length, and then computes the ratio between the normalized ATR and its average.
The script keeps track of the number of holding bars using the variable holdingBarsCounter. When there are open trades, the holding bars counter is incremented.
The decision to buy is made based on the selected mode and whether the computed ratio is above or below the user-defined threshold.
When the holding bars counter exceeds the user-defined limit, the position is closed.
The script plots the computed ratio with different colors based on the buy and close conditions. The ratio is plotted in green when a buy signal is triggered, red when a close signal is triggered, and white in all other cases. The value of 1 (the reference for the average ATR) is also plotted on the chart in white color.
This strategy helps traders study the difference between buying during low and high volatility periods and compare the performance of these conditions. It can be useful for analyzing the effectiveness of volatility-based trading strategies, such as entering positions when the market is calm or during periods of strong price movement.
4C Options Expected Move (Weekly + 0DTE)This indicator plots the calculated Expected Move for BOTH Weekly and Zero Dated Expiration (0DTE) Daily options, for a quick visual reference.
Please Note: This indicator is different from our original "4C Expected Move (Weekly Options)" indicator, as it now packages the ability to ALSO plot 0DTE options expected moves along with Weekly expected moves. Many other newer features have also been implemented.
Background Information
The Expected Move (EM) is the amount that a stock is predicted to increase or decrease from its current price, based on the current level of options pricing and implied volatility.
This range can be viewed as possible support and resistance, or, once price gets outside of the range, institutional hedging actions can accelerate the move in that direction.
It can be useful to know what the weekly EM range is for a stock to understand the probabilities of the overall distance, direction and volatility for the week.
About the Indicator
This indicator plots the calculated Expected Move for BOTH Weekly and Zero Dated Expiration (0DTE) options, for a quick visual reference.
For the weekly EM, the range is based on the Weekly close of the prior week.
For the Daily EM based on 0DTE options, the range is based on the Daily close of the prior day.
The indicator will automatically start a new weekly EM plot at the beginning of the week, and a new daily EM at the beginning of each day.
The EM values must be updated weekly and/or daily.
Features
Plots the EM for the week
Plots the EM for the day, for symbols that offer daily expiration options
Plots the 2 Standard Deviation EM for both the weekly and daily EM
Labels with calculated values are plotted near the levels for quick visual aid
Settings
Can toggle weekly EM on/off
Can toggle Daily EM on/off
Can toggle 2 Standard Deviation lines on/off
Can toggle labels for all EM on/off
Robust line settings
Can adjust label location left/right based on personal preference
Can enter symbol into settings as a reference
Handy instructions in the settings
How To Set Up The Indicator
To use this indicator you must have access to a broker with options data (not available on Tradingview).
Usually, you can look at the stock's option chain to find the weekly expected move.
You will have to do your own research to find where this information is displayed depending on your broker. You may also need to find the information elsewhere if your broker does not have this information.
You can also do your calculation of the EM using the following formula (please do your own research):
Expected Move = Option Price x Implied Volatility x Square Root of Time
See screenshot example below
This is the Thinkorswim platform's option chain, and the Implied Volatility % and the calculated EM are on the right side of the option chain.
The Expected Move is circled in blue. Use the +- number in parentheses, NOT the % value.
For the weekly EM, input the number that corresponds to the weekly option into the indicator. This must be done on a weekly basis, and It is typically best to use the EM for the next week expiration that is generated AFTER the Friday close and/or before the Monday open of the upcoming week.
For the daily EM, input the number that corresponds to the daily 0DTE option into the indicator. This must be done on a daily basis, and it is typically best to use the EM value for the 0DTE option that is generated the night before (after market close), or before the market opens for that 0DTE. .
TheATR™: Volatility Extremes (VolEx)Volatility is a crucial aspect of financial markets that is closely monitored by traders and investors alike. The traditional Average True Range (ATR) oscillator is a widely used technical indicator for measuring volatility in financial markets. However, there are limitations to the ATR oscillator, as it does not account for changing market conditions and may not adequately reflect extreme price movements. To address these limitations, TheATR has developed the VolEx indicator, which aims to identify extremes in the ATR oscillator by building dynamic thresholds using either a 'percentage' or 'standard deviation' based comparison with the value of the ATR.
The VolEx indicator utilizes a dynamic approach to measure volatility by considering the current level of the ATR oscillator relative to the dynamically generated thresholds. The dynamic thresholds are calculated based on the current ATR value and the chosen method of comparison (either 'percentage' or 'standard deviation'). If the ATR value exceeds the upper dynamic threshold, the market is experiencing high volatility, while a value below the lower dynamic threshold indicates low volatility.
The VolEx indicator offers several advantages over traditional volatility indicators, such as the ATR oscillator. First, it takes into account the changing market conditions and adjusts the thresholds accordingly. Second, it offers flexibility in the choice of the comparison method, allowing traders to tailor the indicator to their specific trading strategies. Finally, it provides clear signals for identifying extremes in volatility, which can be used to inform trading decisions.
In summary, the VolEx indicator developed by TheATR is a dynamic and flexible technical indicator that offers a robust approach to measuring volatility in financial markets. By utilizing dynamic thresholds and allowing for different comparison methods, the VolEx indicator provides a valuable tool for traders and investors seeking to identify extremes in market volatility..
NOTE: It is important to note that volatility, as measured by the VolEx indicator, does not provide any directional bias for the market movement. Rather, it simply indicates the degree to which the market is moving, regardless of direction. Traders and investors must use other technical or fundamental analysis tools to determine the direction of the market and make informed trading decisions based on their individual strategies and risk tolerance.
Relative ATRATR is one of the main indicators we use to measure volatility. When the market starts to consolidate or does not rise, ATR will be at a relatively low position.
However, the classic ATR formula does not consider that when the price changes at a logarithmic level, the ATR value will also change significantly. Therefore, I divide the calculated ATR value by the closing price to get an amplitude ratio index.
The adjusted indicator can well reflect the level of volatility. For example, the volatility of BTC reached an unprecedented low in January this year, which means that there will be a significant outbreak after breaking through the consolidation range. The configuration of the breakthrough order will be an excellent choice.
Fibonacci Levels Based on Supertrend [By MUQWISHI]A “ Fibonacci Levels Based on Supertrend ” indicator is supertrend indicator planned with Fibonacci retracements levels. Fibonacci retracements provides a sequence of levels starting from 0% to 100% in addition to extension levels. 0% is measured to be the initial Supertrend line, and 100% is the previous Supertrend line where it has been broken by candle. This tool could be valuable in terms of managing trades by setting targets and reducing the risk in the trend direction.
█ OVERVIEW
█ INDICATOR SETTINGS
Please let me know if you have any questions.
Thank you.
Cryptos Pump Hunter[liwei666]🔥 Cryptos Pump Hunter captured high volatility symbols in real-time, Up to 40 symbols can be monitored at same time.
Help you find the most profitable symbol with excellent visualization.
🔥 Indicator Design logic
🎯 The core pump/dump logic is quite simple
1. calc past bars highest and lowest High price, get movement by this formula
" movement = (highest - lowest) / lowest * 100 "
2. order by 'movement' value descending, you will get a volatility List
3. use Table tool display List, The higher the 'movement', the higher the ranking.
🔥 Settings
🎯 2 input properties impact on the results, 2 input impact on display effects, others look picture below.
pump_bars_cnt : lookback bar to calc pump/dump
resolution for pump : 1min to 1D
show_top1 : when ranking list top1 change, will draw a label
show pump : when symbol over threhold, draw a pump lable
🔥 How TO USE
🎯 only trade high volatility symbols
1. focus on top1 symbol on Table panel at top-right postion, trading symbols at label in chart.
2. Short when 'postion' ~ 0, Long when 'postion' ~ 1 on Table Cell
🎯 Monitor the symbols you like
1. 100+ symbols added in script, cancel remarks in code line if symbol is your want
2. add 1 line code if symbol not exist. if you want monitor 'ETHUSDTPERP ', then add
" ETHUSDTPERP = create_symbol_obj('BINANCE:ETHUSDTPERP'), array.unshift(symbol_a, ETHUSDTPERP ) "
🎯 Alert will be add soon, any questions or suggestion please comment below, I would appreciate it greatly.
Hope this indicator will be useful for you :)
enjoy! 🚀🚀🚀
Average True Range PercentWhen writing the Quickfingers Luc base scanner (Marvin) script, I wanted a measure of volatility that would be comparable between charts. The traditional Average True Range (ATR) indicator calculates a discrete number providing the average true range of that chart for a specified number of periods. The ATR is not comparable across different price charts.
Average True Range Percent (ATRP) measures the true range for the period, converts it to a percentage using the average of the period's range ((high + low) / 2) and then smooths the percentage. The ATRP provides a measure of volatility that is comparable between charts showing their relative volatility.
Enjoy.
Trail Blaze - (Multi Function Trailing Stop Loss) - [mutantdog]Shorter version:
As the title states, this is a 'Trailing Stop' type indicator, albeit one with a whole bunch of additional functionality, making it far more versatile and customisable than a standard trailing stop.
The main set of features includes:
Three independent trailing types each with their own +/- multipliers:
- Standard % change
- ATR (aka Supertrend)
- IQR (inter-quartile range)
These can be used in isolation or summed together. A subsequent pair of direction specific multipliers are also included.
Two separate custom source inputs are available, both feature the standard options alongside a selection of 'weighted inputs' and the option to use another indicator (selected via 'AUX'):
- 'Centre' determines the value about which the trailing sum will be added to define the stop level.
- 'Trigger' determines the value used for crossing of stops, initiating trend changes and triggering alerts.
A selection of optional filters and moving averages are available for both.
Furthermore there are various useful visualisation options available, including the underlying bands that govern the stop levels. Preset alerts for trend reversals are also included.
This is not really an 'out-of-the-box' indicator. Depending upon the market and timeframe some adjustments will be necessary for it to function in a useful manner, these can be as simple or complex as the feature-set allows. Basic settings are easy to dial in however and the default state is intended as a good starting point. Alternatively with some experimentation, a plethora of unique and creative configurations are possible, making this a great tool for tweaking. Below is a more detailed overview followed by a bunch of simple example settings.
------------------------
Lengthy Version :
DESIGN & CONCEPT
Before we start breaking this down, a little background. This started off as an attempt to improve upon the ever-popular Supertrend indicator. Of course there are many excellent user created variants available utilising some interesting methods to overcome the drawbacks of the basic version. To that end, rather than copying the work of others, the direction here shifted towards a hybrid trailing stop loss with a bunch of additional user customisation options. At some point, a completely different project involving IQR got morphed into this one. After sitting through months of sideways chop (where this proved to be of limited use), at the time of publication the market has began to form some near term trend direction and it appears to be performing well in many different timeframes.
And so with that out of the way...
INPUTS
The standard Supertrend (and most other variants) includes a single source input, as default set to 'hl2' (candle mid-range). This is the centre around which the atr bands are added/subtracted to govern the stop levels. This is not however the value which is used to trigger the trend reversal, that is usually hard-coded to 'close'. For this version both source values are adjustable: labelled 'centre' and 'trigger' respectively.
Each has custom input selectors including the usual options, a selection of 'weighted inputs' and the option to use another indicator (selected from the Aux input). The 'weighted inputs' are those introduced in Weight Gain 4000, for more details please refer to that listing. These should be treated as experimental, however may prove useful in certain configurations. In this case 'hl-oc2' can be considered an estimate of the candle median and may be a good alternative to the default 'centre' setting of 'hl2', in contrast 'cc-ohlc4' can tend to favour the extremes in the trend direction so could be useful as a faster 'trigger' than the default 'close'.
To cap them off both come with a selection of moving average filters (SMA, EMA, WMA, RMA, HMA, VWMA and a simple VWEMA - note: not elastic) aswell as median and mid-range. 'Centre' can also be set to the output of 'trigger' post-filter which can be useful if working with fast/slow crosses as the basis.
DYNAMICS
This is the main section, comprised of three separate factors: 'TSL', 'ATR' and 'IQR'. The first two should be fairly obvious, 'TSL' (trailing stop loss) is simply a percentage of the 'centre' value while 'ATR' (average true range) is the standard RMA-based version as used in Supertrend, Volatility Stop etc.
The third factor is less common however: 'IQR' (inter-quartile range). In case you are unfamiliar the principle here is, for a given dataset, the greatest 25% and smallest 25% of samples are removed. The remainder is then treated as a set and the range is calculated by highest - lowest. This is a commonly used method in statistical analysis, by removing the extremes it is less prone to influence by outliers and gives a good representation of the main dispersion around the median. In practise i have found it can be a good alternative to ATR, translating better across multiple time-frames due to it representing a fraction of the total range rather than an average of per-candle range like ATR. Used in combination with the others it can also add a factor more representative of longer-term/higher-timeframe trend. By discarding outliers it also benefits from not being impacted by brief pumps/volatility, instead responding only to more sustained changes in trend, such as rallies and parabolic moves. In order to give an accurate result the IQR is calculated using a dataset of high, low and hlcc4 values for all bars within the lookback length. Once calculated this value is then halved which, strictly speaking, makes it a semi-interquartile range.
All three of these components can be used individually or summed together to create a hybrid dynamics factor. Furthermore each multiplier can be set to both positive and negative values allowing for some interesting and creative possibilities. An optional smoothing filter can be applied to the sum, this is a basic SWMA-4 which is can reduce the impact of sudden changes but does incur a noticeable lag. Finally, a basic limiter condition has been hard-coded here to prevent the sum total from ever going below zero.
Capping off this section is a pair of direction multipliers. These simply take the prior dynamics sum and allow for further multiplication applied only to one side (uptrend/lo-stop and downtrend/hi-stop). To see why this is useful consider that markets often behave differently in each direction, we've all seen prices steadily climb over several weeks and then abruptly dump in the process of a day or two, shorter time frames are no stranger to this either. A lack of downside liquidity, a panicked market, aggressive shorts. All these things contribute to significant differences in downward price action. This function allows for tighter stops in one direction compared to the other to reflect this imbalance.
VISUALISATIONS
With all of these options and possibilities, some visual aids are useful. Beneath the dynamics' section are several visual options including both sources post-filter and the actual 'bands' created by the dynamics. These are what govern the stop levels and seeing them in full can help to better understand what our various configurations actually do. We can even hide the stop levels altogether and just use the bands, making this a kind of expanded Keltner Channel. Here we can also find colour and opacity settings for everything we've discussed.
EXAMPLES
The obvious first example here is the standard %-change trailing stop loss which, from my experience, tends to be the best suited for lower time frames. Filtering should probably minimal here. In both charts here we use the default config for source inputs, the top is a standard bi-directional setup with 1.5% tsl while the bottom uses a 2.5% tsl with the histop multiplier reduced to 0 resulting in an uptrend only stoploss.
Shown here in grey is the standard Supertrend which uses 'hl2' as centre and 'close' as trigger, ATR(10) multiplied by 3. On top we have the default filtered source config with ATR(8) multiplied by 2 which gives a different yet functionally similar result, below is the same source config instead using IQR(12) multiplied by 2. Notice here the more 'stepped' response from IQR following the central rally, holding back for a while before closing in on price and ultimately initiating reversal much sooner. Unlike ATR, the length parameter for IQR is absolute and can more significantly affect its responsiveness.
Next we focus on the visualisation options, on top we have the default source config with ATR(8) multiplied by 2 and IQR(12) multiplied by 1. Here we have activated the switch to show 'bands', from this we can see the actual summed dynamics and how it influences the stop levels. Below that we have an altogether different config utilising the included filters which are now visible. In this example we have created a basic 8/21 EMA cross and set a 1% TSL, notice the brief fakeout in the middle which ordinarily might indicate a buy signal. Here the TSL functions as an additional requirement which in this case is not met and thus no buy signal is given.
Finally we have a couple of more 'experimental' examples. On top we have Lazybear's 'Variable Moving Average' in white which has been assigned via 'aux' as the centre with no additional filtering, the default config for trigger is used here and a basic TSL of 1.5% added. It's a simple example but it shows how this can be applied to other indicators. At the bottom we return to the default source config, combining a TSL of 8% with IQR(24) multiplied by -2. Note here the negative IQR with greater length which causes the stop to close in on price following significant deviations while otherwise remaining fairly wide. Combining positive and negative multiples of each factor can yield mixed results, some more useful than others depending upon suitable market conditions.
Since this has been quite lengthy, i shall leave it there. Suffice to say that there are plenty more ways to use this besides these examples. Please feel free to share any of your own ideas in the comments below. Enjoy.
True Range MomentumThe indicator calculates the momentum of bullish and bearish based on the average true range and the highest highs and lowest lows of the historical price.
The indicator displays the strength for either taking a long position, or a short position.
The simplest way to use the indicator is to take a long position when the M+ line crosses above the 0 line. Similarly, to short, the M- line should cross above the 0 line. The exit would be when the respective line crosses below the 0 line.
The contrarian traders should wait for the lines to start rising towards the 0 line and taking an exit. In essence, the line should be going from negative to 0.
The greater the divergence between the M+ and M-, the stronger the trend.
The small table of Long and Short suggests what is in strength. A 100 will show a strong trend in the respective direction. It will be 50-50 when there is no clear direction, ideally identifying a consolidation range.
ATR Mean Reversion Strategy V1**Long Only Strategy**
When Price drops below the ATR band below it will enter a buy on the next candle open
SL at current price minus ATR* ATR multiplier
TP at Mean EMA or if higher than Mean EMA and current candle low is below previous candle low or if price is above ATR
NB: I would highly recommend a low fee broker (I use ICmarkets raw spread account) due to the fact that this is a decently high frequency trading strategy you will rack up a lot of commission, if you use and exchange like Bybit or Binance the strategy will not be profitable due to the high commissions.
ER-Adaptive ATR Limit Channels w/ States [Loxx]As simple as it gets, channels based on high, low and ATR distances, Shows possible short term support / resistance or can be used as a take profit/stop-loss in some trading systems. It does this by comparing high/low values of price to multiplied by a multiple of ATR to determine when the trend changes. States are included to change the sensitivity to trend changes. 1 is very sensitive, 3 is least sensitive.
This uses Loxx's Expanded Source Types. You can read about them here:
What is ER Adaptive ATR?
Average True Range (ATR) is widely used indicator in many occasions for technical analysis . It is calculated as the RMA of true range. This version adds a "twist": it uses Perry Kaufman's Efficiency Ratio to calculate adaptive true range
Profitable Supertrend v0.1 - AlphaThis a script to try detect the best combination of supertrend parameters in a space of time. Sadly the script is slow. Evaluate all possibilities params is hard for a pinescript and my knowledge too. In some cases, when you want evaluate many time could be the script fails for timeout. Perhaps with time I could enhance. For this problem of speed the calculate of combinatios it's not complete: In factor use a increment of 0.2 in each param (0.1, 0.3, 0.5 ...) in period the increment for each value is 3. The range for factor it's from 3.0 to 12.0. The range of period it's from 10 to 43
My knowledge don't let me go more far. Perhaps with time I can enhance the script.
ATR PivotsThe "ATR Pivots" script is a technical analysis tool designed to help traders identify key levels of support and resistance on a chart. The indicator uses various metrics such as the Average True Range (ATR), Daily True Range ( DTR ), Daily True Range Percentage (DTR%), Average Daily Range (ADR), Previous Day High ( PDH ), and Previous Day Low ( PDL ) to provide a comprehensive picture of the volatility and movement of a security. The script also includes an EMA cloud and 200 EMA for trend identification and a 1-minute ATR scalping strategy for traders to make informed trading decisions.
ATR Detail:-
The ATR is a measure of the volatility of a security over a given period of time. It is calculated by taking the average of the true range (the difference between the high and low of a security) over a set number of periods. The user can input the number of periods (ATR length) to be used for the ATR calculation. The script also allows the user to choose whether to use the current close or not for the calculation. The script calculates various levels of support and resistance based on the relationship between the security's range ( high-low ) and the ATR. The levels are calculated by multiplying the ATR by different Fibonacci ratios (0.236, 0.382, 0.5, 0.618, 0.786, 1.000) and then adding or subtracting the result from the previous close. The script plots these levels on the chart, with the -100 level being the most significant level. The user also has an option to choose whether to plot all Fibonacci levels or not.
DTR and DTR% Detail:-
The Daily True Range Percentage (DTR%) is a metric that measures the daily volatility of a security as a percentage of its previous close. It is calculated by dividing the Daily True Range ( DTR ) by the previous close. DTR is the range between the current period's high and low and gives a measure of the volatility of the security on a daily basis. DTR% can be used as an indicator of the percentage of movement of the security on a daily basis. In this script, DTR% is used in combination with other metrics such as the Average True Range (ATR) and Fibonacci ratios to calculate key levels of support and resistance for the security. The idea behind using DTR% is that it can help traders to better understand the daily volatility of the security and make more informed trading decisions.
For example, if a security has a DTR% of 2%, it suggests that the security has a relatively low level of volatility and is less likely to experience significant price movements on a daily basis. On the other hand, if a security has a DTR% of 10%, it suggests that the security has a relatively high level of volatility and is more likely to experience significant price movements on a daily basis.
ADR:-
The script then calculates the ADR (Average Daily Range) which is the average of the daily range of the security, using the formula (Period High - Period Low) / ATR Length. This gives a measure of the average volatility of the security on a daily basis, which can be useful for determining potential levels of support and resistance .
PDH /PDL:-
The script also calculates PDH (Previous Day High) and PDL (Previous Day Low) which are the High and low of the previous day of the security. This gives a measure of the previous day's volatility and movement, which can be useful for determining potential levels of support and resistance .
EMA Cloud and 200 EMA Detail:-
The EMA cloud is a technical analysis tool that helps traders identify the trend of the market by comparing two different exponential moving averages (EMAs) of different lengths. The cloud is created by plotting the fast EMA and the slow EMA on the chart and filling the space between them. The user can input the length of the fast and slow EMA , and the script will calculate and plot these EMAs on the chart. The space between the two EMAs is then filled with a color that represents the trend, with green indicating a bullish trend and red indicating a bearish trend . Additionally, the script also plots a 200 EMA , which is a commonly used long-term trend indicator. When the fast EMA is above the slow EMA and the 200 EMA , it is considered a bullish signal, indicating an uptrend. When the fast EMA is below the slow EMA and the 200 EMA , it is considered a bearish signal, indicating a downtrend. The EMA cloud and 200 EMA can be used together to help traders identify the overall trend of the market and make more informed trading decisions.
1 Minute ATR Scalping Strategy:-
The script also includes a 1-minute ATR scalping strategy that can be used by traders looking for quick profits in the market. The strategy involves using the ATR levels calculated by the script as well as the EMA cloud and 200 EMA to identify potential buy and sell opportunities. For example, if the 1-minute ATR is above 11 in NIFTY and the EMA cloud is bullish , the strategy suggests buying the security. Similarly, if the 1-minute ATR is above 30 in BANKNIFTY and the EMA cloud is bullish , the strategy suggests buying the security.
Inside Candle:-
The Inside Candle is a price action pattern that occurs when the current candle's high and low are entirely within the range of the previous candle's high and low. This pattern indicates indecision or consolidation in the market and can be a potential sign of a trend reversal. When used in the 15-minute chart, traders can look for Inside Candle patterns that occur at key levels of support or resistance. If the Inside Candle pattern occurs at a key level and the price subsequently breaks out of the range of the Inside Candle, it can be a signal to enter a trade in the direction of the breakout. Traders can also use the Inside Candle pattern to trade in a tight range, or to reduce their exposure to a current trend.
Risk Management:-
As with any trading strategy, it is important to practice proper risk management when using the ATR Pivots script and the 1-minute ATR scalping strategy. This may include setting stop-loss orders, using appropriate position sizing, and diversifying your portfolio. It is also important to note that past performance is not indicative of future results and that the script and strategy provided are for educational purposes only.
In conclusion, the "ATR Pivots" script is a powerful tool that can help traders identify key levels of support and resistance , as well as trend direction. The additional metrics such as DTR , DTR%, ADR, PDH , and PDL provide a more comprehensive picture of the volatility and movement of the security, making it easier for traders to make better trading decisions. The inclusion of the EMA cloud and 200 EMA for trend identification, and the 1-minute ATR scalping strategy for quick profits can further enhance a trader's decision-making process. However, it is important to practice proper risk management and understand that past performance is not indicative of future results.
Special thanks to satymahajan for the idea of clubbing Average True Range with Fibonacci levels.
TradePro's 2 EMA + Stoch RSI + ATR StrategySaw TradePro's "NEW BEST HIGHEST PROFITING STRATEGY WITH CRAZY RESULTS - 2 EMA+ Stochastic RSI+ ATR", and was curious on the back testing results. This strategy is an attempt to recreate it.
This strategy uses 50 / 200 EMAs, Stochastic RSI and ATR.
Long Entry Criteria:
- 50 EMA > 200 EMA
- Price closes below 50 EMA
- Stochastic RSI has gone into oversold < 20
- Stochastic RSI crosses up while making higher low from previous cross up
Short Entry Criteria:
- 50 EMA < 200 EMA
- Price closes above 50 EMA
- Stochastic RSI has gone into overbought > 80
- Stochastic RSI crosses down while making lower high from previous cross down
Stop-loss is set to ATR stop-loss
Take Profit is 2x the risk
All parameters are configurable.
Enjoy~~
Strategy: Range BreakoutWhat?
In the price action, levels have a significant role to play. Based on the price moving above/below the levels - the underlying instrument shows some price-action in the direction of breakout/breakdown.
There are plenty of ways level can be determined. Levels are the decision point to take a trade or not. But if we make the level derivation complex, then the execution may get hamper.
This strategy script, developed in PineScript v5, is our attempt at solving this problem at the core by providing this simple, yet elegant solution to this problem.
It's essentially an attempt to Trade Simple by drawing logical (horizontal) lines in the chart and take actions, after multiple associated parameters confirmation, on the breakout / breakdown of the levels.
How?
Let us explain how we are drawing the levels.
We are depending on some of the parameters as described below:
Open Range : During intraday movement, often if prices move beyond a particular level, it exibits more movement in the same swing in same direction. We found out, through our back testing for Indian Indices like NSE:NIFTY , NSE:BANKNIFTY or NSE:CNXFINANCE the first 15m (i.e 09:15 AM to 09:30 AM, IST) is one of such range. For Indian stocks, it is 9:15 to 9:45. And for MCX MCX:CRUDEOIL1! it's 5:00 pm to 6:00 pm. There are our first levels.
PDHCL : Previous Day High, Close, Low. This is our next level
VWAP : The rolling VWAP (volume weighted average price)
In the breakout/breakdown of the Open Range and Previous Day High/Low, we are taking the trade decisions as follows using CEST principle:
C onditions :
If current bar's (say you are in 5m timeframe) closing is broken out the Open Range High or Previous Day High, taken a Buy/Long decision (let's say buying a Call Option CE or selling a Put Option PE or buying the future or cash).
If current bar's (say you are in 5m timeframe) closing is broken down the Open Range Low or Previous Day Low, taken a Sell/Short decision (let's say buying a Put Option CE or selling a Call Option PE or selling the future or cash).
Additionally, and optionally (default ON, one can turn off): we are checking various other associated multiple confirmations as follows:
1. Momentum : Checking 14-period RSI value is more than 50 or less than 50 (all parameters like period, OB, OS ranges are configurable through settings)
2. Current bar's volume is more than the last 20 bars volume average. How much more - that multiplier is also configurable. (default is 1)
3. The breakout candle is bullish (green) or bearish (red).
E ntry :
All of these happens only on the closing of the candle . Means: Non Repainting! .
Clearly in the chart we are showing as green up arrow BO (breakout for buy) and red down arrow BD (breakdown for sell) to take your decision process smooth.
So, on the closing of the decision BO/BD candle we are entering the trade (with a thumping heart and nail biting ...)
S top Loss :
We are relying on the time tasted (last 40 years) mechanism of Average True Range (ATR) of default 14 period. This default period is also configurable.
So for Long trades: the 14 period ATR low band is the SL.
For Short trades: the 14 period ATR high band is the SL.
T arget :
We are depending on the thump rule of 1:2 Risk Reward. It's simple and effective. No fancy thing. We are closing the trade on double the favorable price movement compared to the SL placed. Of course, this RR ratio is confiurable from the settings, as usual.
What's Unqiue in it?
The utter simplicity of this trading mechanism. No fancy things like complex chart pattern, OI data, multiple candlestick patterns, Order flow analysis etc.
Simple level determination,
Marking clearly in the chart.
Making each parameter configurable in Settings and showing tooltip adjacent to the parameter to make you understand it better for your customization,
Wait for the candle close, thus eliminating the chances of repainting menace (as much as possible)
Additional momentum and volume check to trade entry confirmation.
Works with normal candlestick (nothing special ones like HA ...)
Showing everything as a Summary Table (which, again can be turned off optionally) overlaying at the bottom-right corner of the chart,
Optionally the Summary Table can be configured to alert you back (say you get it notified in your email or SMS).
That way, a single, simple, effective trade setup will ease your journey as smooth sail as possible.
Mentions
There are plenty of friends from whom time to time we borrowed some of the ideas while working closely together over last one year.
From tradingview community, we took the spirit of @zzzcrypto123 awesome work done long back (in 2020) as the indicator "ORB - Opening Range Breakout". (We tried to reach him for his explicit consent, unable to catch hold of him).
Some other publicly available materials we have consulted to get the additional checks (like RSI, volume).
Lat word
Use it please and thank you for your constant patronage in following us in this awesome platform. Let's keep growing together.
Disclaimer :
This piece of software does not come up with any warrantee or any rights of not changing it over the future course of time.
We are not responsible for any trading/investment decision you are taking out of the outcome of this indicator.
DTR/ATR Scanner v1.0This indicator allows you to view DTR vs. ATR % for multiple instruments. When colors are Red the instrument is near 90% of its daily ATR.
Up Down VolatilityThis is just experimental. I wanted the flexibility in looking at volatility and this indicator gives you several ways to do so.
I haven't figured out the best way to use this yet but I suspect that as a form of entry confirmation indicator would be best.
If you find a way this works well for you please drop me a note. It would nice know someone found a way to use it successfully!
The options available are:
* Your source can be price or the ATR.
* It allows you to separate the volatility of the bearish and bullish candles and even allows you to produce differential.
* You can choose to run the result through any one of many smoothers.
With the above options you can look at:
* The normal volatility. That is not split into bearish and bullish components.
* The bearish and bullish volatility and the difference between them.
* The relative bearish and bullish volatility and the difference between them.
The "The relative bearish and bullish" is each one divided into the source before it was split into Up and Down or low/high divided by close which should make the max value roughly around 1.
The code is structured to easily drop into a bigger system so use it as a lone indicator or add the code to some bigger project you are creating. If you do integrate it into something else then send me a note as it would be nice to know it's being well used.
Enjoy and good luck!