IRINKARAZAN

Author: Copyright � 2005, MetaQuotes Software Corp.
Profit factor:
0.33
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reached
Miscellaneous
It issuies visual alerts to the screen
3 Views
0 Downloads
0 Favorites
IRINKARAZAN
//+------------------------------------------------------------------+
//|                                                  IRINKARAZAN.mq4 |
//|                      Copyright © 2005, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"
int magic_buy  = 1000;
int magic_sell = 1010;
int order_buy [8];
int order_sell[8];
int count = 0;
bool first_launch = false;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
{
   for (int i = 0; i < 8; i++)
   {
      order_buy [i] = 0;
      order_sell[i] = 0;
   }
   count = 0;
   first_launch = false;
   return(0);
}

//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
{
   return(0);
}
  
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
{
   if (!IsTradeAllowed())
   {
      Alert("Òîðãîâëÿ çàïðåùåíà!");
      return (0);
   }
   
   if (first_launch == false)
   {
      int a = 0, b = 0;
      first_launch = true;
      for (int ind = 0; ind < OrdersTotal(); ind++)
      {
         if ((OrderSelect(ind, SELECT_BY_POS, MODE_MAIN) == TRUE) && ((OrderMagicNumber() > 0)))
         {
            if ((OrderType() == OP_BUY) || (OrderType() == OP_BUYSTOP))
            {
               order_buy[a] = OrderTicket();
               a++;   
            }
            
            if ((OrderType() == OP_BUY) || (OrderType() == OP_BUYSTOP))
            {
               order_sell[b] = OrderTicket();
               b++;
            }
         }
      }
   }

   //----
   if (OrdersTotal() != count)
   {
      for (int j = 0; j < 8; j++)
      {
         if (OrderSelect(order_buy [j], SELECT_BY_TICKET, MODE_HISTORY))
         {
            if (OrderProfit() > 0)
            {
               OrderSend(Symbol(), OP_BUYLIMIT, 0.1,
                         OrderOpenPrice(), 3,
                         NormalizeDouble(OrderOpenPrice() - 50 * Point, Digits), 
                         NormalizeDouble(OrderOpenPrice() + 25 * Point, Digits), "", 0, 0, CLR_NONE); 
            }
         }

         if (OrderSelect(order_sell[j], SELECT_BY_TICKET, MODE_HISTORY))
         {
            if (OrderProfit() > 0)
            {
               OrderSend(Symbol(), OP_SELLLIMIT, 0.1,
                         OrderOpenPrice(), 3,
                         NormalizeDouble(OrderOpenPrice() + 50 * Point, Digits), 
                         NormalizeDouble(OrderOpenPrice() - 25 * Point, Digits), "", 0, 0, CLR_NONE); 
            }
         }
         Sleep(10000);
         while (IsTradeContextBusy())
         {
            Sleep(1000);
            if (IsStopped() || !IsConnected())
               return (0);
         }
      }

      count = OrdersTotal();
      return (0);
   }

   if (OrdersTotal() != 0)
   {
      return (0);
   }

   for (int i = 0; i < 8; i++)
   {
      RefreshRates();
      double price_buy    = Ask + 50 * i * Point;
      double price_sell   = Bid - 50 * i * Point;
      double stoploss_buy = price_buy  - 50 * Point;
      double take_buy     = price_buy  + 25 * Point;
      double stoploss_sell= price_sell + 50 * Point;
      double take_sell    = price_sell - 25 * Point;
      order_buy[i] = OrderSend(Symbol(), OP_BUYSTOP,  0.1, NormalizeDouble(price_buy,     Digits), 3, 
                               NormalizeDouble(stoploss_buy,  Digits),
                               NormalizeDouble(take_buy,      Digits), "BUYSTOP"+i, magic_buy + i, 0, CLR_NONE);
      Sleep(10000);
      while (IsTradeContextBusy())
      {
         Print("Òîðãîâûé ïîòîê çàíÿò!");
         Sleep(1000);
         if (IsStopped() || !IsConnected())
            return (0);
      }

      RefreshRates();                         
      order_sell[i]= OrderSend(Symbol(), OP_SELLSTOP, 0.1,  
                               NormalizeDouble(price_sell,    Digits), 3,
                               NormalizeDouble(stoploss_sell, Digits), 
                               NormalizeDouble(take_sell,     Digits), "SELLSTOP"+i, magic_sell + i, 0, CLR_NONE);
      Sleep(10000);
      while (IsTradeContextBusy())
      {
         Print("Òîðãîâûé ïîòîê çàíÿò!");
         Sleep(1000);
         if (IsStopped() || !IsConnected())
            return (0);
      }
   }
   count = 16;
   //----
   return(0);
}
//+------------------------------------------------------------------+

Profitability Reports

GBP/USD Jul 2025 - Sep 2025
0.23
Total Trades 151
Won Trades 47
Lost trades 104
Win Rate 31.13 %
Expected payoff -2.67
Gross Profit 117.50
Gross Loss -520.00
Total Net Profit -402.50
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.10
Total Trades 261
Won Trades 43
Lost trades 218
Win Rate 16.48 %
Expected payoff -2.72
Gross Profit 77.64
Gross Loss -788.00
Total Net Profit -710.36
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.09
Total Trades 233
Won Trades 35
Lost trades 198
Win Rate 15.02 %
Expected payoff -2.56
Gross Profit 57.75
Gross Loss -653.41
Total Net Profit -595.66
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.00
Total Trades 158
Won Trades 91
Lost trades 67
Win Rate 57.59 %
Expected payoff -668.00
Gross Profit 227.50
Gross Loss -105771.50
Total Net Profit -105544.00
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.22
Total Trades 134
Won Trades 41
Lost trades 93
Win Rate 30.60 %
Expected payoff -2.71
Gross Profit 102.50
Gross Loss -465.00
Total Net Profit -362.50
-100%
-50%
0%
50%
100%
USD/CHF Jan 2025 - Jul 2025
0.31
Total Trades 253
Won Trades 97
Lost trades 156
Win Rate 38.34 %
Expected payoff -2.35
Gross Profit 268.49
Gross Loss -863.56
Total Net Profit -595.07
-100%
-50%
0%
50%
100%
USD/CAD Jan 2025 - Jul 2025
0.44
Total Trades 790
Won Trades 371
Lost trades 419
Win Rate 46.96 %
Expected payoff -1.03
Gross Profit 645.49
Gross Loss -1458.01
Total Net Profit -812.52
-100%
-50%
0%
50%
100%
NZD/USD Jan 2025 - Jul 2025
0.38
Total Trades 615
Won Trades 267
Lost trades 348
Win Rate 43.41 %
Expected payoff -1.74
Gross Profit 667.50
Gross Loss -1740.00
Total Net Profit -1072.50
-100%
-50%
0%
50%
100%
GBP/USD Jan 2025 - Jul 2025
0.14
Total Trades 130
Won Trades 28
Lost trades 102
Win Rate 21.54 %
Expected payoff -3.38
Gross Profit 70.00
Gross Loss -510.00
Total Net Profit -440.00
-100%
-50%
0%
50%
100%
GBP/CAD Jan 2025 - Jul 2025
0.11
Total Trades 347
Won Trades 64
Lost trades 283
Win Rate 18.44 %
Expected payoff -2.61
Gross Profit 115.65
Gross Loss -1021.96
Total Net Profit -906.31
-100%
-50%
0%
50%
100%

Comments