|
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Green
#property indicator_color2 Orange
#property indicator_color3 White
#property indicator_color4 White
//---- 自定义参量
//---- 自定义缓冲
double rhs[];
double rhx[];
double qds[];
double qdx[];
double rh1,rh2,rh3,rh4,rh5,rh6;
int t1,t2,t3,t4,t5,t6;
int init()
{
IndicatorBuffers(4);
//---- 画出设定
SetIndexShift(0,0);
SetIndexStyle(0,3,0,0,Green);
SetIndexArrow(0,241);
SetIndexBuffer(0,rhs);
SetIndexShift(1,0);
SetIndexStyle(1,3,0,0,Orange);
SetIndexArrow(1,242);
SetIndexBuffer(1,rhx);
SetIndexShift(2,0);
SetIndexStyle(2,3,0,3,White);
SetIndexArrow(2,241);
SetIndexBuffer(2,qds);
SetIndexShift(3,0);
SetIndexStyle(3,3,0,3,White);
SetIndexArrow(3,242);
SetIndexBuffer(3,qdx);
SetIndexDrawBegin(0,0);
SetIndexDrawBegin(1,0);
SetIndexDrawBegin(2,0);
SetIndexDrawBegin(3,0);
return(0);
}
int start()
{
int count=0;
int limit=Bars;
for(int i=limit-count-3;i>=1;i--)
{
if(High[i+1]>=High[i]&&High[i+1]>=High[i+2])
{count=limit-i;
rhs[i+1]=High[i+1];
t1=t3;
t3=t5;
t5=i+1;
rh1=rh3;
rh3=rh5;
rh5=High[i+1];
}
else
rhs[i]=0;
if(Low[i+1]<=Low[i]&&Low[i+2]>=Low[i+1])
{count=limit-i;
rhx[i+1]=Low[i+1];
t2=t4;
t4=t6;
t6=i+1;
rh2=rh4;
rh4=rh6;
rh6=Low[i+1];
}
else
rhx[i]=0;
if(rh2<=rh4&&rh3>=rh4&&rh5>=rh3&&rh6>=rh4&&t1>t2&&t2>t3&&t3>t4&&t4>t5&&t5>t6)
qds[t5]=rh5;
else
qds[t5]=0;
if(rh1>=rh3&&rh4<=rh3&&rh6<=rh4&&rh5<=rh3&&t2>t1&&t1>t4&&t4>t3&&t3>t6&&t6>t5)
qdx[t6]=rh6;
else
qdx[t6]=0;
if(qdx[t4]>0&&rh3>=rh5&&rh6<=qdx[t4]&&rh6<=rh5&&t4>t3&&t3>t6&&t6>t5)
qdx[t6]=rh6;
if(qds[3]>0&&rh5>=rh3&&rh6>=rh4&&rh3>=rh4&&rh6<=rh5&&t3>t4&&t4>t5&&t5>t6)
qds[t3]=rh3;
}
return(0);
} |
|