Description:
Plots the average true range of an alternative periodicity than that of the chart (requested by jmont1).
Parameters:
* BarType : Month, Week, Day, Minute, Second, Tick, Volume, Delta (default = Minute)
* BarValue: Value to be used for BarType (default = 15)
* Period : Lookback for ATR
gbPriceReferenceATR, Ver 1.0, TraderGB, June 24, 2021
Description:
Shows current price in relation to ATR reference points. The anchor point where the ATR calculations are pinned to can be the Close, High, Low, Median, Open, Typical or Weighted price of the current bar or any bar in the past. ATR calculations are always made from the prior bar to the current bar. No matter what price and bar is selected, the upper/lower reference lines are calculated by adding/subtracting half the ATR factor (ATR * MultipleATR) from the given price/bar anchor point.
Parameters:
* LookbackATR: Length for the ATR calculation (default=10)
* MultipleATR: Multiple used for ATR calculation (default=1)
* AnchorPoint: Price to use to anchor ATR calculations to (default=Median)
* BarsBack: Bar to use for anchor ATR calculations to (default=0)
Note: If you find bugs, have feature requests, or anything else, post in THIS thread.
This indicator was inspired by the typical ATR(Average True Range). The ATR simply reports the AVERAGE range of the last n-bars.
This indicator reports the average n-bars, OF A SPECIFIC time. The ACR line will show the AVERAGE volatility of a specific CLOCK TIME. As this is all just an average, it is all calculated at the start of the session, so the Projection can be displayed for the rest of the session. I find that this lends itself to an easier planning of the day around expected movement for various instruments.
This may show users the times of day where price is most likely to move. Helpful for users that focus on larger bars.
You can put this on whatever bar size you want, but must be used on TIME CHARTS. It doesn't make much sense to put on M1 charts imo.
This indicator operates OnEachTic().
The Period sets how many days to look back to capture a range. I.e., an M30 bar @ 9:30, with a period of 5, will display the average range of of that 9:30 bar over the past 5 periods.
Configuration Days is used to get a count of the bars in session, this is mainly useful for people with unreliable data, or putting this on fast charts. Should be able to leave on default.
NOTE: This indicator builds off of your session template, and assumes each session has an equal number of bars in it. If you have custom templates where each day has a different # of bars, this indie may not be of use.
NOTE: Installing this indicator will create a folder called "BTMM," that's where the indicator will be.
---EDIT - V2 9April2020---
Fixed Bug where the indicator was not saving properly with session or chart templates.
The SuperTrend indicator is an application of the concept of MAE (maximum adverse excursion), which was introduced by John Sweeney in the mid-nineties. It is a Stop-And-Reverse (SAR) indicator based on breakouts from a modified Keltner channel.
The SuperTrendU11 is an enhanced version of the original SuperTrend indicator that comes with the following modifications:
- You may select between 36 different moving averages for the baseline.
- The baseline is calculated one bar ago to avoid recalculating with each incoming tick.
- You may select from 4 different volatility measures - average true range, average range, residual mean absolute deviation and residual root mean square deviation
- Average true range and average range can be calculated from 30 different moving averages.
- All volatility measures are also calculated one bar ago.
In fact there is no point in moving a trailing stop towards the current price intra-bar. Therefore a trailing stop should always be calculated from the prior bar and not the last price.
When you import the install file to NinjaTrader, it will also install the following moving averages:
- Moving Median
- Moving Median TPO
- Moving Median VWTPO
- Moving Mean TPO
- Moving Mean VWTPO
- Adaptive Laguerre Filter
- ADXVMA
- Butterworth Filter
- Distant Coefficient Filter
- Double Weighted Moving Average (DWMA)
- Exponential Hull Moving Average (EHMA)
- Gaussian Filter
- Holt EMA
- Laguerre Filter
- Range Weighted Moving Average
- SuperSmoother
- Sine Weighted Moving Average
- Tillson T3
- Triple Weighted Moving Average (TWMA)
- ZerolagHATEMA
- ZerolagTEMA
It will also install debugged versions of MAX and MIN, as the in-built versions supplied with NT8 do not work correctly with Renko bars (RemoveLastBarSupported).
The SuperTrend U11 can be set to revert intra-bar or at the bar close. With default settings the stop line is only broken, when there is a bar close beyond the stop. The indicator further comes with paint bars and sound alerts.
The SuperTrend is a trend indicator, which can be used in various ways. It is best used as a trailing stop or as a trend filter. It can also be used as a stop-and-reverse indicator, but will only work as such in trending markets. Typically it will allow for profitable results while the market is trending and then give the money back in sideways markets.
Note: The SuperTrend U11 has the trend exposed as a public property. This property can be accessed programmatically. However, it cannot be currently accessed via the market analyzer. In order to access the Trend series via the market analyzer, a specific MarketAnalyzerColumn is required. The MarketAnalyzerColumn is not yet included with the install file, as it has led to freezes with NT 8.0.8.0. The bug has been confirmed by NinjaTrader developers and only fixed with the latest release NT 8.0.9.0. (issue #12054). The market analyzer column and sound files for the SuperTrend U11 will be available with a future update.
*) Unfortunately, the forum software always renames zip files to match the original file name. Therefore the zip file refers to a prior version of the amaSuperTrendU11. Be assured that the zip file contains the indicator version referenced in the headline.
The SuperTrend indicator is an application of the concept of MAE (maximum adverse excursion), which was introduced by John Sweeney in the mid-nineties. It is a Stop-And-Reverse (SAR) indicator based on breakouts from a modified Keltner channel.
The SuperTrendM11 is an enhanced version of the original SuperTrend indicator that comes with the following modifications:
- The moving average has been replaced with a more robust median.
- The median is calculated one bar ago to avoid recalculating with each incoming tick.
- The average true range (ATR) is calculated one bar ago to avoid recalculating with each incoming tick.
In fact there is no point in moving a trailing stop towards the current price intra-bar. Therefore a trailing stop should always be calculated from the prior bar and not the last price.
This version of the SuperTrend can be set to revert intra-bar or at the bar close. With default settings the stop line is only broken, when there is a bar close beyond the stop. The indicator comes with paint bars and sound alerts.
The SuperTrend is a trend indicator, which can be used in various ways. It is best used as a trailing stop or as a trend filter. It can also be used as a stop-and-reverse indicator, but will only work as such in trending markets. Typically it will allow for profitable results while the market is trending and then give the money back in sideways markets.
Note: The SuperTrend M11 has the trend exposed as a public property. This property can be accessed programmatically. However, it cannot be currently accessed via the market analyzer. In order to access the Trend series via the market analyzer, a specific MarketAnalyzerColumn is required. The MarketAnalyzerColumn is not yet included with the install file, as it has led to freezes with NT 8.0.8.0. The bug has been confirmed by NinjaTrader developers and only fixed with the latest release NT 8.0.9.0. (issue #12054). The market analyzer column and sound files for the SuperTrend M11 will be available with a future update.
*) Unfortunately, the forum software always renames zip files to match the original file name. Therefore the zip file refers to a prior version of the amaSuperTrendM11. Be assured that the zip file contains the indicator version referenced in the headline.
This is an implementation of the volatiliy based stop that was suggested by Tushar Chande and Stanley Kroll in their book "The New Technical Trader". The indicator comes with a long stop line (blue) and and a short stop line (red).
Calculation of long stop: The preliminary long stop is calculated by deducting a multiple of a 10-period ATR from the highest high of the last 10 bars. The long stop is then calculated as the highest of the last 20 preliminary long stops.
Calculation of short stop: The preliminary short stops are calculated by adding a ,ultiple of a 10-period ATR to the lowest low of the last 10 bars. The short stop is then calculated as the lowest of the last 20 perliminary short stops.
Calculation of ATR: The ATR can be calculated in three different ways. "Arithmetic" uses a simple moving average over the last 10 true ranges. "Exponential" uses an exponential moving average over the last 10 true ranges, while "Wilder" simply calculates the default ATR(10) which is calculated as exponential moving averages with a smaller smoothing constant.
Default settings: Default settings follow suggestions by Chande & Kroll. Following suggestions in their book the default parameters are 10, 3 and 20. Also they used a simple moving average for smoothing the true ranges. The only change that was necessary was to adapt the indicator so that it can be used intra-bar. For this purpose, the calculation does not use the (unstable) true range of the current bar nor the high of the current bar, but relies on the values for the prior bar. Just for the purpose to compare the indicator with implementations for other charting packages, it is also possible to perform calculations from the current unstable bar. When used with "COBC = False" or with the strategy analyzer (backtesting), the default settings should be used.
This is a new implementation of the chandelier stop developed by Charles LeBeau. For a long trade the chandelier stop is calculated by subtracting a multiple of the average true range over the last N bars from the highest high (chandelier) since the inception of the trade. For a short trade the chandelier stop is calculated by adding a multiple of the average true range over the last N bars to the lowest low since the inception of the trade.
Instead of calculating the stop from the highest high and the lowest low, it is also possible to calculate it from the highest close and the lowest close.
The indicator version presented here uses the average true range calculated one bar ago. This is to avoid that the stop moves away when approached by a bar, it further acts against the distortion of the average true range when the indicator is set to COBC = false and reduces CPU load. The concept of using the ATR one bar ago was already introduced with the SuperTrend M11.
UseHighLow: The chandelier stops can be calculated from highest high/lowest low or from highest close/lowest close:
Reverse Intra-bar = false: This is the default setting of the indicator. A logical signal will be generated when the close of the signal bar has taken out the stop line. The position may be reversed at the open of the next bar. The paint bars will only change colors for the bar after the signal bar. The arrow will be also plotted for the entry bar.
Reverse Intra-bar = true: This is an unusual setting for the Chandelier Stop The signal will be generated with the first tick that has plotted on the other side of the stop line. In this case the position may be reversed intra-bar for the signal bar. Paintbars and arrows will already plot for the signal bar.
Accessing the trend: The indicator comes with a BoolSeries that holds the trend. This BoolSeries can be accessed by other indicators or automated strategies.
Paintbars: The indicator has an option to display the current trend via paintbars. Downclose bars are filled, upclose bars are hollow. For the upclose bars an opacity can be selected for better visibility.
Arrows: The indicator has an option to display trend changes via an arrow.
Sound alerts: The indicator will alert to trend reversals and potential trend reversals. A potential trend reversal occurs when price touches the stop line intra-bar prior to the confirmation by a close on the other side of the stop line. The sound files are included with the indicator install file. Please unzip and copy them into the program files (x86)\ NinjaTrader 7\ sounds directory or whatever directory is used by NinjaTrader to store the sound files.
Please download the new Supertrend U11 (Universal), which allows to calculate the stop line from median, mode and 27 other moving averages.
This is a new implementation of the TradeStation SuperTrend indicator for NinjaTrader 7. The SuperTrend indicator is an application of the concept of MAE (maximum adverse excursion), which was introduced by John Sweeney in the mid-nineties.
The SuperTrend M11 is particularly stable and has a few advantages over other SuperTrend indicators:
It uses a moving (statistical) median of the arithmetic mean (High + Low)/2 of the bars instead of a moving average. The (statistical) median is known to be more robust than any average.
It calculates both the Median and the ATR (average true range) 1 bar ago, whereas the original SuperTrend indicator takes the ATR and moving average of the current bar. If you use the current bar's ATR, the current bar's breakout is partly measured against its own range. This is particularly true, if the ATR period is short.
Accessing the trend: The indicator comes with a BoolSeries that holds the trend. This BoolSeries can be accessed by other indicators or automated strategies.
Reverse Intra-bar = false: This is the default setting of the indicator. A logical signal will be generated when the close of the signal bar has taken out the stop line. The position may be reversed at the open of the next bar. The paint bars will only change colors for the bar after the signal bar. The arrow will be also plotted for the entry bar.
Reverse Intra-bar = true: This is an unusual setting for the SuperTrend. The signal will be generated with the first tick that has plotted on the other side of the stop line. In this case the position may be reversed intra-bar for the signal bar. Paintbars and arrows will already plot for the signal bar.
Paintbars: The indicator has an option to display the current trend via paintbars. Downclose bars are filled, upclose bars are hollow. For the upclose bars an opacity can be selected for better visibility.
Arrows: The indicator has an option to display trend changes via an arrow.
Sound alerts: The indicator will alert to trend reversals and potential trend reversals. A potential trend reversal occurs when price touches the stop line intra-bar prior to the confirmation by a close on the other side of the stop line. The sound files are included with the indicator install file. Please unzip and copy them into the program files (x86)\ NinjaTrader 7\ sounds directory or whatever directory is used by NinjaTrader to store the sound files.
Comparison between SuperTrend M1 and SuperTrend M11:
The SuperTrend M11 calculates both the average true range and the median 1 bar ago. This results in a considerable saving in CPU load, if you use the indicators in CalculateOnBarClose = false mode. The SuperTrend M11 does the median calculation only once per bar, while the SuperTrend M1 recalculates it with every incoming tick. If you use the indicator with CalculateOnBarClose = true setting, you can also continue to use the SuperTrend M1. There will be no significant difference in performance.
Changed formula: The Supertrend M11 will give slightly different results, when compared with the Supertrend M1. If you want to reproduce the settings of your Supertrend M1, you should use the same value for the ATR period and the ATR multiplier, but reduce the value for the median period by 1. The result will still not be identical. Also for both indicators a minimum size for the ATR values has been imposed, the ATR may not be smaller than the ticksize. This is only important for lower timeframes during low volatility and prevents the SuperTrend from changing the trend too often.
SuperTrend M1: The indicator package contains an updated version of the SuperTrend M1. However, I recommend to switch to SuperTrend M11.
Update August 10, 2011 : Visual design improved. The new indicator version can also be called by other indicators and strategies.
Update May 23, 2012: Entirely recoded version, which uses Median and ATR 1 bar ago to avoid recalculation with every tick. Sound alerts added that trigger intra-bar and which can be used on replay. Smaller improvements added.
Update May 24, 2012: Bug removed, upclose candles were not plotting properly.
Update June 30, 2012: New SuperTrend U11 "Universal" released, this is a new indicator - see link for more information
Update October 2, 2012: Indicator simplified. Trend state can no longer change intra-bar.
Update October 3, 2012: Indicator now allows for displacement. BoolSeries modified for accessing the trend. Trend change intra-bar is possible with option reverse intra-bar and COBC = false.
Update March 5, 2013: Arrows now plotting one bar earlier for the option Reverse intra-bar = true.
This is a new implementation of the TradeStation SuperTrend indicator for NinjaTrader 7. The SuperTrend indicator is an application of the concept of MAE (maximum adverse excursion), which was introduced by John Sweeney in the mid-nineties. The SuperTrend can be viewed as a trailing stop and changes direction, when the trailing stop is taken out.
The SuperTrend U11 calculates both the baseline and the offset 1 bar ago, as did the SuperTrend M11. This is to reduce CPU load and avoid feedback loops.
Accessing the trend: The indicator comes with a BoolSeries that holds the trend. This BoolSeries can be accessed by other indicators or automated strategies.
Reverse Intra-bar = false: This is the default setting of the indicator. A logical signal will be generated when the close of the signal bar has taken out the stop line. The position may be reversed at the open of the next bar. The paint bars will only change colors for the bar after the signal bar. The arrow will be also plotted for the entry bar.
Reverse Intra-bar = true: This is an unusual setting for the SuperTrend. The signal will be generated with the first tick that has plotted on the other side of the stop line. In this case the position may be reversed intra-bar for the signal bar. Paintbars and arrows will already plot for the signal bar.
Paintbars: The indicator has an option to display the current trend via paintbars. Downclose bars are filled, upclose bars are hollow. For the upclose bars an opacity can be selected for better visibility.
Arrows: The indicator has an option to display trend changes via an arrow.
Sound alerts: The indicator will alert to trend reversals and potential trend reversals. A potential trend reversal occurs when price touches the stop line intra-bar prior to the confirmation by a close on the other side of the stop line. The sound files are included with the indicator install file. Please unzip and copy them into the program files (x86)\ NinjaTrader 7\ sounds directory or whatever directory is used by NinjaTrader to store the sound files.
Comparing Supertrend U11 to Supertrend M11:
The SuperTrend U11 is a generalization of the SuperTrend M11.
-> The SuperTrend M11 uses the moving median of the arithmetic mean (High + Low)/2 one bar ago and adds/subtracts a multiple of the average true range one bar ago.
-> The SuperTrend U11 allows you to use the median as above , but instead you can also calculate the baseline from a selection of other indicators. These are the options available for the baseline
- a moving median
- a moving mode
- an ADXVMA
- a 2-pole Butterworth filter
- a 3-pole Butterworth filter
- a DEMA (double exponential MA)
- a DSMA (double simple MA)
- a DTMA (double triangular MA)
- a DWMA (double weighted MA)
- an Ehlers filter
- an EMA
- a 2-pole Gauss filter
- a 3-pole Gauss filter
- a 4-pole Gauss filter
- a HMA (Hull MA)
- a Holt EMA
- a Linear Regression indicator
- a LLMA (phase set to 0)
- a SMA
- a 2-pole Supersmoother
- a 3-pole Supersmoother
- a TEMA (triple exponential MA)
- a TMA (triangular MA)
- a TSMA (triple simple MA)
- a TWMA (triple weighted MA)
- a VWMA(volume weighted MA)
- a WMA (weighted MA)
- a ZeroLagHATEMA
- a ZeroLagTEMA
- a ZLEMA
While the SuperTrend M11 uses the average true range as an offset, the offset for the SuperTrend U11, can be selected as
- a moving average (or median, mode) of the simple range
- a moving average (or median, mode) of the true range
- the standard deviation
The added options will not slow down the indicator, as the selection becomes effective, when the indicator is added.
You can reproduce the SuperTrend M11 with the SuperTrend U11, if you apply it to the arithmetic mean (Median in NinjaSpeak) and select "Median" for the baseline, "EMA" for offset smoothing and "True Range" for offset type. However you need to take into account that the ATR uses Wilder's exponential smoothing (smoothing constant k = 1/n) which is different from the EMA (smoothing constant k = 2/(n+1)). For example an offset period of 8 for the SuperTrend M11 will produce a smoothing factor of 1/8 and translate to an offset period of 15 for the SuperTrend U11.
Update July 3, 2012: ADXVMA option for baseline added.
Update July 5, 2012: Bug removed - Butterworth, Gauss and Supersmoother Fillter did not use the specified baseline period.
Update August 17, 2012: Old version of ADXVMA replaced with new version.
Update August 31, 2012: Ehlers filter updated.
Update October 2, 2012: Indicator simplified. Trend state can no longer change intra-bar. Gaussian and Ehlers filters updated. Mode removed from options.
Update October 3, 2012: Indicator now allows for displacement. BoolSeries modified for accessing the trend. Trend change intra-bar is possible with option reverse intra-bar and COBC = false.
Update March 5, 2013: Arrows now plotting one bar earlier for the option Reverse intra-bar = true.
For the last three updates you also need to update Bollinger Universal & Keltner Universal, if you have them installed. Please remove old versions of those indicators first.
January 19th, 2022 08:29 AM newell This one is helpful in many ways, thank you!
June 20th, 2021 11:46 AM Aragorn Ironic I just started, last week, plotting the ATR at certain times of the day over several days only to find this great
tool. Very well done!
May 21st, 2021 03:02 PM MarketMage nice! thank you!
April 3rd, 2024 04:20 PM deandavis Thanks for your indicators. I can only imagine the hours you put into coding them I am looking for your gbMACD can y
ou give me a clue as to where I may find it?
Thanks
Dean
December 3rd, 2022 02:47 PM candy Very useful! Thanks!
May 9th, 2022 05:01 AM Leafcutter thanks for sharing - I´ve been looking for that since a long time - works great even with unirenko Bars.
August 19th, 2021 04:51 PM zohar thanks
August 16th, 2021 08:51 PM MrTrader Nice Indie, thanks TraderGB!!