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

ringer clone.mq4

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

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

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

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

#property version "1.00"

#property strict

const int ADMIN_ID=16; //моя панель
const int PRODUCT_ID=28;//RingerMT4
const string VERSION="1.00";

#include <sovetnikovNET/Time.mqh>
#include <EA_Protect\Protect.mqh>

enum ANSWER
  {
   ANSWER_NO = 0, // Нет
   ANSWER_YES = 1 // Да
  };

SHOW_LICENSE_PARAMS

input bool Dry=false; //Сушка
input ANSWER Broker = ANSWER_NO; //Брокер 4-знака
sinput string _1="====";//=================================================
input double TakeProfit = 30; //Take profit
input double StopLosse = 253; //Stop Loss
input int NoLossePrf = 10; //Перевод в БУ при профите
input int NoLosseSL = 7; //SL при БУ
sinput string _2="====";//=================================================
input double Fixedlot = 0.00; //Стартовый размер лота
input double RiskLot=0.05; //Автоматический лот (работает если стартовый лот 0)
input double MartinKoef = 1.5; //Коэфициент мартина
sinput string _3="====";//=================================================
input double Distance = 21.0; //Дистанция позиций усреднения
input int MaxPosUsr = 12; //Максимальное количество усреднений
input double DistanceKoef = 1.0; //Коэфициент дистанции усреднения
sinput string _4="====";//=================================================
input int maPeriod = 20; //Период MA
input int PeriodStochK = 10; //Период стохастика K
input int PeriodStochD = 3;//Период стохастика D
input int SlowStoch = 3;//Замедление стохастика
sinput string _5="====";//=================================================
input int NoNewPosDrawdown=75;//Остановка торговли при просадке по счёту [%]
input int NoNewPosMargin=700;//Остановка торговли при свободной марже меньше чем [%]
sinput string _6="====";//=================================================
input int NoOpenCucleDD=7;//Не начинать новую сетку при просадке по счёту [%]
input int NoOpenCucleMarg=4000; //Не начинаь новую сетку при свободной маржке меньше чем [%]

int iMagic7786 = 7786;
int iMagic7876 = 7876;
int iMagic8776 = 8776;
int iMagic17776 = 17776;

int Gi_4;
int Gi_6;
int Gi_7;

bool bret;

int Gi_C;
int Gi_D;
int Gi_E;
int Gi_10;
int Gi_11;
int Gi_14;
int Gi_15;
int Gi_1;

int Gi_2;
int Gi_3;
double Gd_0;
int Gi_0;
int Gi_5;
int Gi_B;

double Gd_1;
bool Gb_0;
int Gi_A;
int Gi_F;

int Gi_12;
int Gi_13;
double Gd_15;
double Gd_16;
int Gi_17;
double Gd_17;

int Gi_19;
bool Gb_19;

int Gi_1B;
int Gi_1C;
int Gi_1D;
int Gi_1E;
int Gi_1F;
int Gi_20;
int Gi_21;
int Gi_22;
int Gi_23;
double Gd_23;
int Gi_25;
double Gd_25;

double Gd_26;
int Gi_27;
int Gi_28;
int Gi_29;
int Gi_2A;
int Gi_2B;
int Gi_2C;
int Gi_2D;
int Gi_2E;
int Gi_2F;

double Gd_2F;
bool Gb_33;

bool Gb_34;
double Gd_3;
double Gd_8;
double Gd_19;
double Gd_1B;
int Gi_24;

double Gd_2;
bool Gb_2;
bool Gb_4;
double Gd_4;
double Gd_5;
bool Gb_6;
double Gd_6;
double Gd_7;
double Gd_9;
bool Gb_A;

double Gd_D;
double Gd_E;
bool Gb_10;
double Gd_10;
double Gd_11;
double Gd_14;
bool Gb_16;
int Gi_18;
double Gd_1A;

bool Gb_1C;
double Gd_1C;
double Gd_1D;
double Gd_20;
bool Gb_22;
bool Gb_28;
double Gd_28;
double Gd_29;
double Gd_2C;
bool Gb_2E;

