Indicators: Regression Analysis

 

Regression Analysis:

This indicator compares four types of regression (linear, quadratic, logarithmic and exponential) and chooses the one that best fits the data analyzed.

This analysis is done every time there is a new tick. In the left top corner of the chart four values are displayed. These values represent the dispersion of data regarding to its regression, so the smallest value indicates the best option. Additionally, the indicator allows recording these values into a text file for further analysis.

Author: barmenteros

Regression Analysis

Regression Analysis

 

One Question: How do I install the indicator ? (Get the values for the UpperBand and LowerBand)

double RegAna = iCustom(Symbol(), PERIOD_H1, "Regression_Analysis", 100,0,1.96,"On","OFF",PRICE_CLOSE, "UpperBand",0); ?  // This did not functioned

 

Very nice, thank you.  Better than Bollinger Bands.

 
24h-worker:

One Question: How do I install the indicator ? (Get the values for the UpperBand and LowerBand)

double RegAna = iCustom(Symbol(), PERIOD_H1, "Regression_Analysis", 100,0,1.96,"On","OFF",PRICE_CLOSE, "UpperBand",0); ?  // This did not functioned


Hi 24h-worker,

First of all thanks to Author: barmenteros for this regression indicator.

Here are the buffers for this indicator:

double         RegBfr[];           // Buffer 0
double         BandUpBfr[];     // Buffer 1
double         BandDwBfr[];    // Buffer 2

For your formulas -

1) Make sure the indicator name is spelled exactly the same as the indicator. You are missing the "b_" unless you renamed the indicator without it.
2) Match lower case spelling for "OFF" (use "Off")
3) Remove the PRICE_CLOSE that is not in the input settings
4) And change the word "UpperBand" to the buffer numbers you want.

Examples:

double RegUp     = iCustom(Symbol(), PERIOD_H1, "b_Regression_Analysis", 100,0,1.96,"On","Off", 1,0);   // Upper Band

double RegDown = iCustom(Symbol(), PERIOD_H1, "b_Regression_Analysis", 100,0,1.96,"On","Off", 2,0);   // Lower Band

Hopefully that should work for you.

Hope this helps,
Robert


 

Thanks Robert. I could not explain it better.

cosmicbeing:


Hi 24h-worker,

First of all thanks to Author: barmenteros for this regression indicator.

Here are the buffers for this indicator:

double         RegBfr[];           // Buffer 0
double         BandUpBfr[];     // Buffer 1
double         BandDwBfr[];    // Buffer 2

For your formulas -

1) Make sure the indicator name is spelled exactly the same as the indicator. You are missing the "b_" unless you renamed the indicator without it.
2) Match lower case spelling for "OFF" (use "Off")
3) Remove the PRICE_CLOSE that is not in the input settings
4) And change the word "UpperBand" to the buffer numbers you want.

Examples:

double RegUp     = iCustom(Symbol(), PERIOD_H1, "b_Regression_Analysis", 100,0,1.96,"On","Off", 1,0);   // Upper Band

double RegDown = iCustom(Symbol(), PERIOD_H1, "b_Regression_Analysis", 100,0,1.96,"On","Off", 2,0);   // Lower Band

Hopefully that should work for you.

Hope this helps,
Robert



 
Indicator does not compile on latest version of MT5.
 
Very nice, thank you. Better than Bollinger Bands.
Reason: