The Regression Channel already comes as a NinjaTrader default indicator. However, the NinjaTrader default indicator comes with a few limitations, which are adressed by this indicator:
- The default indicator calculates the regression channel from the last bar loaded by OnBarUpdate(). When the chart scrolled back horizontally, the regression channel remains in its future position until it drops out of the chart.
- The default indicator does not allow for calculating the linear regression channel a few bars ago and then project the channel lines forward until the current bar.
This version of the indicator has the two issues addressed:
- The regression channel is calculated from the last bar shown on the chart and will adapt its position accordingly when you scoll back the chart horizontally.
- You may enter an offset and calculate the regression channel a few bars ago. The regression channel will then be extended until the last bar shown on the chart.
Repainting behavior: All regression channels - whether linear or polynomial - belong to the class of repainting indicators. All regression channels are retrofitted to the selected lookback period. The repainting can be easily observed with this indicator when scrolling horizontally. The indicator comes with an option to display the regression bands. The regression bands show the trace that the regression channel has painted on the chart without repainting any prior bars.
Public DataSeries: The indicator comes with four additional public DataSeries that can be accessed via the strategy builder.
- Normalized slope - This is an output which returns the slope in synthetic degrees. The slope has been normalized by dividing it by the square root of the average true range and then applying the arctangent.
- NormalizedChannelWidth - This series returns the normalized channel width around the regression line and may be used as a measure of non-directional volatility.
- RegressionTrend - The regression trend holds the value + 1 for an upsloping regression line and -1 for a downsloping regression line.
Market Analyzer Columns: The indicator comes with three separately coded market analyer columns which allow for displaying normalized slope, normalized channel width and the regression trend on the market analyzer.
The Trigger Lines indicator is composed of two lines. The leading line is a linear regression indicator (LinReg). The lagging line or signal line is an exponential moving average (EMA) of the leading line.
This indicator comes with two different options for identifying and uptrend or downtrend:
Trigger line cross: When the leading regression line crosses above the signal line, this is the beginning of an uptrend. Vice-versa the indicator signals a downtrend, as long as the leading line remains below the signal line.
Thrust bars: An uptrend is detected via an upthrust bar that closes and has a median above both trigger lines. A downtrend follows a downthrust bar that closes and has a median below both trigger lines.
The second trend definition adapts faster to changing market conditions, but also produces a higher number of false signals. The trend can be shown via paint bars. The indicator further comes with sound alerts that will signal a trend change.
This is the Belkhayate COG (Center of Gravity) indicator. Also known as a polynomial regression channel with 3 std deviations and many other names. I transported this code directly from here.
If anybody has any useful information regarding the usability of the indicator I'd appreciate the feedback. The fact that it repaints takes a lot away from it, but here it is in case someone has use for it!
This Indicator is the Raff Regression Channel or RRC. Some credit needs to be given to FatTails as I used his regression channel that painted bars as a starting point. You can find his code here:
This is a simple implementation of the trigger lines which can be used as a trend filter. The trigger lines are composed of a linear regression indicator (LinReg) and a signal line, which is calculated as the exponential moving average (EMA) of the linear regression line.
When the LinReg indicator crosses above the signal line, it is considered bullish, if it crosses below, it is considered bearish.
The indicator allows to select a color for bullish and bearish conditions and shades the area between the trigger lines.
Default values used for the periods are 80 for the LinReg indicator and 20 for the EMA.
Update January 13, 2011: Indicator speed improved.
Update August 25, 2012: Algorithm for draw area improved to work with COBC = false.
Update October 5, 2013: Indicator code modified to allow for correct coloring when the plot is shifted.
This indicator is an enhanced version of the NinjaTrader Regression Channel Indicator.
The indicator calculates the same values for the linear regression as the default NinjaTrader indicator does, but uses a modified Plot() method.
If you scroll the chart horizontally, this indicator will display the regression channel for the last bar painted on the chart, while the NinjaTrader indicator always displays the regression channel for the last bar of the data base.
To understand how it works, just put both indicators - the NinjaTrader default indicator and this indicator - on your chart and scroll horizontally, and you will notice the difference.
Update July 23, 2011: Indicator updated to work with non-equidistant bar spacing, as used by multi-series charts.
If somebody could improove it to become a Trigger line. Only the Exponential moving average have to be plot with the linreg line. It could be done with Costume moving average, which has the option (Previous indicators data). But it would be better if it would be coloured trigger line like in Ninjatrader.
The I-regr indicator also known as the Linear Regression Channel consists of two parallel lines, equidistant up and down from the line of linear regression trend. The distance between frame of the channel and regression line equals to the value of maximum close price deviation from the regression line.
If price is below the bottom line - BUY
If price is above the upper line - SELL
The middle line can be also used as the Take Profit area or Target Limit.
This indicator uses Linear Regression as main driver. It's based on a longer and shorter period LR used as a signal.
I find it most suitable for indicating when to add new contracts to already opened position or if you've missed trend break-out this can find you a nice entry.
Should you have market trending down, you enter when histogram reaches near 0 and you can either wait to change direction and go in the opposite direction or use some "fixed" near 0 detection method.
On the image you can see how nice have been identified places where to add to an existing position, or even enter market if not done so already.
Please check here for early trend change identification and how trading divergences possibilities.
Parameters:
- Adaptive period: you can select to use adaptive period proposed by John Ehlers for short period calculation
- Period multiplier: is to be used if you've selected adaptive period so from short period calculated will be derived long period value by multiplication
- Long LR period/Short LR period: are to be used as fixed values for Linear regression period
- Long/Short smoothing: is SMA smoothing applied to LinReg
Notes:
- Red/Green histograms are selected on Falling/Rising base respect to previous value.
- In debug mode you can see additional 2 lines plotted. Those are actual angle measure line for longer and shorter period LR.
April 4th, 2019 12:40 PM Maxie very helpful, thanks
August 3rd, 2018 05:09 PM Zephyr I'm a HUGE believer in the Polynomial Regression Channel. If it's coded correctly, it's highly predictive for support a
nd resistance. I use 2 of them on my charts. One is longer term (150 - 200 bars for daytrading), and one is short-term
(50 bars). I only use upper and lower lines. I use one at full range for the multiple time frames of swing trading.
The only one I've ever seen coded perfectly and correctly is the one made by Robert Payne at www.funwiththinkscript.com
- made for Thinkorswim.
Thank you very much for this. I will test it shortly.
July 8th, 2018 06:09 AM Ratdog INstant money maker when applied correctly.
May 27th, 2017 01:55 AM romus I am keen to see live results from trading it (about to test on some strategies in NT7) - even though it repaints, but a
s long as highs and lows stay within extremes the results should be as per backtesting.
It certainly is difficult to follow visually.
I am not into NT8 yet - but glad to see this indi is already converted