Author: Zonker
Profit factor:
48.25

The EuroBull is an automated trading script specifically designed to navigate the EURUSD currency pair. Its primary objective is to identify opportunities for purchasing Euros based on market trends and account conditions. The logic follows a systematic approach to ensure the system operates within specific safety boundaries while pursuing profitable entries.

Core Trading Strategy

The script functions by monitoring the relationship between current market prices and a Simple Moving Average (SMA) calculated over a daily timeframe. Interestingly, the logic is structured so that it seeks "Buy" opportunities regardless of whether the price is currently above, below, or equal to this average. This suggests a strategy designed to remain active in various market conditions rather than waiting for a specific crossover.

Risk Management and Safety Filters

Before executing any trades, the script performs several "health checks" to ensure it is operating under optimal conditions:

  • Connectivity Check: It verifies that a stable connection to the market is active.
  • Equity Ceiling: To prevent over-exposure or "greed," the system contains a profit target. If the account equity reaches a specific high threshold, the script will automatically close open positions and stop trading.
  • Minimum Balance: The script includes a safety floor; if the account balance drops below a certain level, it will cease operations to preserve remaining capital.

Dynamic Position Management

The script manages trade sizes and quantities based on the current state of the account:

  • Lot Calculation: It dynamically determines how many "lots" (units of currency) to purchase by dividing the current account balance by a fixed factor. This allows the position size to scale as the account grows.
  • Scaling Logic: If the calculated amount exceeds the pre-defined maximum limit, it caps the trade at that maximum. If the funds are low, it attempts to enter the smallest possible "tiny" lot to keep the strategy active.
  • Trade Rotation: The script monitors open positions. If the account equity is sufficiently high relative to the volume of current trades (and if there is room to expand), it will close existing buy orders to "sell up," effectively resetting the positions to allow for new entries at different prices.

Execution Reliability

To handle the fluid nature of live markets, the script includes a retry mechanism. If an order fails to open or close due to temporary market fluctuations (like price slippage), the system will automatically refresh the latest market data and attempt to re-execute the command multiple times before moving on. This ensures that the strategy remains resilient against minor technical hiccups during high volatility.

Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reachedIt Closes Orders by itself
Indicators Used
Moving average indicator
15 Views
0 Downloads
0 Favorites
EuroBull1
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                                     EuroBull.mq4 |
//|                                                           Zonker |
//|                                        http://www.greenpeace.org |
//+------------------------------------------------------------------+
//
//The EuroBull, tends to favour markets that trend in favour of Euro:).
//Designed to run on EURUSD.

#property copyright "Zonker"
#property link      "http://www.greenpeace.org"

#define MAXLOTSIZE 5
#define MAXPOS 3
#define SLIP 1
#define SL 100
int myMagic = 88888888;//very lucky, yes?

//+------------------------------------------------------------------- 
int init() { return(0); }
int deinit() { return(0); }
//+------------------------------------------------------------------- 

