3X_ParabolicRegression Indicator For MT5
3X_ParabolicRegression Indicator For MT5 vẽ một kênh tuyến tính và kênh đường cong cung cấp thông tin quan trọng để giao dịch thị trường. Kênh tuyến tính được vẽ dựa trên xu hướng trong quá khứ và kênh đường cong được vẽ dựa trên xu hướng thị trường mới được hình thành. Dải trên của kênh đóng vai trò là mức kháng cự và dải dưới đóng vai trò là vùng hỗ trợ quan trọng. Bạn nên tìm kiếm các tín hiệu hành động giá tăng ở dải dưới để cải thiện quá trình thực hiện giao dịch của bạn. Và khi giá chạm vào dải trên, hãy tìm các tín hiệu hành động giá giảm để kiếm lợi nhuận bằng cách đi theo xu hướng giảm. Khi bạn học cách đối phó với những người độc thân hành động giá, bạn thậm chí có thể giao dịch đảo ngược chính bằng cách sử dụng chỉ báo hồi quy parabol. Và hãy chắc chắn rằng bạn chỉ sử dụng công cụ này để phân tích khung thời gian hàng ngày vì dữ liệu khung thời gian thấp hơn không hoàn toàn chính xác.
Cài đặt 3X_ParabolicRegression Indicator For MT5
Sau khi bạn tải xuống chỉ báo qua biểu mẫu ở trên, bạn cần giải nén tệp zip. Sau đó, bạn cần sao chép tệp 3x_parabolicregression.mq5 vào thư mục MQL5Indicators cài đặt MT5 của bạn. Sau đó, vui lòng khởi động lại MT5 và sau đó bạn sẽ có thể thấy chỉ báo trong danh sách các chỉ báo.
Các tham số của 3X_ParabolicRegression Indicator For MT5
3X_ParabolicRegression Indicator For MT5 có các tham số 14 để cấu hình.
input uint RegressionDegree_=5;
input double KNL_Dev=2.72;
input color RegressionColor1 = SpringGreen; // Regression color 1
input color RegressionColor2 = Red; // Regression color 2
input color RegressionColor3 = BlueViolet; // Regression color 3
input color RegressionColor4 = Magenta; // Regression color 4
input STYLE linesStyle=DASH_; // Lines style
input WIDTH linesWidth=Width_1; // Lines width
input color channelColor1=Blue; // Channel color 1
input STYLE channelStyle1=DASH_; // Channel style 1
input WIDTH channelWidth1=Width_1; // Channel lines width 1
input color channelColor2=Gold; // Channel color 2
input STYLE channelStyle2=SOLID_; // Channel style 2
input WIDTH channelWidth2=Width_1; // Channel lines width 2
Bộ đệm của 3X_ParabolicRegression Indicator For MT5
3X_ParabolicRegression Indicator For MT5 cung cấp bộ đệm 0 .
Các bộ phận chính của bộ luật
int OnCalculate(const int rates_total, // number of bars in history at the current tick
const int prev_calculated,// amount of history in bars at the previous tick
const datetime &Time[],
const double &Open[],
const double& high[], // price array of maximums of price for the calculation of indicator
const double& low[], // price array of minimums of price for the calculation of indicator
const double &Close[],
const long &Tick_volume[],
const long &Volume[],
const int &Spread[])
{
//----
if(rates_total lt p+1) return(0);
if(rates_total==prev_calculated) return(rates_total);
//---- indexing elements in arrays as time series
ArraySetAsSeries(Time,true);
ArraySetAsSeries(Close,true);
for(int j=p; j gt =-p/2; j--)
{
string sJ=str+")"+string(j);
ObjectDelete(0,"_ar("+sJ);
ObjectDelete(0,"_arH("+sJ);
ObjectDelete(0,"_arL("+sJ);
}
if(!init(rates_total,Time)) return(0);
//----
ObjectMove(0,"LR1",0,Time[p1],0);
ObjectMove(0,"LR1",1,Time[1],0);
if(p2)
{
ObjectMove(0,"LR2",0,Time[p2],0);
ObjectMove(0,"LR2",1,Time[1],0);
}
//----
int i,j,n,k;
//----
if(i0n!=i0 || ipn!=ip)
{
p=ip-i0;
i0n=ip;
ipn=ip;
if(pn lt p)
{
for(j=pn; j lt =p; j++)
{
string sJ=str+")"+string(j);
ObjectCreate(0,"_ar("+sJ,OBJ_TREND,0,Time[i0+1+j],0,Time[i0+j],0);
ObjectSetInteger(0,"_ar("+sJ,OBJPROP_RAY,false);
ObjectSetInteger(0,"_ar("+sJ,OBJPROP_STYLE,linesStyle);
ObjectSetInteger(0,"_ar("+sJ,OBJPROP_WIDTH,linesWidth);
ObjectCreate(0,"_arH("+sJ,OBJ_TREND,0,Time[i0+1+j],0,Time[i0+j],0);
ObjectSetInteger(0,"_arH("+sJ,OBJPROP_RAY,false);
ObjectSetInteger(0,"_arH("+sJ,OBJPROP_STYLE,linesStyle);
ObjectSetInteger(0,"_arH("+sJ,OBJPROP_WIDTH,linesWidth);
ObjectCreate(0,"_arL("+sJ,OBJ_TREND,0,Time[i0+1+j],0,Time[i0+j],0);
ObjectSetInteger(0,"_arL("+sJ,OBJPROP_RAY,false);
ObjectSetInteger(0,"_arL("+sJ,OBJPROP_STYLE,linesStyle);
ObjectSetInteger(0,"_arL("+sJ,OBJPROP_WIDTH,linesWidth);
}
for(j=-pn/2; j gt =-p/2; j--)
{
string sJ=str+")"+string(j);
ObjectCreate(0,"_ar("+sJ,OBJ_TREND,0,Time[i0+1+j],0,Time[i0+j],0);
ObjectSetInteger(0,"_ar("+sJ,OBJPROP_RAY,false);
ObjectSetInteger(0,"_ar("+sJ,OBJPROP_STYLE,linesStyle);
ObjectSetInteger(0,"_ar("+sJ,OBJPROP_WIDTH,linesWidth);
ObjectCreate(0,"_arH("+sJ,OBJ_TREND,0,Time[i0+1+j],0,Time[i0+j],0);
ObjectSetInteger(0,"_arH("+sJ,OBJPROP_RAY,false);
ObjectSetInteger(0,"_arH("+sJ,OBJPROP_STYLE,linesStyle);
ObjectSetInteger(0,"_arH("+sJ,OBJPROP_WIDTH,linesWidth);
ObjectCreate(0,"_arL("+sJ,OBJ_TREND,0,Time[i0+1+j],0,Time[i0+j],0);
ObjectSetInteger(0,"_arL("+sJ,OBJPROP_RAY,false);
ObjectSetInteger(0,"_arL("+sJ,OBJPROP_STYLE,linesStyle);
ObjectSetInteger(0,"_arL("+sJ,OBJPROP_WIDTH,linesWidth);
}
pn=p;
}
if(pn gt p)
{
for(j=pn; j gt =p; j--)
{
string sJ=str+")"+string(j);
ObjectDelete(0,"_ar("+sJ);
ObjectDelete(0,"_arH("+sJ);
ObjectDelete(0,"_arL("+sJ);
}
for(j=-p/2; j gt =-pn/2; j--)
{
string sJ=str+")"+string(j);
ObjectDelete(0,"_ar("+sJ);
ObjectDelete(0,"_arH("+sJ);
ObjectDelete(0,"_arL("+sJ);
}
pn=p;
}
}
//---- PR
sx[1]=p+1;
//---- sx
for(i=1; i lt =nn*2-2; i++)
{
sum=0.0;
for(n=i0; n lt =i0+p; n++) sum+=MathPow(n,i);
sx[i+1]=sum;
}
//---- syx
for(i=1; i lt =nn; i++)
{
sum=0.0;
for(n=i0; n lt =i0+p; n++)
{
if(i==1) sum+=Close[n];
else
sum+=Close[n]*MathPow(n,i-1);
}
b[i]=sum;
}
//---- Matrix
for(j=1; j lt =nn; j++) for(i=1; i lt =nn; i++) {k=i+j-1; a[i][j]=sx[k];}
//---- Gauss
af_Gauss(nn);
//---- SQ
sq=0.0;
for(n=p; n gt =0; n--)
{
sum=0.0;
for(k=1; k lt =RegressionDegree; k++)
{
sum+=x[k+1]*MathPow(i0+n,k);
sum1+=x[k+1]*MathPow(i0+n+1,k);
}
fx=x[1]+sum;
sq+=MathPow(Close[n+i0]-fx,2);
}
sq=KNL_Dev*MathSqrt(sq/(p+1));
//----
for(n=p; n gt =-p/2; n--)
{
sum=0.0;
sum1=0.0;
string sN=str+")"+string(n);
for(k=1; k lt =RegressionDegree; k++)
{
sum+=x[k+1]*MathPow(i0+n,k);
sum1+=x[k+1]*MathPow(i0+n+1,k);
}
fx=x[1]+sum;
fx1=x[1]+sum1;
if(n gt =0 && n lt p)
{
ObjectMove(0,"_ar("+sN,0,Time[n+i0+1],fx1);
ObjectMove(0,"_ar("+sN,1,Time[n+i0],fx);
ObjectMove(0,"_arH("+sN,0,Time[n+i0+1],fx1+sq);
ObjectMove(0,"_arH("+sN,1,Time[n+i0],fx+sq);
ObjectMove(0,"_arL("+sN,0,Time[n+i0+1],fx1-sq);
ObjectMove(0,"_arL("+sN,1,Time[n+i0],fx-sq);
if(fx gt fx1)
{
ObjectSetInteger(0,"_ar("+sN,OBJPROP_COLOR,RegressionColor1);
ObjectSetInteger(0,"_arH("+sN,OBJPROP_COLOR,RegressionColor1);
ObjectSetInteger(0,"_arL("+sN,OBJPROP_COLOR,RegressionColor1);
}
if(fx lt fx1)
{
ObjectSetInteger(0,"_ar("+sN,OBJPROP_COLOR,RegressionColor2);
ObjectSetInteger(0,"_arH("+sN,OBJPROP_COLOR,RegressionColor2);
ObjectSetInteger(0,"_arL("+sN,OBJPROP_COLOR,RegressionColor2);
}
}
if(n lt 0)
{
if((n+i0) gt =0)
{
ObjectMove(0,"_ar("+sN,0,Time[n+i0+1],fx1);
ObjectMove(0,"_ar("+sN,1,Time[n+i0],fx);
ObjectMove(0,"_arH("+sN,0,Time[n+i0+1],fx1+sq);
ObjectMove(0,"_arH("+sN,1,Time[n+i0],fx+sq);
ObjectMove(0,"_arL("+sN,0,Time[n+i0+1],fx1-sq);
ObjectMove(0,"_arL("+sN,1,Time[n+i0],fx-sq);
}
if((n+i0) lt 0)
{
te=Time[0]-(n+i0)*kt;
te1=Time[0]-(n+i0+1)*kt;
ObjectMove(0,"_ar("+sN,0,te1,fx1);
ObjectMove(0,"_ar("+sN,1,te,fx);
ObjectMove(0,"_arH("+sN,0,te1,fx1+sq);
ObjectMove(0,"_arH("+sN,1,te,fx+sq);
ObjectMove(0,"_arL("+sN,0,te1,fx1-sq);
ObjectMove(0,"_arL("+sN,1,te,fx-sq);
}
if(fx gt fx1)
{
ObjectSetInteger(0,"_ar("+sN,OBJPROP_COLOR,RegressionColor3);
ObjectSetInteger(0,"_arH("+sN,OBJPROP_COLOR,RegressionColor3);
ObjectSetInteger(0,"_arL("+sN,OBJPROP_COLOR,RegressionColor3);
}
if(fx lt fx1)
{
ObjectSetInteger(0,"_ar("+sN,OBJPROP_COLOR,RegressionColor4);
ObjectSetInteger(0,"_arH("+sN,OBJPROP_COLOR,RegressionColor4);
ObjectSetInteger(0,"_arL("+sN,OBJPROP_COLOR,RegressionColor4);
}
}
}
//----
ChartRedraw(0);
//----
return(rates_total);
}
//+------------------------------------------------------------------+
//| Custom indicator af_Gauss function |
//+------------------------------------------------------------------+
void af_Gauss(int n)
{
//----
int i,j,k,l;
double q,m,t;
for(k=1; k lt =n-1; k++)
{
l=0;
m=0;
for(i=k; i lt =n; i++)
{
if(MathAbs(a[i][k]) gt m) {m=MathAbs(a[i][k]); l=i;}
}
if(l==0) return;
if(l!=k)
{
for(j=1; j lt =n; j++)
{
t=a[k][j];
a[k][j]=a[l][j];
a[l][j]=t;
}
t=b[k];
b[k]=b[l];
b[l]=t;
}
for(i=k+1;i lt =n;i++)
{
q=a[i][k]/a[k][k];
for(j=1;j lt =n;j++)
{
if(j==k) a[i][j]=0;
else
a[i][j]=a[i][j]-q*a[k][j];
}
b[i]=b[i]-q*b[k];
}
}
x[n]=b[n]/a[n][n];
for(i=n-1;i gt =1;i--)
{
t=0;
for(j=1;j lt =n-i;j++)
{
t=t+a[i][i+j]*x[i+j];
x[i]=(1/a[i][i])*(b[i]-t);
}
}
//----
}
//+------------------------------------------------------------------+