趋势判断的表达
Trendjudge(){
MqlTick MyTick;
int i =0;
double size =40*PriceLevelUnit();
double open =Close(1);
double high =High(1);
double low=Low(1);
int a =0;
int b =0;
int c =0;
int d =0;
int e =0;
int h =0;
int num=0;
for(i=1;i<52;i++)
{
if(high<High(i)) {high=High(i); a=i;}
if(low>Low(i)) {low =Low(i); b=i;}
if(high-low>size) return(0);
}
if(high-low<size)
{
while(Low(i)>low-(high-low)/3 && High(i)<high+(high-low)/3 ) { i=i+1; }
if(Low(i)<=low-(high-low)/3)
{
num=i;
while(High(i)<low+(high-low)/3){i=i-1;}
c=i;
i=num;
while(Low(i)>low-(high-low)-(high-low)/3 && High(i)<low+(high-low)/3) {i=i+1; d=d+1;}
if(c>d )
{
SymbolInfoTick(Symbol(),MyTick);
while(MyTick.ask>low && MyTick.ask>low+(high-low)/3)
{
Sleep(100);
SymbolInfoTick(Symbol(),MyTick);
}
if(MyTick.ask<=low+(high-low)/3)
{
higha=high;lowa=low;
return(1);
}
if(MyTick.ask>high+(high-low)/5)
{
return(0);
}
}
}
}
return(0);
}
页:
[1]