int start()
{  double sma;
   bool BuyEuros = false;
   int LotsToBuy,Lots; 
   int i;

   if(!Happyness()) return(0);

   sma = iMA(NULL,PERIOD_D1,10,0,MODE_SMA,PRICE_CLOSE,0);//Must respect the sma.
   
   if(sma > Ask) //Euros going cheap! BUY!
      BuyEuros = true;
   
   if(sma < Ask) //Momentum in our favour! BUY!!
      BuyEuros = true;
      
   if(sma == Ask) //BuY EUROS NOW!!!, BUY MORE!!!
      BuyEuros = true;
   
   if(OrdersTotal()>0)
   {  //We have Euros! Do we need any more?
      Lots=0;
      for(i=0;i<OrdersTotal();i++)
      {  OrderSelect(i,SELECT_BY_POS,MODE_TRADES); 
         Lots += OrderLots();
      }
      if(AccountEquity() > (Lots*2000 + MathMin(5,(Lots+1)/2)*2000 + 100) && Lots < MAXLOTSIZE*MAXPOS && Lots >= 1.0)
         CloseOrders(OP_BUY); //Sell up and buy more Euros   
      else 
         return(0);
      
   }
    
   if(BuyEuros)
   {  //We don't have any Euros?!!? How many Euros should we buy?
      LotsToBuy = AccountBalance()/2000;
      
      if(LotsToBuy == 0 && AccountBalance() > 100)
      {  //Ok, getting desparate..
         double tinyLots = NormalizeDouble(AccountBalance()/2000.0-0.1,1);
         if(tinyLots>0)
            MyOrderSend(Symbol(),OP_BUY,tinyLots,Ask,SLIP,Ask-SL*Point,Ask+SL*Point,"",myMagic,0,Blue);    
         return(0);
      }
      
      for(i=0;i<MAXPOS;i++)
      {  if(LotsToBuy>MAXLOTSIZE) Lots = MAXLOTSIZE;
         else Lots = LotsToBuy;
         
         MyOrderSend(Symbol(),OP_BUY,Lots,Ask,SLIP,Ask-SL*Point,0,"",myMagic,0,Blue);
         
         LotsToBuy -= MAXLOTSIZE;
         if(LotsToBuy <= 0) break;
      } 
   }  


   return(0);
}
  
//+------------------------------------------------------------------- 
bool Happyness() //Are we in the right mood to trade?
{  
   if(!IsConnected()) 
   {  Print("Yo man, we are not connected!");
      return(false);
   }
  // if(!IsExpertEnabled())
  // {  Print("Hey, we are not enabled!");
  //    return(false);
  // }
   
   if(AccountEquity() > 98800) //Stop at 888%, lets not be greedy.
   {  if(OrdersTotal() > 0) 
         CloseOrders(OP_BUY); 
      return(false);
   }
   
   if(AccountBalance() < 200) return(false); //Ok, we  lost.
   
   return(true);
}
  
//+-------------------------------------------------------------------  
int CloseOrders(int cmd)
{  int i;
   double price;
   if(cmd == OP_SELL) price = Ask;
   else price = Bid;

   for(i=OrdersTotal()-1;i>=0;i--)
   {  OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
      if(OrderType() == cmd)
         MyOrderClose(OrderTicket(),OrderLots(),price,SLIP,CLR_NONE);
   }
}
//+------------------------------------------------------------------- 
int MyOrderSend(string sym, int cmd, double vol, double price, int slip, double sl, double tp, string comment="", int magic=0, datetime exp=0, color cl=CLR_NONE)
{  int err;
   bool isAsk=false;
 
   if(price == Ask) isAsk = true;   

   for(int z=0;z<10;z++)
   {  if(OrderSend(sym,cmd,vol,price,slip,sl,tp,comment,magic,exp,cl)<0)
      {  err = GetLastError();
         Print("OrderSend failed, Error: ", err);
         if(err>4000) break;
         RefreshRates();
         if(isAsk) price = Ask;
         else price = Bid;
      }
      else
         break;
   }

}
//+------------------------------------------------------------------+
bool MyOrderClose(int ticket, double lots, double price, int slip, color cl=CLR_NONE)
{  int err;
   bool isAsk=false;
   
   if(price == Ask) isAsk = true; 

   for(int z=0;z<10;z++)
   {
      if(!OrderClose(ticket,lots,price,slip,cl))
      {  err = GetLastError();
         Print("OrderClose failed, Error: ", err);
         if(err>4000) break;
         RefreshRates();
         if(isAsk) price = Ask;
         else price = Bid;
      }
      else
         break;
   }

} 
//+------------------------------------------------------------------- 

Profitability Reports

PERFORMANCE BY SYMBOL

Expected payoff

Average expected payoff across the available backtests for each symbol.

