← Назад к списку файлов

daydream01.mq4

Поиск по коду файла

#define MAGIC_NUM  48213657

extern double Lots      =1;
extern int ChannelPeriod=25;
extern int Slippage     =3;
extern int TakeProfit   =15;

double LastOrderTime=0;
double CurrentDirection=0;
double CurrentTakeProfitPrice=0;

void OpenLong()
  {
   if (Time[0]==LastOrderTime)
      return;
   if (CurrentDirection!=0)
      return;

   OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, 0, 0,
             "Daydream", MAGIC_NUM, 0, Blue);
   LastOrderTime=Time[0];
   CurrentDirection=1;
  }

void OpenShort()
  {
   if (Time[0]==LastOrderTime)
      return;
   if (CurrentDirection!=0)
      return;

   OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, 0, 0,
             "Daydream", MAGIC_NUM, 0, Red);
   LastOrderTime=Time[0];
   CurrentDirection=-1;
  }

void CloseLong()
  {
   int i;

   if (Time[0]==LastOrderTime)
      return;
   if (CurrentDirection!=1)
      return;

   for(i=0; i < OrdersTotal(); i++)
     {
      if (OrderSelect(i, SELECT_BY_POS) && OrderSymbol()==Symbol() &&
          OrderMagicNumber()==MAGIC_NUM && OrderType()==OP_BUY)
        {
         OrderClose(OrderTicket(), OrderLots(), Bid, 3, White);
         LastOrderTime=Time[0];
         CurrentDirection=0;
        }
     }
  }

void CloseShort()
  {
   int i;

   if (Time[0]==LastOrderTime)
      return;
  

Показано первые 50% кода (символов: 1900)

Как получить полную версию?

Введите ваш email и нажмите кнопку, чтобы перейти к оплате.