bool checkEntry2(bool a1, bool a2, int a3, int a4)
  {
   return !a1 && a2 && !a3 && a4 == 2;
  }

bool checkEntry1(bool a1, bool a2, int a3, int a4)
  {
   return !a1 && a2 && !a3 && a4 == -2;
  }

double getTakeProfit(int a1, int a2, double a3, double a4)
  {
   double result; // fst7
   double v5; // [esp+18h] [ebp+18h]

   if(a2==0.0)
      return 0.0;

   v5 = (double)a2 *a4;
   if(a1==OP_BUY)
      result = a3 + v5;
   else
      result = a3 - v5;

   return result;
  }

int getEntryConfirmation(double a1, double a2, double a3, double a4, int a5)
  {
   if(a5 != 1)
     {
      if(a5 != -1)
         return 0;

      if(a3 <= 50)
        {
         return -2;
        }

      return 2;
     }

   if(a2 > a1 && a3 > 50)
      return 2;

   if(a1 <= a2)
      return 0;

   if(a4 <50)
     {

      return -2;
     }

   return 0;
  }

class GridSettings
  {
public:
   int               m_Digits;
   int               m_iMagic8776;
   int               m_iMagic7786;
   int               m_iMagic17776;
   int               m_iMagic7876;
   int               m_Level_Max;
   int               PeriodStochD;
   int               PeriodStochK;
   int               m_MA_Period;
   int               SlowStoch;
   int               dMinTral;
   int               dTrailingStop;
   double            m_LotMultiplicator;
   double            m_Step;
   double            m_StepMultiplicator;
   double            m_FixedLot;
   double            dStopLoss;
   double            dTakeProfit;
   string            sSymbol;
  };

class GridProperties : public GridSettings
  {
public:
   double            dBalance;
   double            dMaxLot;
   double            dTickSize;
   int               iLastTicket;
  };