Positive Negative
34 reports
EUR/USD Jul 2025 - Sep 2025
811.83
Total Trades 12
Won Trades 1
Lost trades 11
Win Rate 8.33 %
Expected payoff 263520.25
Gross Profit 3166143.00
Gross Loss -3900.00
Total Net Profit 3162243.00
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
811.82
Total Trades 12
Won Trades 1
Lost trades 11
Win Rate 8.33 %
Expected payoff 263515.00
Gross Profit 3166080.00
Gross Loss -3900.00
Total Net Profit 3162180.00
-100%
-50%
0%
50%
100%
USD/CAD Oct 2024 - Jan 2025
2.36
Total Trades 134
Won Trades 19
Lost trades 115
Win Rate 14.18 %
Expected payoff 365.22
Gross Profit 84843.68
Gross Loss -35903.72
Total Net Profit 48939.96
-100%
-50%
0%
50%
100%
AUD/USD Oct 2025 - Feb 2026
1.00
Total Trades 169
Won Trades 28
Lost trades 141
Win Rate 16.57 %
Expected payoff 0.59
Gross Profit 38699.00
Gross Loss -38600.00
Total Net Profit 99.00
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.93
Total Trades 79
Won Trades 6
Lost trades 73
Win Rate 7.59 %
Expected payoff -18.04
Gross Profit 19822.18
Gross Loss -21247.22
Total Net Profit -1425.04
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.92
Total Trades 82
Won Trades 6
Lost trades 76
Win Rate 7.32 %
Expected payoff -20.83
Gross Profit 20333.04
Gross Loss -22041.10
Total Net Profit -1708.06
-100%
-50%
0%
50%
100%
USD/JPY Jul 2025 - Sep 2025
0.89
Total Trades 428
Won Trades 71
Lost trades 357
Win Rate 16.59 %
Expected payoff -17.56
Gross Profit 60676.20
Gross Loss -68194.01
Total Net Profit -7517.81
-100%
-50%
0%
50%
100%
AUD/USD Jan 2025 - Jul 2025
0.75
Total Trades 434
Won Trades 130
Lost trades 304
Win Rate 29.95 %
Expected payoff -22.37
Gross Profit 29701.00
Gross Loss -39410.00
Total Net Profit -9709.00
-100%
-50%
0%
50%
100%
USD/CAD Jan 2025 - Jul 2025
0.73
Total Trades 513
Won Trades 138
Lost trades 375
Win Rate 26.90 %
Expected payoff -18.91
Gross Profit 25618.23
Gross Loss -35320.82
Total Net Profit -9702.59
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.73
Total Trades 216
Won Trades 57
Lost trades 159
Win Rate 26.39 %
Expected payoff -43.32
Gross Profit 24879.72
Gross Loss -34236.63
Total Net Profit -9356.91
-100%
-50%
0%
50%
100%
USD/CHF Jan 2025 - Jul 2025
0.72
Total Trades 341
Won Trades 104
Lost trades 237
Win Rate 30.50 %
Expected payoff -28.47
Gross Profit 25500.59
Gross Loss -35207.66
Total Net Profit -9707.07
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.72
Total Trades 224
Won Trades 60
Lost trades 164
Win Rate 26.79 %
Expected payoff -41.91
Gross Profit 24310.02
Gross Loss -33697.21
Total Net Profit -9387.19
-100%
-50%
0%
50%
100%
NZD/USD Jan 2025 - Jul 2025
0.71
Total Trades 665
Won Trades 261
Lost trades 404
Win Rate 39.25 %
Expected payoff -14.59
Gross Profit 23345.00
Gross Loss -33050.00
Total Net Profit -9705.00
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.69
Total Trades 82
Won Trades 18
Lost trades 64
Win Rate 21.95 %
Expected payoff -60.18
Gross Profit 10965.00
Gross Loss -15900.00
Total Net Profit -4935.00
-100%
-50%
0%
50%
100%
USD/JPY Jan 2025 - Jul 2025
0.67
Total Trades 758
Won Trades 276
Lost trades 482
Win Rate 36.41 %
Expected payoff -12.80
Gross Profit 19618.74
Gross Loss -29320.38
Total Net Profit -9701.64
-100%
-50%
0%
50%
100%
GBP/AUD Oct 2025 - Feb 2026
0.64
Total Trades 231
Won Trades 20
Lost trades 211
Win Rate 8.66 %
Expected payoff -42.02
Gross Profit 17270.55
Gross Loss -26976.78
Total Net Profit -9706.23
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.60
Total Trades 106
Won Trades 19
Lost trades 87
Win Rate 17.92 %
Expected payoff -63.19
Gross Profit 10002.00
Gross Loss -16700.00
Total Net Profit -6698.00
-100%
-50%
0%
50%
100%
EUR/USD Oct 2025 - Feb 2026
0.60
Total Trades 528
Won Trades 209
Lost trades 319
Win Rate 39.58 %
Expected payoff -18.39
Gross Profit 14331.00
Gross Loss -24040.00
Total Net Profit -9709.00
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.47
Total Trades 361
Won Trades 129
Lost trades 232
Win Rate 35.73 %
Expected payoff -26.89
Gross Profit 8601.00
Gross Loss -18310.00
Total Net Profit -9709.00
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.44
Total Trades 267
Won Trades 93
Lost trades 174
Win Rate 34.83 %
Expected payoff -35.46
Gross Profit 7411.40
Gross Loss -16880.00
Total Net Profit -9468.60
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.44
Total Trades 264
Won Trades 86
Lost trades 178
Win Rate 32.58 %
Expected payoff -36.12
Gross Profit 7525.10
Gross Loss -17060.00
Total Net Profit -9534.90
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.36
Total Trades 353
Won Trades 131
Lost trades 222
Win Rate 37.11 %
Expected payoff -27.50
Gross Profit 5431.00
Gross Loss -15140.00
Total Net Profit -9709.00
-100%
-50%
0%
50%
100%
GBP/CAD Oct 2025 - Feb 2026
0.29
Total Trades 204
Won Trades 29
Lost trades 175
Win Rate 14.22 %
Expected payoff -47.58
Gross Profit 4032.02
Gross Loss -13738.19
Total Net Profit -9706.17
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.28
Total Trades 251
Won Trades 41
Lost trades 210
Win Rate 16.33 %
Expected payoff -38.67
Gross Profit 3778.38
Gross Loss -13484.46
Total Net Profit -9706.08
-100%
-50%
0%
50%
100%
GBP/USD Jan 2025 - Jul 2025
0.23
Total Trades 175
Won Trades 36
Lost trades 139
Win Rate 20.57 %
Expected payoff -55.48
Gross Profit 2911.00
Gross Loss -12620.00
Total Net Profit -9709.00
-100%
-50%
0%
50%
100%
GBP/AUD Jan 2025 - Jul 2025
0.18
Total Trades 242
Won Trades 42
Lost trades 200
Win Rate 17.36 %
Expected payoff -40.10
Gross Profit 2070.51
Gross Loss -11774.91
Total Net Profit -9704.40
-100%
-50%
0%
50%
100%
AUD/USD Oct 2024 - Jan 2025
0.16
Total Trades 225
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -43.15
Gross Profit 1871.00
Gross Loss -11580.00
Total Net Profit -9709.00
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.13
Total Trades 228
Won Trades 47
Lost trades 181
Win Rate 20.61 %
Expected payoff -42.57
Gross Profit 1483.97
Gross Loss -11191.04
Total Net Profit -9707.07
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.10
Total Trades 166
Won Trades 36
Lost trades 130
Win Rate 21.69 %
Expected payoff -58.49
Gross Profit 1090.00
Gross Loss -10800.00
Total Net Profit -9710.00
-100%
-50%
0%
50%
100%
GBP/CAD Jan 2025 - Jul 2025
0.00
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.00
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.00
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.00
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%
USD/JPY Jul 2025 - Sep 2025
0.00
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%

Comments