Breakout Expert

Profit factor:
0.38
Orders Execution
Checks for the total of open ordersIt can change open orders parameters, due to possible stepping strategyIt automatically opens orders when conditions are reached
Indicators Used
Indicator of the average true range
0 Views
0 Downloads
0 Favorites
Breakout Expert
/*

*********************************************************************
          
                       Akuma99 Sign Posts
                   Copyright © 2006  Akuma99
                  http://akuma99.blogspot.com    

       For help on this indicator, tutorials and information 
               visit http://akuma99.blogspot.com/
                  
*********************************************************************

*/

#property link        "http://akuma99.blogspot.com"
#property copyright   "© 2006 Akuma99 (http://akuma99.blogspot.com)"

extern double offset = -1;
extern int spread = 5;
extern int atrPeriod = 0;
extern int trailingStop = 50;

extern int sl = 50;
extern int lockProfit = 20;

extern bool protection=false;
extern bool tradeAllDay=false;

double hStore;
double lStore;

extern double Lots = 0.1;
double Slippage = 3;

int maxLots = 1;

int init() {
   
   return(0);

}

int start() {
   
   int total, i, err;
   double ts, diff;
   string setup = "Breakout_" + Symbol();
   
   total=OrdersTotal();
   
   /*for (i=0;i<OrdersTotal();i++){
   
      OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
      
      if(OrderSymbol()==Symbol() && OrderType()==OP_BUY && protection==true){
         if(High[0]-OrderOpenPrice()>=trailingStop*Point && OrderStopLoss()!=OrderOpenPrice() && OrderStopLoss()-OrderOpenPrice() != lockProfit){
            OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+lockProfit*Point,OrderTakeProfit(),0,White);
 
         }   
      }  
       
      if(OrderSymbol()==Symbol() && OrderType()==OP_SELL && protection==true){
         if(OrderOpenPrice()-Low[0]>=trailingStop*Point && OrderStopLoss()!=OrderOpenPrice() && OrderOpenPrice()-OrderStopLoss() != lockProfit){
            OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-lockProfit*Point,OrderTakeProfit(),0,White);
         }
      }
   
   }*/
   
   if(total < maxLots) {
      
      // no opened orders identified
      if(AccountFreeMargin()<(1000*Lots)) {
         Print("We have no money. Free Margin = ", AccountFreeMargin());
         return(0);  
      }
        
      int   j;
      
      if (TimeHour(Time[0]) == 8+offset) {
      
         double atr = iATR(NULL, 0, atrPeriod, 0);
         double h=High[1], l=Low[1];
      
         for (j=8; j>=0; j--) {
      
            if (High[j] > h) {
               h = High[j];
            }
            
            if (Low[j] < l) {
               l = Low[j];
            }
      
         }
         
         hStore = h+(spread*Point)+(atr/2);
         lStore = l-(atr/2);
      
      }
      
         if (tradeAllDay == false) {
            if (Ask >= hStore && Open[0] < hStore && TimeHour(Time[0]) > 8 && TimeHour(Time[0]) < 16) {
               placeLongTrade();
            } else if (Bid <= lStore && Open[0] > lStore && TimeHour(Time[0]) > 8 && TimeHour(Time[0]) < 16) {
               placeShortTrade();
            }
         } else if (tradeAllDay == true) {
            if (Ask >= hStore && Open[0] < hStore) {
               placeLongTrade();
            } else if (Bid <= lStore && Open[0] > lStore) {
               placeShortTrade();
            }
         }
         
      }
      
   return(0);

}

void placeLongTrade () {

   double ticket;

   ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-(40*Point),Ask+50*Point,"macd sample",16384,0,Blue);
    
   if(ticket>0) {
      if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
   } else {
      Print("Error opening BUY order : ",GetLastError()); 
      return(0); 
   }

}

void placeShortTrade () {
   
   double ticket;

   ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+(40*Point),Bid-50*Point,"macd sample",16384,0,Red);
  
   if(ticket>0) {
      if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
   } else {
      Print("Error opening SELL order : ",GetLastError());  
      return(0);   
   }

}

Profitability Reports

USD/CAD Oct 2024 - Jan 2025
0.48
Total Trades 449
Won Trades 124
Lost trades 325
Win Rate 27.62 %
Expected payoff -1.08
Gross Profit 442.54
Gross Loss -928.13
Total Net Profit -485.59
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.09
Total Trades 908
Won Trades 60
Lost trades 848
Win Rate 6.61 %
Expected payoff -3.41
Gross Profit 300.00
Gross Loss -3392.00
Total Net Profit -3092.00
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.57
Total Trades 898
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -1.17
Gross Profit 1410.00
Gross Loss -2464.00
Total Net Profit -1054.00
-100%
-50%
0%
50%
100%

Comments