EN
Help Centre
Contact Us
Company Logo
Markets
MARKETS TO TRADE
  • All Markets
  • Forex
  • Commodities
  • Metals
  • Indices
  • Stocks
  • Cryptocurrency
  • ETF CFDs
  • Futures CFDs
  • Crosses CFDs
Trading
ACCOUNTS
  • Our Accounts
  • Standard
  • Micro
  • ECN
  • Pro ECN
  • Practice
PAMM
  • PAMM Trading
TRADING TERMS
  • Fees
  • Deposits & Withdrawals
  • Leverage & Margin
  • Dividends Calendar
  • Contract Specifications
Platforms
PLATFORMS
  • Our Platforms
  • Desktop
  • Trading App
  • MetaTrader 4
  • MetaTrader 5
Tools & Resources
TOOLS
  • Economic Calendar
  • Trading Schedule
  • Advanced Charts
NEWS & ARTICLES
  • Market Analysis
Loyalty & Promotions
REWARDS
  • Alpari Rewards
PROMOTIONS
  • Our Promotions
  • Refer a Friend
About
Why Alpari?
  • About Us

Linear Regression Indicator 

  1. Home
  2. Help & Support
  3. Linear Regression Indicator
*
Trading is risky. Your capital is at risk.

In this article, we will review the Linear Regression indicator, which displays the best-fit line through the last N bars based on their prices, such as close, high, or low. 

The Linear Regression indicator shows the linear regression of the last N bars, as a best-fit line through their close prices (or highs, or lows, etc.) You can add multiple copies of the indicator to a chart in order to show different regressions: for example, one indicator showing the linear regression of the highs and another showing the linear regression of the lows, forming a channel.  

You can also use the indicator to show the regression of prices on another timeframe, e.g. the linear regression of D1 close prices while viewing an H1 chart. 

How to install Linear Regression Indicator? 

To download and install the Pro Trading Tools, please follow these steps:  

1. Log in to Alpari profile > Hub > Pro Trading Tools 

2. Download FX Blue or Trading Central for your Platform (MetaTrader 4 or MetaTrader 5) 

3. Run the downloaded FX Blue and Trading Central files and apply them to your chosen MetaTrader Platform when prompted. 

4. Relaunch the MetaTrader platform. You’ll find your FX Blue* and Trading Central tools in the ‘Navigator panel under ‘Indicators’ and/or ‘Expert Advisors’. 

Note: FX Blue tools will appear in MetaTrader labeled as Alpari or Figaro app suite. 

Using the Linear Regression indicator 

Adding the indicator to a chart 

You add the Linear Regression indicator to a chart in the usual MT4 way, either by dragging it from the Navigator onto a chart or by double-clicking on it in the Navigator. You can also use standard MT4 features such as adding the indicator to your list of Favorites, or assigning a Hotkey to it. 

Choosing the number of bars, and the shift 

You use the Inputs tab to tell the indicator how many bars to include in the calculation (a minimum of 2). 

You can also set the bar-shift. The default value of 1 means “up to but not including the current bar”. A value of 0 would include the current bar, and the regression calculation would therefore change slightly on each tick. 

Extending the line to the current bar 

By default, the indicator will extend the regression line to the current bar. For example, with a bar-shift of 1, the calculation will not include the current bar, but the indicator will extend the drawing of the line into the current bar for comparative purposes. You can turn off this extension using the Inputs tab (and the setting is irrelevant if the bar-shift is zero). 

Price type 

You can use the Inputs tab to calculate the linear regression of different types of price: not just the close price, but also the high, low, open, median, typical, or weighted price. 

You can add multiple copies of the indicator to a chart to show different regressions: for example, one indicator showing the linear regression of the highs and another showing the linear regression of the lows, forming a channel. 

Timeframe 

By default, the indicator will use the timeframe of the current chart, and will change its calculation if you change the chart. However, you can use the Inputs tab to specify a different timeframe, e.g. showing the regression of D1 prices while viewing an H1 chart. 

Interpolation on higher timeframes 

When showing the regression from a higher timeframe on a lower timeframe chart (e.g. D1 versus H1), by default,t the indicator will show the same single value for each bar which makes up the higher timeframe. This creates a stepped line such as the following: 

 

You can use the Inputs tab to tell the indicator to interpolate values for each individual bar on the lower timeframe, creating a smoothed line. 

However, please note that the interpolation can create a “kink” in the line at the beginning of the current period. For example, if you are viewing the D1 regression on an H1 chart, and the current day is only 3 H1 bars old, then the values for the current day are interpolated over only 3 bars, whereas the values for all previous, full days are interpolated over 24-hourly bars. This creates the “kink”. 

Colours and line styles 

You can set the colour and style for the indicator’s line in the usual way, via the Colors tab.

Have more questions?

Call us on: +44 2045 771951 or engage with our chatbot.

Forex
Company Logo

Explore

  • Markets
  • Platforms

About

  • About Us

Support

  • Help Centre
  • Contact Us
  • Helpline: +44 2045 771 951
  • Bonovo Road, Fomboni, Island of Moheli, Comoros Union

Alpari, the trading name of Parlance Trading Ltd, Bonovo Road – Fomboni, Island of Mohéli – Comoros Union, is incorporated under registered number HY00423015 and licensed by the Mwali International Services Authority, Island of Mohéli as an International Brokerage and Clearing Company under number T2023236.

Risk Disclosure: Before trading, you should ensure that you've undergone sufficient preparation and fully understand the risks involved in margin trading.

Alpari does not provide services to residents of the USA, Japan, Canada, the Democratic Republic of Korea, European Union, United Kingdom, Myanmar, India, Azerbaijan, Syria, Sudan and Cuba.

© 1998-2025 Alpari

Privacy PolicyClient AgreementRisk DisclosureCookie PolicyTerms of BusinessRegulations for Non-Trading Operations
logo
We value your privacy
We use cookies to give you the best-possible experience on our site and serve you personalised content. Click "Sounds good" to agree to our Cookie Policy.
Sounds good