// 3 tapes LR indicator SIGNAL
//
// https://www.prorealcode.com/prorealtime-indicators/3-linear-regression-tapes-indicator/
//
// modified to return numeric values:
//
// 1 to 4 for LONG signals
// -1 to -4 for SHORT signals
//
periode1 = 10
periode2 = 14
periode3 = 30
Signal = 0
//___________________________________________
RLx1 = LinearRegression[periode1](close)
// Création du bandeau
If RLx1[0] > RLx1[1] then
Signal = Signal + 1
Elsif RLx1[0] < RLx1[1] then
Signal = Signal - 1
Endif
//____________________________________________
RLx2 = LinearRegression[periode2](close)
// Création du bandeau 2
If RLx2[0] > RLx2[1] then
Signal = Signal + 1
Elsif RLx2[0] < RLx2[1] then
Signal = Signal - 1
Endif
//____________________________________________
RLx3 = LinearRegression[periode3](close)
// Création du bandeau 3
If RLx3[0] > RLx3[1] then
Signal = Signal + 1
Elsif RLx3[0] < RLx3[1] then
Signal = Signal - 1
Endif
//____________________________________________
//Création du bandeau 4 qui ne sert qu'à obtenir une égale hauteur d'histogrammes pour les 3 courbes précédentes
RLx4 = LinearRegression[2](close)
If RLx4[0] > RLx4[1] then
Signal = Signal + 1
Elsif RLx4[0] < RLx4[1] then
Signal = Signal - 1
Endif
//____________________________________________
Return Signal AS "Signal"