//+------------------------------------------------------------------+
//| firstea.mq4 |
//| Copyright © 2009, MetaQuotes Software Corp. |
//|
http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, MetaQuotes Software Corp."
#property link "
http://www.metaquotes.net"
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
double ma10 , ma15 ,ma20 ,ma50 ;
int total;
int ticket;
ma10=iMA(NULL,0,10,0,MODE_SMMA,PRICE_MEDIAN,0);
ma15=iMA(NULL,0,15,0,MODE_SMMA,PRICE_MEDIAN,0);
ma20=iMA(NULL,0,20,0,MODE_SMMA,PRICE_MEDIAN,0);
ma50=iMA(NULL,0,50,0,MODE_SMMA,PRICE_MEDIAN,0);
total=OrdersTotal();
if(total<1)
{
if((ma20>ma50)==(Ask>=ma10>ma15))
{
if(ma10>ma15)
{
ticket=OrderSend(Symbol(),OP_BUY,0.5,Ask,3,Bid-Point*50,Ask+Point*50,"firstea",0,0,Green);
OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES);
}
return (0);
}
if((ma50>ma20)==(ma15>ma10>=Bid))
{
ticket=OrderSend(Symbol(),OP_SELL,0.5,Bid,3,Ask+Point*50,Bid-Point*50,"firstea",0,0,Red);
OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES);
}
}
return(0);
}
//+------------------------------------------------------------------+