class RingGrid
  {
public:

                     RingGrid(GridProperties& arg_0)
     {
      double Ld_0;
      Ld_0 = 0;
      this.eGridProperties.m_Digits = arg_0.m_Digits;
      this.eGridProperties.m_iMagic8776 = arg_0.m_iMagic8776;
      this.eGridProperties.m_iMagic7786 = arg_0.m_iMagic7786;
      this.eGridProperties.m_iMagic17776 = arg_0.m_iMagic17776;
      this.eGridProperties.m_iMagic7876 = arg_0.m_iMagic7876;
      this.eGridProperties.m_LotMultiplicator = arg_0.m_LotMultiplicator;
      this.eGridProperties.m_Level_Max = arg_0.m_Level_Max;
      this.eGridProperties.PeriodStochD = arg_0.PeriodStochD;
      this.eGridProperties.PeriodStochK = arg_0.PeriodStochK;
      this.eGridProperties.m_MA_Period = arg_0.m_MA_Period;
      this.eGridProperties.SlowStoch = arg_0.SlowStoch;
      this.eGridProperties.m_Step = arg_0.m_Step;
      this.eGridProperties.m_StepMultiplicator = arg_0.m_StepMultiplicator;
      this.eGridProperties.m_FixedLot = arg_0.m_FixedLot;
      this.eGridProperties.dMinTral = arg_0.dMinTral;
      this.eGridProperties.dStopLoss = arg_0.dStopLoss;
      this.eGridProperties.sSymbol = arg_0.sSymbol;
      this.eGridProperties.dTakeProfit = arg_0.dTakeProfit;
      this.eGridProperties.dTrailingStop = arg_0.dTrailingStop;
      this.eGridProperties.dBalance = AccountBalance();
      this.eGridProperties.iLastTicket = 0;
      Gd_0 = MarketInfo(this.eGridProperties.sSymbol, MODE_MAXLOT);
      Gd_1 = MarketInfo(this.eGridProperties.sSymbol, MODE_MINLOT);
      Gd_2 = MarketInfo(this.eGridProperties.sSymbol, MODE_LOTSTEP);
      Gd_3 = (int)(this.eGridProperties.m_FixedLot / Gd_2);
      Gd_3 = (double)(Gd_2 * NormalizeDouble(Gd_3, 0));

      if(Gd_3==0.0)
         Gd_3=GetAutoLot();

      Gd_4 = Gd_1;
      Gd_5 = Gd_0;
      if(Gd_0 >= Gd_3)
        {
         Gd_3 = Gd_3;
        }
      else
        {
         Gd_3 = Gd_5;
        }
      if(Gd_3 <= Gd_4)
        {
         Gd_5 = Gd_4;
        }
      else
        {
         Gd_5 = Gd_3;
        }
      this.eGridProperties.dMaxLot = Gd_5;

      this.eGridProperties.dTickSize = MarketInfo(this.eGridProperties.sSymbol, MODE_TICKSIZE);
      if(this.eGridProperties.m_Digits == 5)
        {
         this.eGridProperties.dTickSize = (this.eGridProperties.dTickSize * 10);
         Ld_0 = (MarketInfo(this.eGridProperties.sSymbol, MODE_STOPLEVEL) / 10);
        }
      else
        {
         if(this.eGridProperties.m_Digits == 4)
           {
            Ld_0 = MarketInfo(this.eGridProperties.sSymbol, MODE_STOPLEVEL);
           }
        }
      if(this.eGridProperties.dStopLoss > 0)
        {
         if(this.eGridProperties.dStopLoss < Ld_0)
           {
            Print("stoploss is too tight.");
            this.eGridProperties.dStopLoss = Ld_0;
           }
        }
      if(this.eGridProperties.dTakeProfit > 0)
        {
         if(this.eGridProperties.dTakeProfit < Ld_0)
           {
            Print("takeprofit is too tight.");
            this.eGridProperties.dTakeProfit = Ld_0;
           }
        }
      if(this.eGridProperties.dTrailingStop < Ld_0)
        {
         Print("trailing is too tight.");
         this.eGridProperties.dTrailingStop = (int)Ld_0;
        }
     }

   void              Run(bool bNoStop,bool bNoDry)
     {
      string str_0;
      string str_1;
      string sSymbol;
      string sVariableText;
      string str_4;
      string str_5;
      string str_6;
      string str_7;
      string str_8;
      string str_9;
      string str_A;
      string str_B;
      string str_C;
      string str_D;
      string str_E;
      string str_F;

      str_0 = "BUY TREND-Lvl-";
      if(bNoStop)
         AverageOrders(this.eGridProperties.m_iMagic7786, str_0);
      str_1 = "SELL TREND-Lvl-";
      if(bNoStop)
         AverageOrders(this.eGridProperties.m_iMagic7876, str_1);
      sSymbol = "BUY COUNTER-Lvl-";
      if(bNoStop)
         AverageOrders(this.eGridProperties.m_iMagic8776, sSymbol);
      sVariableText = "SELL COUNTER-Lvl-";
      if(bNoStop)
         AverageOrders(this.eGridProperties.m_iMagic17776, sVariableText);

      Gi_0 = this.eGridProperties.m_iMagic7786;
      Gd_1 = 0;
      Gd_2 = 0;
      str_4 = this.eGridProperties.sSymbol;
      Gi_3 = getCountBySymbolAndMagic(str_4, this.eGridProperties.m_iMagic7786);
      if(Gi_3 != 0)
        {
         Gb_4 = (this.eGridProperties.dTakeProfit == 0);
         if(Gb_4 != true)
           {
            str_5 = this.eGridProperties.sSymbol;
            Gd_4 = getAveragePrice(str_5, Gi_0, 0);
            str_6 = this.eGridProperties.sSymbol;
            Gd_5 = getAveragePrice(str_6, Gi_0, 1);
            if(Gd_5 <= Gd_4)
              {
               Gd_4 = Gd_4;
              }
            else
              {
               Gd_4 = Gd_5;
              }
            Gd_1 = Gd_4;
            Gi_4 = OrdersTotal() - 1;
            Gi_6 = Gi_4;
            if(Gi_4 >= 0)
              {
               do
                 {
                  bret = OrderSelect(Gi_6, 0, 0);
                  if(bret)
                    {
                     if(OrderSymbol() == this.eGridProperties.sSymbol)
                       {
                        if(OrderMagicNumber() == Gi_0)
                          {
                           if(Gi_3 < 3)
                             {
                              Gd_2 = getTakeProfit(OrderType(), (int)this.eGridProperties.dTakeProfit, OrderOpenPrice(), this.eGridProperties.dTickSize);
                             }
                           else
                             {
                              Gd_2 = getTakeProfit(OrderType(), 7, Gd_1, this.eGridProperties.dTickSize);
                             }
                           Gd_8 = MarketInfo(this.eGridProperties.sSymbol, MODE_POINT);
                           Gd_9 = (Gd_2 / Gd_8);
                           Gd_9 = NormalizeDouble(Gd_9, 0);
                           double dttp = (OrderTakeProfit() / Gd_8);
                           Gb_A = (Gd_9 == NormalizeDouble(dttp, 0));
                           if(Gb_A != true)
                             {
                              if(OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), Gd_2, 0, 4294967295)) {}
                             }
                          }
                       }
                    }
                  Gi_6 = Gi_6 - 1;
                 }
               while(Gi_6 >= 0);
              }
           }
        }
      Gi_C = this.eGridProperties.m_iMagic7876;
      Gd_D = 0;
      Gd_E = 0;
      str_7 = this.eGridProperties.sSymbol;
      Gi_F = getCountBySymbolAndMagic(str_7, this.eGridProperties.m_iMagic7876);
      if(Gi_F != 0)
        {
         Gb_10 = (this.eGridProperties.dTakeProfit == 0);
         if(Gb_10 != true)
           {
            str_8 = this.eGridProperties.sSymbol;
            Gd_10 = getAveragePrice(str_8, Gi_C, 0);
            str_9 = this.eGridProperties.sSymbol;
            Gd_11 = getAveragePrice(str_9, Gi_C, 1);
            if(Gd_11 <= Gd_10)
              {
               Gd_10 = Gd_10;
              }
            else
              {
               Gd_10 = Gd_11;
              }
            Gd_D = Gd_10;
            Gi_10 = OrdersTotal() - 1;
            Gi_12 = Gi_10;
            if(Gi_10 >= 0)
              {
               do
                 {
                  bret = OrderSelect(Gi_12, 0, 0);
                  if(bret)
                    {
                     if(OrderSymbol() == this.eGridProperties.sSymbol)
                       {
                        if(OrderMagicNumber() == Gi_C)
                          {
                           if(Gi_F < 3)
                             {
                              Gd_E = getTakeProfit(OrderType(), (int)this.eGridProperties.dTakeProfit, OrderOpenPrice(), this.eGridProperties.dTickSize);
                             }
                           else
                             {
                              Gd_E = getTakeProfit(OrderType(), 7, Gd_D, this.eGridProperties.dTickSize);
                             }
                           Gd_14 = MarketInfo(this.eGridProperties.sSymbol, 11);
                           Gd_15 = (Gd_E / Gd_14);
                           Gd_15 = NormalizeDouble(Gd_15, 0);
                           Gd_16 = (OrderTakeProfit() / Gd_14);
                           Gb_16 = (Gd_15 == NormalizeDouble(Gd_16, 0));
                           if(Gb_16 != true)
                             {
                              if(OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), Gd_E, 0, 4294967295)) {}
                             }
                          }
                       }
                    }
                  Gi_12 = Gi_12 - 1;
                 }
               while(Gi_12 >= 0);
              }
           }
        }
      Gi_18 = this.eGridProperties.m_iMagic8776;
      Gd_19 = 0;
      Gd_1A = 0;
      str_A = this.eGridProperties.sSymbol;
      Gi_1B = getCountBySymbolAndMagic(str_A, this.eGridProperties.m_iMagic8776);
      if(Gi_1B != 0)
        {
         Gb_1C = (this.eGridProperties.dTakeProfit == 0);
         if(Gb_1C != true)
           {
            str_B = this.eGridProperties.sSymbol;
            Gd_1C = getAveragePrice(str_B, Gi_18, 0);
            str_C = this.eGridProperties.sSymbol;
            Gd_1D = getAveragePrice(str_C, Gi_18, 1);
            if(Gd_1D <= Gd_1C)
              {
               Gd_1C = Gd_1C;
              }
            else
              {
               Gd_1C = Gd_1D;
              }
            Gd_19 = Gd_1C;
            Gi_1C = OrdersTotal() - 1;
            Gi_1E = Gi_1C;
            if(Gi_1C >= 0)
              {
               do
                 {
                  bret = OrderSelect(Gi_1E, 0, 0);
                  if(bret)
                    {
                     if(OrderSymbol() == this.eGridProperties.sSymbol)
                       {
                        if(OrderMagicNumber() == Gi_18)
                          {
                           if(Gi_1B < 3)
                             {
                              Gd_1A = getTakeProfit(OrderType(), (int)this.eGridProperties.dTakeProfit, OrderOpenPrice(), this.eGridProperties.dTickSize);
                             }
                           else
                             {
                              Gd_1A = getTakeProfit(OrderType(), 7, Gd_19, this.eGridProperties.dTickSize);
                             }
                           Gd_20 = MarketInfo(this.eGridProperties.sSymbol, MODE_POINT);
                           Gb_22 = (NormalizeDouble(Gd_1A / Gd_20, 0) == NormalizeDouble(OrderTakeProfit() / Gd_20, 0));
                           if(Gb_22 != true)
                             {
                              if(OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), Gd_1A, 0, 4294967295)) {}
                             }
                          }
                       }
                    }
                  Gi_1E = Gi_1E - 1;
                 }
               while(Gi_1E >= 0);
              }
           }
        }
      Gi_24 = this.eGridProperties.m_iMagic17776;
      Gd_25 = 0;
      Gd_26 = 0;
      str_D = this.eGridProperties.sSymbol;
      Gi_27 = getCountBySymbolAndMagic(str_D, this.eGridProperties.m_iMagic17776);
      if(Gi_27 != 0)
        {
         Gb_28 = (this.eGridProperties.dTakeProfit == 0);
         if(Gb_28 != true)
           {
            str_E = this.eGridProperties.sSymbol;
            Gd_28 = getAveragePrice(str_E, Gi_24, 0);
            str_F = this.eGridProperties.sSymbol;
            Gd_29 = getAveragePrice(str_F, Gi_24, 1);
            if(Gd_29 <= Gd_28)
              {
               Gd_28 = Gd_28;
              }
            else
              {
               Gd_28 = Gd_29;
              }
            Gd_25 = Gd_28;
            Gi_28 = OrdersTotal() - 1;
            Gi_2A = Gi_28;
            if(Gi_28 >= 0)
              {
               do
                 {
                  bret = OrderSelect(Gi_2A, 0, 0);
                  if(bret)
                    {
                     if(OrderSymbol() == this.eGridProperties.sSymbol)
                       {
                        if(OrderMagicNumber() == Gi_24)
                          {
                           if(Gi_27 < 3)
                             {
                              Gd_26 = getTakeProfit(OrderType(), (int)this.eGridProperties.dTakeProfit, OrderOpenPrice(), this.eGridProperties.dTickSize);
                             }
                           else
                             {
                              Gd_26 = getTakeProfit(OrderType(), 7, Gd_25, this.eGridProperties.dTickSize);
                             }
                           Gd_2C = MarketInfo(this.eGridProperties.sSymbol, MODE_POINT);
                           Gb_2E = (NormalizeDouble(Gd_26 / Gd_2C, 0) == NormalizeDouble(OrderTakeProfit() / Gd_2C, 0));
                           if(Gb_2E != true)
                             {
                              if(OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), Gd_26, 0, 4294967295)) {}
                             }
                          }
                       }
                    }
                  Gi_2A = Gi_2A - 1;
                 }
               while(Gi_2A >= 0);
              }
           }
        }
      funcTrailingStop(this.eGridProperties.m_iMagic7786);
      funcTrailingStop(this.eGridProperties.m_iMagic7876);
      funcTrailingStop(this.eGridProperties.m_iMagic8776);
      funcTrailingStop(this.eGridProperties.m_iMagic17776);

      if(bNoDry)
         OpenOrders(); //если сушка выклчюена разрешаем
     }
