Indicators: Linear Regression calculation based on pine script v4

 

Linear Regression calculation based on pine script v4:

This is the exact conversion of linreg function from pine script v4 as an mql5 indicator.

Linear Regression calculation based on pine script v4

Author: Yashar Seyyedin

 
Can I find " Polynomial regression" in the same way do you have it?
 
swaruppatil #:
Polynomial regression

Not now. But I add it to my to-do list.

 
swaruppatil #:
Can I find " Polynomial regression" in the same way do you have it?

Have you searched Codebase? There are plenty of them already there.

 
that is useful code. is it better to pass an array for input and another one as out put? your code is ok and useful. just to develop it. better to have as an array because we normally use these functions over an array. If we call them in a loop it will be a waste of time and makes code slow. inside of function it is easy to repeat code for like N times and N is size of input array as source of data. src[]
 
Mahdi Ebrahimzadeh #:
that is useful code. is it better to pass an array for input and another one as out put? your code is ok and useful. just to develop it. better to have as an array because we normally use these functions over an array. If we call them in a loop it will be a waste of time and makes code slow. inside of function it is easy to repeat code for like N times and N is size of input array as source of data. src[]

Thanks Mahdi. I appreciate your motivation. I modified per your suggestion. I hope this meets what you expect else I am ready to hear from you.

 
Charts on Tradingview and MT5 look so different for same timeframe and date range.....Do you want to relook at MQL5 code?
Files:
MT5.png  75 kb
TV.png  128 kb
 
seankach #:
Charts on Tradingview and MT5 look so different for same timeframe and date range.....Do you want to relook at MQL5 code?

Obviously you are applying it to two different data sources.

Reason: