鳄鱼线

extern double Lots  = 1;
extern double Stoploss =100;
extern double Takeprofit =10;
extern int Slippage = 30;
extern int MagicNum=8888;
static int RecordTime;
static bool done=false;
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
double a,b;
int i=0;
int j=0;

/*if(Time[0]!=RecordTime){
        RecordTime=Time[0];
        done=false;
    }*/

double up  =0;
double down=0;
while(up==0){
up=iFractals(NULL,0,MODE_UPPER,i);
a=up;
if(a!=0)
  Print("up=",a);
i++;
}
while(down==0){
down=iFractals(NULL,0,MODE_LOWER,j);
b=down;
if(b!=0)
  Print("down=",b);
j++;
}
    double CrocodileLine1 = iAlligator( NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORJAW  , 1) ;
    //鳄鱼蓝线(长线1)
    double CrocodileLine2 = iAlligator( NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORTEETH, 1) ;
    //鳄鱼红线(中线1)
    double CrocodileLine3 = iAlligator( NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORLIPS , 1) ;
    //鳄鱼绿线(短线1)
    double CrocodileLine4 = iAlligator( NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORJAW  , 2);
    //鳄鱼蓝线(长线2)
    double CrocodileLine5 = iAlligator( NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORTEETH, 2) ;
    //鳄鱼红线(中线2)
    double CrocodileLine6 = iAlligator( NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORLIPS , 2) ;
    //鳄鱼绿线(短线2)

if ( CrocodileLine1 > CrocodileLine4 && CrocodileLine2 > CrocodileLine5 && CrocodileLine3 > CrocodileLine6 
&& CrocodileLine3 > CrocodileLine2 && CrocodileLine2 > CrocodileLine1 && CrocodileLine6 > CrocodileLine5 
&& CrocodileLine5 > CrocodileLine4  && Close[0] > a )
   {
        OrderSend(Symbol(), OP_BUY, Lots, NormalizeDouble(Ask, Digits), 
            Slippage, Ask-Stoploss*Point, Ask+Takeprofit*Point, "Order Buy", MagicNum, 0, Red);
        
      //  done=true;
    }


if ( CrocodileLine1 < CrocodileLine4 && CrocodileLine2 < CrocodileLine5 && CrocodileLine3 < CrocodileLine6 
&& CrocodileLine3 < CrocodileLine2 && CrocodileLine2 < CrocodileLine1 && CrocodileLine6 < CrocodileLine5 
&& CrocodileLine5 < CrocodileLine4  && Close[0] < b )
   {
        
        OrderSend(Symbol(), OP_SELL, Lots, NormalizeDouble(Bid, Digits), 
            Slippage,  Bid+Stoploss*Point, Bid-Takeprofit*Point, "Order Sell", MagicNum, 0, Blue);  
              
     //   done=true;
    }  
//----
   return(0);
  }
本博客所有文章如无特别注明均为原创。作者:天泓评测
分享到:更多

相关推荐

发表评论

路人甲 表情
Ctrl+Enter快速提交

网友评论(0)