protected:
   GridProperties    eGridProperties;

   double            GetAutoLot()
     {

      return funcNLot(AccountBalance()*RiskLot/100000);
     }

   virtual double    funcNLot(double arg_0)
     {
      double Ld_E8;
      double Ld_E0;
      double Ld_D8;
      double Ld_D0;
      double Ld_0;
      Ld_E8 = MarketInfo(this.eGridProperties.sSymbol, MODE_MAXLOT);
      Ld_E0 = MarketInfo(this.eGridProperties.sSymbol, MODE_MINLOT);
      Ld_D8 = MarketInfo(this.eGridProperties.sSymbol, MODE_LOTSTEP);
      Gd_0 = (arg_0 / Ld_D8);
      Ld_D0 = (Ld_D8 * NormalizeDouble(Gd_0, 0));
      Gd_0 = Ld_E0;
      Gd_1 = Ld_E8;
      if(Ld_E8 >= Ld_D0)
        {
         Gd_2 = Ld_D0;
        }
      else
        {
         Gd_2 = Gd_1;
        }
      if(Gd_2 <= Gd_0)
        {
         Gd_1 = Gd_0;
        }
      else
        {
         Gd_1 = Gd_2;
        }
      Ld_0 = Gd_1;
      return Gd_1;
     }

   virtual void      OpenOrders()
     {
      string str_0;
      string str_1;
      string sSymbol;
      string sVariableText;
      string str_4;
      string str_5;
      string str_6;
      string str_7;
      string str_8;
      string str_9;
      string str_A;
      string str_B;
      string str_C;
      string sCommentBuy1;
      string sCommentSell1;
      string sCommentBuyCounter1;
      string sCommentSellCounter1;
      double dPriceMA;
      double dPriceStoch1;
      double dPriceStoch2;
      double dPriceClose1;
      int Li_9C;
      double Ld_90;
      double Ld_88;
      double dprice;
      double Ld_78;
      double Ld_70;
      double Ld_68;
      sCommentBuy1 = "BUY TREND-Lvl-";
      sCommentSell1 = "SELL TREND-Lvl-";
      sCommentBuyCounter1 = "BUY COUNTER-Lvl-";
      sCommentSellCounter1 = "SELL COUNTER-Lvl-";
      dPriceMA = iMA(this.eGridProperties.sSymbol, 0, this.eGridProperties.m_MA_Period, 0, MODE_LWMA, PRICE_CLOSE, 0);
      dPriceStoch1 = iStochastic(this.eGridProperties.sSymbol, 0, this.eGridProperties.PeriodStochK, this.eGridProperties.PeriodStochD, this.eGridProperties.SlowStoch, 0, 0, 0, 0);
      dPriceStoch2 = iStochastic(this.eGridProperties.sSymbol, 0, this.eGridProperties.PeriodStochK, this.eGridProperties.PeriodStochD, this.eGridProperties.SlowStoch, 0, 0, 0, 0);
      dPriceClose1 = iClose(this.eGridProperties.sSymbol, _Period, 1);

      Li_9C = getEntryConfirmation(dPriceClose1, dPriceMA, dPriceStoch1, dPriceStoch2, 1);/*
      0,
      2,
      -2,
      */

      this.eGridProperties.dMaxLot=GetAutoLot();

      Ld_90 = AccountFreeMarginCheck(this.eGridProperties.sSymbol, 0, this.eGridProperties.dMaxLot);
      Ld_88 = AccountFreeMarginCheck(this.eGridProperties.sSymbol, 1, this.eGridProperties.dMaxLot);
      if(Ld_90 > 0)
        {

         str_0 = this.eGridProperties.sSymbol;
         bret = checkEntry1(false, true, getCountBySymbolAndMagic(str_0, this.eGridProperties.m_iMagic7786), Li_9C);//li_9c = 2, -2
         if(bret)
           {

            dprice = MarketInfo(this.eGridProperties.sSymbol, MODE_ASK);
            str_1 = "BUY TREND-Lvl-0";
            Gd_0 = (this.eGridProperties.dStopLoss * this.eGridProperties.dTickSize);
            Gd_1 = (dprice - Gd_0);
            this.eGridProperties.iLastTicket = OrderSend(this.eGridProperties.sSymbol, 0, this.eGridProperties.dMaxLot, dprice, 3, Gd_1, 0, str_1, this.eGridProperties.m_iMagic7786, 0, 16777215);
            sSymbol = (string)this.eGridProperties.iLastTicket;
            sSymbol = "Opening #" + sSymbol;
            sSymbol = sSymbol + " ";
            sSymbol = sSymbol + "BUY TREND-Lvl-";
            sSymbol = sSymbol + "0";
            sSymbol = sSymbol + " ";
            sSymbol = sSymbol + DoubleToString(this.eGridProperties.dMaxLot, 2);
            sSymbol = sSymbol + " at ";
            sVariableText = (string)dprice;
            sSymbol = sSymbol + sVariableText;
            sSymbol = sSymbol + " sl: ";
            sVariableText = (string)(dprice - Gd_0);
            sSymbol = sSymbol + sVariableText;
            Print(sSymbol);
           }
        }
      else
        {
         Print("Not enough money for buy");
        }
      if(Ld_88 > 0)
        {
         sVariableText = this.eGridProperties.sSymbol;
         bret = checkEntry2(false, true, getCountBySymbolAndMagic(sVariableText, this.eGridProperties.m_iMagic7876), Li_9C);
         if(bret)
           {

            Ld_78 = MarketInfo(this.eGridProperties.sSymbol, MODE_BID);
            str_4 = sCommentSell1 + "0";
            Gd_2 = (this.eGridProperties.dStopLoss * this.eGridProperties.dTickSize);
            Gd_3 = (Gd_2 + Ld_78);
            this.eGridProperties.iLastTicket = OrderSend(this.eGridProperties.sSymbol, 1, this.eGridProperties.dMaxLot, Ld_78, 3, Gd_3, 0, str_4, this.eGridProperties.m_iMagic7876, 0, 16776960);
            str_5 = (string)this.eGridProperties.iLastTicket;
            str_5 = "Opening #" + str_5;
            str_5 = str_5 + " ";
            str_5 = str_5 + sCommentSell1;
            str_5 = str_5 + "0";
            str_5 = str_5 + " ";
            str_5 = str_5 + DoubleToString(this.eGridProperties.dMaxLot, 2);
            str_5 = str_5 + " at ";
            str_6 = (string)Ld_78;
            str_5 = str_5 + str_6;
            str_5 = str_5 + " sl: ";
            str_6 = (string)(Ld_78 + Gd_2);
            str_5 = str_5 + str_6;
            Print(str_5);
           }
        }
      else
        {
         Print("Not enough money for sell");
        }
      Li_9C = getEntryConfirmation(dPriceClose1, dPriceMA, dPriceStoch1, dPriceStoch2, -1);
      if(Ld_90 > 0)
        {

         str_6 = this.eGridProperties.sSymbol;
         bret = checkEntry1(false, true, getCountBySymbolAndMagic(str_6, this.eGridProperties.m_iMagic8776), Li_9C);
         if(bret)
           {

            Ld_70 = MarketInfo(this.eGridProperties.sSymbol, MODE_ASK);
            str_7 = sCommentBuyCounter1 + "0";
            Gd_4 = (this.eGridProperties.dStopLoss * this.eGridProperties.dTickSize);
            Gd_5 = (Ld_70 - Gd_4);
            this.eGridProperties.iLastTicket = OrderSend(this.eGridProperties.sSymbol, 0, this.eGridProperties.dMaxLot, Ld_70, 3, Gd_5, 0, str_7, this.eGridProperties.m_iMagic8776, 0, 16711680);
            str_8 = (string)this.eGridProperties.iLastTicket;
            s

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

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

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

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

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