/+------------------------------------------------------------------+
//| my1ea.mq4 |
//| http://www.mt4ea,com |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2009, 柒侠伍义"
#property link "http://www.mt4ea,com"
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
if(
OrdersTotal()==0
&& Close[0]>Open[0]
){
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+TakeProfit*Point,"macd sample",16384,0,Green);
}
if(
OrdersTotal()==0
&& Close[0]<Open[0]
){
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,Bid-TakeProfit*Point,"macd sample",16384,0,Red);
}
//----
return(0);
}
//+------------------------------------------------------------------+
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,Bid-TakeProfit*Point,"macd sample",16384,0,Red);
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+TakeProfit*Point,"macd sample",16384,0,Green);
|