3ma01exp_www.forex-instruments.info

Author: Ron Thompson
Profit factor:
0.38
Orders Execution
Checks for the total of open ordersIt Closes Orders by itself It automatically opens orders when conditions are reached
Indicators Used
Moving average indicator
11 Views
0 Downloads
0 Favorites
3ma01exp_www.forex-instruments.info
//+------------------------------------------------------------------+
//| 3MA Bunny Cross Expert                                           |
//+------------------------------------------------------------------+
#property copyright "Ron Thompson"
#property link      "http://www.lightpatch.com/forex"
// User Input
extern double Lots=0.1;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//|------------------------------------------------------------------|
int init()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   double   cMAfst=0, pMAfst=0;
   double   cMAslo=0, pMAslo=0;
   double    MA100=0;
   int    total=0;
   bool   found=false;
   int    otype=0;
   double otime=0;
   int      cnt=0;
   // Error checking
   if(Bars<100)
     {
      Print("bars less than 100");
      return(0);
     }
   if(AccountFreeMargin()<(1000*Lots))
     {
      Print("We have no money");
      return(0);
     }
   // only one order at a time/per symbol 
   // so see if our symbol has an order open
   Comment(" ");
   cMAfst=iMA(Symbol(),0,5 ,0,MODE_LWMA,PRICE_CLOSE, 1);
   pMAfst=iMA(Symbol(),0,5 ,0,MODE_LWMA,PRICE_CLOSE, 2);
   cMAslo=iMA(Symbol(),0,20,0,MODE_LWMA,PRICE_CLOSE, 1);
   pMAslo=iMA(Symbol(),0,20,0,MODE_LWMA,PRICE_CLOSE, 2);
   // rising or falling
   if ((pMAfst<=cMAslo && cMAfst>=cMAslo) || (pMAfst>=cMAslo && cMAfst<=cMAslo))
     {
      // check for existing order
      found=false;
      otype=-1;
      total=OrdersTotal();
      for(cnt=0;cnt<OrdersTotal();cnt++)
        {
         OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
         if(OrderSymbol()==Symbol())
           {
            if(OrderOpenTime()>Time[3])
              {
               found=true;
               otype=OrderType();
               break;
              }
           }
        }
     }
   if (found==true)
     {
      if (pMAfst<=cMAslo && cMAfst>=cMAslo && otype==1)  //exist sell
        {
         OrderClose(OrderTicket(),Lots,Bid,0,Red);
         Print("BUY  Order started  ",Ask);
         OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,"BC Buy ",16123,0,White);
         if(GetLastError()==0)Comment("BC_BUY  Order opened : ",Ask);
        }
      if (pMAfst>=cMAslo && cMAfst<=cMAslo && otype==0)  // exist buy
        {
         OrderClose(OrderTicket(),Lots,Ask,0,White);
         Print("SELL Order started  ",Bid);
         OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,"BC Sell",16321,0,Red);
         if(GetLastError()==0)Comment("BC_SELL Order opened : ",Bid );
        }
     }
   else // not found, so create
     {
      if (pMAfst<=cMAslo && cMAfst>=cMAslo)  //rising
        {
         Print("BUY  Order started  ",Ask);
         OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,"BC Buy ",16123,0,White);
         if(GetLastError()==0)Comment("BC_BUY  Order opened : ",Ask);
        }
      if (pMAfst>=cMAslo && cMAfst<=cMAslo)  //falling
        {
         Print("SELL Order started  ",Bid);
         OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,"BC Sell",16321,0,Red);
         if(GetLastError()==0)Comment("BC_SELL Order opened : ",Bid );
        }
     }
   return(0);
  }
//+------------------------------------------------------------------+

Profitability Reports

USD/CHF Jul 2025 - Sep 2025
2.24
Total Trades 207
Won Trades 176
Lost trades 31
Win Rate 85.02 %
Expected payoff 0.71
Gross Profit 265.62
Gross Loss -118.46
Total Net Profit 147.16
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.09
Total Trades 198
Won Trades 1
Lost trades 197
Win Rate 0.51 %
Expected payoff -0.81
Gross Profit 16.56
Gross Loss -176.14
Total Net Profit -159.58
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.00
Total Trades 488
Won Trades 0
Lost trades 488
Win Rate 0.00 %
Expected payoff -3.05
Gross Profit 0.00
Gross Loss -1487.70
Total Net Profit -1487.70
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.30
Total Trades 260
Won Trades 2
Lost trades 258
Win Rate 0.77 %
Expected payoff -1.62
Gross Profit 177.70
Gross Loss -598.60
Total Net Profit -420.90
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.84
Total Trades 276
Won Trades 153
Lost trades 123
Win Rate 55.43 %
Expected payoff -0.71
Gross Profit 988.24
Gross Loss -1182.96
Total Net Profit -194.72
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.39
Total Trades 258
Won Trades 6
Lost trades 252
Win Rate 2.33 %
Expected payoff -2.18
Gross Profit 364.66
Gross Loss -926.92
Total Net Profit -562.26
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.00
Total Trades 460
Won Trades 0
Lost trades 460
Win Rate 0.00 %
Expected payoff -1.87
Gross Profit 0.00
Gross Loss -859.80
Total Net Profit -859.80
-100%
-50%
0%
50%
100%
USD/JPY Jan 2025 - Jul 2025
0.00
Total Trades 347
Won Trades 17
Lost trades 330
Win Rate 4.90 %
Expected payoff -3.92
Gross Profit 1.52
Gross Loss -1361.99
Total Net Profit -1360.47
-100%
-50%
0%
50%
100%
USD/CHF Jan 2025 - Jul 2025
0.28
Total Trades 198
Won Trades 8
Lost trades 190
Win Rate 4.04 %
Expected payoff -3.37
Gross Profit 261.38
Gross Loss -928.41
Total Net Profit -667.03
-100%
-50%
0%
50%
100%
USD/CAD Jan 2025 - Jul 2025
0.00
Total Trades 364
Won Trades 0
Lost trades 364
Win Rate 0.00 %
Expected payoff -2.57
Gross Profit 0.00
Gross Loss -936.76
Total Net Profit -936.76
-100%
-50%
0%
50%
100%

Comments