Author: Copyright � 2008, ZerkMax
Profit factor:
0.61
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reachedIt can change open orders parameters, due to possible stepping strategyIt Closes Orders by itself
17 Views
0 Downloads
0 Favorites
OpenTiks
//+------------------------------------------------------------------+
//|                                                     OpenTiks.mq4 |
//|                                        Copyright © 2008, ZerkMax |
//|                                                      zma@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, ZerkMax"
#property link      "zma@mail.ru"


extern int    TrailingStop   = 60;
extern int    StopLoss       = 100;
extern double Lots           = 0.1;
extern int    magicnumber    = 777;
extern bool   PolLots        = true;
extern int    MaxOrders      =  1;
extern int slippage = 15;

int prevtime;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----





   int i=0;  
   int total = OrdersTotal();   
   for(i = 0; i <= total; i++) 
     {
      if(TrailingStop>0)  
       {                 
       OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
       if(OrderMagicNumber() == magicnumber) 
         {
         TrailingStairs(OrderTicket(),TrailingStop);
         }
       }
      }

bool BuyOp=false;
bool SellOp=false;


if (High[0]>High[1]&&High[1]>High[2]&&High[2]>High[3]&&Open[0]>Open[1]&&Open[1]>Open[2]&&Open[2]>Open[3]) BuyOp=true;
if (High[0]<High[1]&&High[1]<High[2]&&High[2]<High[3]&&Open[0]<Open[1]&&Open[1]<Open[2]&&Open[2]<Open[3]) SellOp=true;

   if(Time[0] == prevtime) 
       return(0);
   prevtime = Time[0];
   if(!IsTradeAllowed()) 
     {
       prevtime = Time[1];
       return(0);
     }


   if (total < MaxOrders || MaxOrders == 0)
     {   
       if(BuyOp)
        { 
         if (StopLoss!=0)
          {
           OrderSend(Symbol(),OP_BUY,Lots,Ask,slippage,Bid-(StopLoss*Point),0,"OpenTiks_Buy",magicnumber,0,Green);
          }
         else
          {
           OrderSend(Symbol(),OP_BUY,Lots,Ask,slippage,0,0,"OpenTiks_Buy",magicnumber,0,Green);
          }
        }
       if(SellOp)
        { 
         if (StopLoss!=0)
          {
           OrderSend(Symbol(),OP_SELL,Lots,Bid,slippage,Ask+(StopLoss*Point),0,"OpenTiks_Sell",magicnumber,0,Red);
          } 
         else 
          {
           OrderSend(Symbol(),OP_SELL,Lots,Bid,slippage,0,0,"OpenTiks_Sell",magicnumber,0,Red);
          }
        }
      }
   
//----
   return(0);
  } 
//+------------------------------------------------------------------+
void TrailingStairs(int ticket,int trldistance)
   {
    int Spred=Ask - Bid;
    if (OrderType()==OP_BUY)
      {
       if((Bid-OrderOpenPrice())>(Point*trldistance))
         {
          if(OrderStopLoss()<Bid-Point*trldistance || (OrderStopLoss()==0))
            {
             OrderModify(ticket,OrderOpenPrice(),Bid-Point*trldistance,OrderTakeProfit(),0,Green);
             if (PolLots)
             if (NormalizeDouble(OrderLots()/2,2)>MarketInfo(Symbol(), MODE_MINLOT))
               {
               OrderClose(ticket,NormalizeDouble(OrderLots()/2,2),Bid,slippage,Green);
               }
             else
               {
               OrderClose(ticket,OrderLots(),Bid,slippage,Green);
               }
            }
         }
       }
     else
       {
        if((OrderOpenPrice()-Ask)>(Point*trldistance))
          {
           if((OrderStopLoss()>(Ask+Point*trldistance)) || (OrderStopLoss()==0))
             {
              OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*trldistance,OrderTakeProfit(),0,Red);
             if (PolLots)
             if (NormalizeDouble(OrderLots()/2,2)>MarketInfo(Symbol(), MODE_MINLOT))
               {
               OrderClose(ticket,NormalizeDouble(OrderLots()/2,2),Ask,slippage,Green);
               }
             else
               {
               OrderClose(ticket,OrderLots(),Ask,slippage,Green);
               }
             }
          }
        }
    }

Profitability Reports

USD/JPY Jul 2025 - Sep 2025
0.69
Total Trades 478
Won Trades 379
Lost trades 99
Win Rate 79.29 %
Expected payoff -0.50
Gross Profit 522.78
Gross Loss -759.41
Total Net Profit -236.63
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.68
Total Trades 372
Won Trades 296
Lost trades 76
Win Rate 79.57 %
Expected payoff -0.99
Gross Profit 780.07
Gross Loss -1147.95
Total Net Profit -367.88
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.62
Total Trades 337
Won Trades 263
Lost trades 74
Win Rate 78.04 %
Expected payoff -0.73
Gross Profit 393.91
Gross Loss -639.75
Total Net Profit -245.84
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.75
Total Trades 349
Won Trades 283
Lost trades 66
Win Rate 81.09 %
Expected payoff -0.56
Gross Profit 581.76
Gross Loss -778.80
Total Net Profit -197.04
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.59
Total Trades 459
Won Trades 353
Lost trades 106
Win Rate 76.91 %
Expected payoff -1.10
Gross Profit 723.14
Gross Loss -1229.60
Total Net Profit -506.46
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.13
Total Trades 232
Won Trades 135
Lost trades 97
Win Rate 58.19 %
Expected payoff -6.19
Gross Profit 212.79
Gross Loss -1649.67
Total Net Profit -1436.88
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.47
Total Trades 461
Won Trades 352
Lost trades 109
Win Rate 76.36 %
Expected payoff -1.19
Gross Profit 478.94
Gross Loss -1029.54
Total Net Profit -550.60
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.68
Total Trades 467
Won Trades 367
Lost trades 100
Win Rate 78.59 %
Expected payoff -0.75
Gross Profit 751.91
Gross Loss -1100.20
Total Net Profit -348.29
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.61
Total Trades 326
Won Trades 250
Lost trades 76
Win Rate 76.69 %
Expected payoff -1.03
Gross Profit 515.69
Gross Loss -851.20
Total Net Profit -335.51
-100%
-50%
0%
50%
100%
USD/CAD Oct 2024 - Jan 2025
0.50
Total Trades 177
Won Trades 135
Lost trades 42
Win Rate 76.27 %
Expected payoff -1.11
Gross Profit 198.71
Gross Loss -394.43
Total Net Profit -195.72
-100%
-50%
0%
50%
100%

Comments