Linear Regression Slope Indicator - futures io
futures io futures trading



Linear Regression Slope Indicator


Discussion in TradeStation

Updated by Tripken
    1. trending_up 530 views
    2. thumb_up 4 thanks given
    3. group 2 followers
    1. forum 1 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Linear Regression Slope Indicator

(login for full post details)
  #1 (permalink)
Denton, TX
 
 
Posts: 19 since Jan 2020
Thanks: 12 given, 8 received

This is a nice lower study to be used along with R Squared. If you are using a dark color background chart, be sure to change the plot line colors for better visibility:


 
Code
Indicator: Lin Regression Slope
inputs:
Price ( Close ),
Length( 20 ),
UpLineColor( Green ),
DnLineColor( Red ) ;

variables:
LRS( 0 ) ;

LRS = LinearRegSlope( Price, Length ) ;
Plot1( LRS, "LRS" ) ;

if LRS > 0 then
SetPlotColor( 1, UpLineColor )
else
SetPlotColor( 1, DnLineColor ) ;

Indicator: RSquared
inputs:
Price( Close ),
LinearRegLength( 20 ),
RSquaredLength( 20 ),
Threshold( 0.2 ),
AlertBarLength( 1 ),
ChartRSquaredColor( Yellow ),
ChartThreshLineColor( Red ),
RadarAlertBGColor( Red ),
RadarAlertTextColor( Black ),
RadarNoAlertBGColor( Black ) ,
RadarNoAlertTextColor( White ) ;

variables:
ApplicationType( 0 ),
AlertBarNum( 0 ),
LinRegVal( 0 ),
RSquared( 0 ) ;

if CurrentBar = 1 then
ApplicationType = GetAppInfo( aiApplicationType ) ;

LinRegVal = LinearRegValue( Price, LinearRegLength,0 ) ;
RSquared = RSquare( Price, LinRegVal, RSquaredLength ) ;

Plot1( Threshold, "R^2Trig" ) ;
Plot2( RSquared, "R^2" ) ;

if RSquared crosses over Threshold then
AlertBarNum = CurrentBar ;

if ApplicationType = cRadarScreen then
begin
if CurrentBar < AlertBarNum + AlertBarLength then
begin
SetPlotBGColor( 2, RadarAlertBGColor ) ;
SetPlotColor ( 2, RadarAlertTextColor ) ;
Alert( "RSquared crossing up through " + "threshold level." ) ;
end
else
begin
SetPlotBGColor( 2, RadarNoAlertBGColor ) ;
SetPlotColor ( 2, RadarNoAlertTextColor ) ;
end ;
end
else
begin
SetPlotColor( 1, ChartThreshLineColor ) ;
SetPlotColor( 2, ChartRSquaredColor ) ;
end ;

Reply With Quote
The following 4 users say Thank You to madeinnyc for this post:

Can you help answer these questions
from other members on futures io?
DLL with webrequest function for MC
MultiCharts
Stacked Imbalances.
Sierra Chart
EQIX - Digital REITs - any experiences?
Stocks and ETFs
T​​​​​​radestation datafeed (real time and historical) to NT8
NinjaTrader
IB Bracker Order
Platforms and Indicators
 
 
(login for full post details)
  #2 (permalink)
Market Wizard
Knoxville, TN/USA
 
Experience: Beginner
Platform: TradeStation
Broker: TradeStation
Trading: ES
 
Tripken's Avatar
 
Posts: 555 since Feb 2010
Thanks: 1,279 given, 1,159 received

Curious what your indicator does, could you post a screenshot of a chart?

I use an indi called linear regression High/Low on TS.

Thanks.

Reply With Quote


futures io Trading Community Platforms and Indicators TradeStation > Linear Regression Slope Indicator


July 5, 2020


Upcoming Webinars and Events
     



Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts