extern double lots = 1.0;
extern double sl =55;
extern double tp =55;
extern double trailing =20;
extern int MaxOrder =4;
int start()
{
if(OrdersTotal()<MaxOrder)
{
double var1 = 0.00025;
double var2 = 0.00010;
double ma1 =iMA(NULL,0,15,0,MODE_SMMA,PRICE_MEDIAN,0);
double ma2 =iMA(NULL,0,25,0,MODE_SMMA,PRICE_MEDIAN,0);
double min = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0);
double sig = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0);
if ((ma2-var2>=ma1))
{
if ((sig-var1)>=min)
{OrderSend(Symbol(),OP_SELL,lots,Bid,3,Bid+Point*sl,Bid-Point*tp,"EA Creator",123,0,Red); }
}
if ((ma2+var2<=ma1))
{
if ((sig+var1)<=min)
{OrderSend(Symbol(),OP_BUY,lots,Ask,3,Ask-Point*sl,Ask+Point*tp,"EA Creator",123,0,Green);}
}
}
return(0) ;
}