← К каталогу
Исходный код · ID 2814

grid-mod-3124 orders del.mq4

Вы автор или правообладатель?

Сообщите нам, если считаете, что материал размещён без разрешения.

Получить полный код

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

#property version   "1.00"
#property strict

input int    iTakeProfit    = 300;
input double iStartLots     = 0.01;
input double iMultipler     = 2;
input int    iOrderStep     = 390;
input int    iMinimalProfit = 50;
input int    iMagicNumber   = 227;
input int    iSlippage      = 30;

int total_old = -1;

int OnInit()
  {
      // код доступен только после оплаты
   }

void OnTick()
  {
      // код доступен только после оплаты
   }

   double BuyPriceMin = 0, BuyPriceMinLot = 0, SelPriceMax = 0, SelPriceMaxLot = 0;
   int    b = 0, s = 0;
   double BuyPriceSumm = 0, BuyLotsSumm = 0, SelPriceSumm = 0, SelLotsSumm = 0;

      for(int i = 0; i < OrdersTotal(); i++)
         if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == true)
            if(OrderMagicNumber() == iMagicNumber || iMagicNumber == -1)
               if(OrderSymbol() == _Symbol)
                 {
                  if(OrderType() == OP_BUY)
                    {
                     if(OrderOpenPrice() < BuyPriceMin || BuyPriceMin == 0)
                       {
                        BuyPriceMin    = OrderOpenPrice();
                        BuyPriceMinLot = OrderLots();
                       }
                     BuyPriceSumm += OrderOpenPrice() * OrderLots();
                     BuyLotsSumm  += OrderLots();
                     b++;
                    }
                  if(OrderType() == OP_SELL)
                    {
                     if(OrderOpenPrice() > SelPriceMax || SelPriceMax == 0)
                       {
                        SelPriceMax    = OrderOpenPrice();
                        SelPriceMaxLot = OrderLots();
                       }
                     SelPriceSumm += OrderOpenPrice() * OrderLots();
                     SelLotsSumm  += OrderLots();
                     s++;
                    }
                 }

      double BuyLots = 0, SelLots = 0;

      if(b == 0)
         BuyLots = iStartLots;
      else
         BuyLots = BuyPriceMinLot * iMultipler;

      if(s == 0)
         SelLots = iStartLots;
      else
         SelLots = SelPriceMaxLot * iMultipler;

      if(b == 0 || (b > 0 && (BuyPriceMin - Ask) >= iOrderStep * _Poin

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

Что вы получите после оплаты

На этой странице откроется полный исходный код файла вместо ознакомительного фрагмента.

Чтобы оформить заказ, введите email и перейдите к оплате.

Стоимость полного кода
249₽