What was that old BASF commercial tag line? "We don't make the things you love, we make the things you love better." That's what I hope I accomplished with this little beauty. I took the original StochRSI and added some visual enhancements, then I added a second instance of it and made it my Trigger Line. I was very pleasantly surprised how darn well it worked for generating actionable signals.
Look at the screenshot. The green and red stars are the signals generated. Ok, 'so big deal' you say. And I'd say you're correct. As a stand-alone indicator, it's actually really good, but we want more than good. So the other line on the chart is my old reliable dpLRL (Linear Regression Line) indicator. So how to use them together? Wait for the StochRSI signal star to paint and then wait for the dpLRL's 'tab' (see arrows) to paint. When price closes on the far side of the line, consider the trade. Use the 'validation line extension' (those red and green horizontal thick line segments) to see if price is respecting the StochRSI's signal. If it is, even if it is a couple bars later, then consider entering at that point. Works on all bars and timeframes.
As always, feel free to give helpful feedback, positive or negative. It's the only way things get better.
This is my take on the linear regression line. I think I've made it a bit more useful, but you will be the judge of that. The plotted object 'line' has three parts: the linear regression line, the warning tab, and the shadow.
The actual linear regression line fills the area between the shadow or outside boundary lines. The 'tab' (see arrows in picture) is the linear regression line, but it's painted to reflect that price is closing in the opposite direction of the linear regression. In effect, this gives a 'heads-up!' warning that price is weakening in its trajectory. As you see in the picture, the tab appears when price is no longer in agreement with the direction of the LinReg. The shadow is simply the outside border of the full line. Change the color and/or thickness of it to better see the line on light or dark charts.
The indicator will load with a relatively thick line, but everything is is adjustable. The period is set to 50, but I use 25 on my charts. Again, you'll decide how you want to use it.
As always, Mr. Phelps, should you or any of your team be caught or killed, the secretary will disavow any knowlege of your actions.
Then again, you can always get me at [email protected].
Please leave a comment. It's the only way I know if anyone finds this stuff useful. Thank you.
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.
May 31st, 2025 04:05 PM BoltTrader Thank you! I look forward to experimenting with it!
February 8th, 2020 02:47 AM WTangoF
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.
February 26th, 2026 03:32 PM Shivaya This really looks like it will help in eliminating my getting in too early at tops and bottoms. Thanks. Well done!
February 12th, 2026 01:39 AM BoltTrader Thank you!