IRINKARAZAN

Author: Copyright � 2005, MetaQuotes Software Corp.
Profit factor:
0.32
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reached
Miscellaneous
It issuies visual alerts to the screen
8 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

USD/JPY Jul 2025 - Sep 2025
0.66
Total Trades 74
Won Trades 42
Lost trades 32
Win Rate 56.76 %
Expected payoff -0.51
Gross Profit 73.00
Gross Loss -111.10
Total Net Profit -38.10
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.16
Total Trades 109
Won Trades 27
Lost trades 82
Win Rate 24.77 %
Expected payoff -3.96
Gross Profit 84.96
Gross Loss -516.58
Total Net Profit -431.62
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.37
Total Trades 103
Won Trades 44
Lost trades 59
Win Rate 42.72 %
Expected payoff -1.32
Gross Profit 80.88
Gross Loss -217.01
Total Net Profit -136.13
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.47
Total Trades 37
Won Trades 18
Lost trades 19
Win Rate 48.65 %
Expected payoff -1.35
Gross Profit 45.00
Gross Loss -95.00
Total Net Profit -50.00
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.31
Total Trades 183
Won Trades 70
Lost trades 113
Win Rate 38.25 %
Expected payoff -2.13
Gross Profit 175.00
Gross Loss -565.00
Total Net Profit -390.00
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.00
Total Trades 89
Won Trades 0
Lost trades 89
Win Rate 0.00 %
Expected payoff -3.57
Gross Profit 0.00
Gross Loss -317.79
Total Net Profit -317.79
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.08
Total Trades 265
Won Trades 38
Lost trades 227
Win Rate 14.34 %
Expected payoff -2.56
Gross Profit 61.89
Gross Loss -739.15
Total Net Profit -677.26
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.80
Total Trades 173
Won Trades 96
Lost trades 77
Win Rate 55.49 %
Expected payoff -610.90
Gross Profit 421860.80
Gross Loss -527547.00
Total Net Profit -105686.20
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.26
Total Trades 170
Won Trades 58
Lost trades 112
Win Rate 34.12 %
Expected payoff -2.44
Gross Profit 145.00
Gross Loss -560.00
Total Net Profit -415.00
-100%
-50%
0%
50%
100%
USD/JPY Jul 2025 - Sep 2025
0.43
Total Trades 87
Won Trades 40
Lost trades 47
Win Rate 45.98 %
Expected payoff -1.08
Gross Profit 69.52
Gross Loss -163.22
Total Net Profit -93.70
-100%
-50%
0%
50%
100%

Comments