# 急!...我想了几天也没做出来,请高手指点一下!

20
2009.03.29 14:16

1630
2009.03.30 09:11

20
2009.03.30 12:29

int start()

{

int d=0;

double maCurrent=iMA(NULL,0,5,0,MODE_SMA,PRICE_LOW,0);

double ma1Previous=iMA(NULL,0,5,0,MODE_SMA,PRICE_LOW,4);

double ma2Previous=iMA(NULL,0,5,0,MODE_SMA,PRICE_LOW,9);

...............

for(int i=0;i<limit;i++)
{
if(maCurrent>ma1Previous && ma1Previous<ma2Previous)
{
d=ma1Previous ;
}

break;
}

20
2009.03.30 14:55

for(int i=0;i<limit;i++)
{
if(maCurrent>ma1Previous && ma1Previous<ma2Previous)
{
d=ma1Previous ;
break;
}

}

1630
2009.03.31 06:04

int d0=0,d1=0;

double dd0=0,dd1=0;

double maCurrent=iMA(NULL,0,5,0,MODE_SMA,PRICE_LOW,0);

double ma1Previous=iMA(NULL,0,5,0,MODE_SMA,PRICE_LOW,4);

double ma2Previous=iMA(NULL,0,5,0,MODE_SMA,PRICE_LOW,9);

...............

for(int i=0;i<limit;i++)
{

maCurrent=iMA(NULL,0,5,0,MODE_SMA,PRICE_LOW,i);

ma1Previous=iMA(NULL,0,5,0,MODE_SMA,PRICE_LOW,i+4);

ma2Previous=iMA(NULL,0,5,0,MODE_SMA,PRICE_LOW,i+9);

if(maCurrent>ma1Previous && ma1Previous<ma2Previous)
{
d0=i;

dd0=ma1Previous ;

break;

}

}

for(int i=d0+10;i<limit;i++)
{

maCurrent=iMA(NULL,0,5,0,MODE_SMA,PRICE_LOW,i);

ma1Previous=iMA(NULL,0,5,0,MODE_SMA,PRICE_LOW,i+4);

ma2Previous=iMA(NULL,0,5,0,MODE_SMA,PRICE_LOW,i+9);

if(maCurrent>ma1Previous && ma1Previous<ma2Previous)
{
d1=i;

dd1=ma1Previous ;

break;

}

}

20
2009.03.31 13:39

/