//+------------------------------------------------------------------+
//| test_robot.mq4 |
//| Copyright 2013, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
int ticket =0;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
double L_0 =iCustom(Symbol(),0,"Buy-Sell_Alerts_test",0,0);
double L_1 =iCustom(Symbol(),0,"Buy-Sell_Alerts_test",1,0);
//здесь условие для покупки
if (L_0>L_1)
{
//OrderClose(0,1,Bid,2);
ticket=OrderSend(Symbol(),OP_BUY,1,Ask,4,0,0);
}
//здесь условие для продажи
if (L_0<L_1)
{
// OrderClose(0,1,Bid,2);
ticket=OrderSend(Symbol(),OP_SELL,1,Bid,4,0,0);
}
//----
return(0);
}
//+------------------------------------------------------------------+