RangeLeaderBarv11

Author: Copyright � 2006, Quadrant Pacific Capital Corp.
Profit factor:
0.66
Orders Execution
Checks for the total of open ordersIt Closes Orders by itself It automatically opens orders when conditions are reached
Miscellaneous
It issuies visual alerts to the screen
10 Views
0 Downloads
0 Favorites
RangeLeaderBarv11
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                               RangeLeaderBar.mq4 |
//|                 Copyright © 2006, Quadrant Pacific Capital Corp. |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Quadrant Pacific Capital Corp."
#property link      ""

//+------------------------------------------------------------------+
//| External Variables                                               |
//+------------------------------------------------------------------+

extern double    Lots=1.0;
extern double    StopLoss=1000.0;
extern double    TakeProfit=1000.0;
extern double    TrailingStop=0.0;
extern double    OpenSlippage=3.0;
extern double    CloseSlippage=30.0;
extern double    ModifiedStopLoss=30.0;

//+------------------------------------------------------------------+
//| Global Variables                                                 |
//+------------------------------------------------------------------+

double PBH = 0;
double PBL = 0;
double PBR = 0;
double CBH = 0;
double CBL = 0;
double CBR = 0;
double CBM = 0;

int i,CurrentTrade;

//+------------------------------------------------------------------+
//| Initialization                                                   |
//+------------------------------------------------------------------+

int init()
   {
   return(0);
   }

//+------------------------------------------------------------------+
//| Chart movement execution                                         |
//+------------------------------------------------------------------+

int start()
   {
//+------------------------------------------------------------------+
//| Local variables                                                  |
//+------------------------------------------------------------------+

	//set variables previous bar info and current bar info from the previous 2 bars
	PBH=High[2];
	PBL=Low[2];
	PBR=PBH-PBL;
	CBH=High[1];
	CBL=Low[1];
	CBR=CBH-CBL;
	CBM=(CBH+CBL)/2;
	
	                                                        //Check if Buy state reached
	if(CBR>PBR && CBM>PBH)
      {                                //if there's already a trade open, check it
      CurrentTrade=0;
      if(OrdersTotal()>0)                                     //see if there are any open contracts       
         {
         for(i=OrdersTotal()-1;i>=0;i--)
            {
            OrderSelect(i,SELECT_BY_POS,MODE_TRADES);              //if it's a Sell close it
            if(OrderType() == OP_SELL && OrderSymbol()==Symbol())
               OrderClose(OrderTicket(),OrderLots(),Ask,CloseSlippage,Red);
            if(OrderType() == OP_BUY && OrderSymbol()==Symbol()) CurrentTrade=1;
            }
         }
      if(CurrentTrade==0)                                  //if theres no trades open one up
         {
         Alert("Buying "+Lots+" "+Symbol()+" @ "+DoubleToStr(Ask,Digits));
         OrderSend(Symbol(),OP_BUY,Lots,Ask,OpenSlippage,Ask-StopLoss*Point,Ask+TakeProfit*Point,"",0,0,Green);
   	   }
      return(0);
	   }
	
	if (CBR>PBR && CBM<PBL)                               //Check if Sell state reached
      {
      CurrentTrade=0;
      if(OrdersTotal()>0)                                     //see if there are any open contracts       
         {
         for(i=OrdersTotal()-1;i>=0;i--)
            {
            OrderSelect(i,SELECT_BY_POS,MODE_TRADES);              //if it's a Buy close it
            if(OrderType() == OP_BUY && OrderSymbol()==Symbol())
               OrderClose(OrderTicket(),OrderLots(),Bid,CloseSlippage,Red);
            if(OrderType() == OP_SELL && OrderSymbol()==Symbol()) CurrentTrade=1;
            }
         }
      if(CurrentTrade==0)                                  //if theres no trades open one up
         {
         Alert("Selling "+Lots+" "+Symbol()+" @ "+DoubleToStr(Bid,Digits));
         OrderSend(Symbol(),OP_SELL,Lots,Bid,OpenSlippage,Bid+StopLoss*Point,Bid-TakeProfit*Point,"",0,0,Green);
   	   }
      return(0);
      }
   }

Profitability Reports

USD/JPY Jul 2025 - Sep 2025
1.12
Total Trades 313
Won Trades 124
Lost trades 189
Win Rate 39.62 %
Expected payoff 8.50
Gross Profit 25696.79
Gross Loss -23035.35
Total Net Profit 2661.44
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.98
Total Trades 1102
Won Trades 524
Lost trades 578
Win Rate 47.55 %
Expected payoff -8.79
Gross Profit 484128.00
Gross Loss -493814.00
Total Net Profit -9686.00
-100%
-50%
0%
50%
100%
EUR/USD Oct 2025 - Feb 2026
0.85
Total Trades 520
Won Trades 171
Lost trades 349
Win Rate 32.88 %
Expected payoff -8.89
Gross Profit 27129.00
Gross Loss -31752.00
Total Net Profit -4623.00
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.78
Total Trades 294
Won Trades 105
Lost trades 189
Win Rate 35.71 %
Expected payoff -18.31
Gross Profit 19371.23
Gross Loss -24753.89
Total Net Profit -5382.66
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.74
Total Trades 184
Won Trades 59
Lost trades 125
Win Rate 32.07 %
Expected payoff -36.85
Gross Profit 19515.00
Gross Loss -26296.00
Total Net Profit -6781.00
-100%
-50%
0%
50%
100%
USD/CAD Oct 2024 - Jan 2025
0.72
Total Trades 178
Won Trades 59
Lost trades 119
Win Rate 33.15 %
Expected payoff -21.67
Gross Profit 10142.25
Gross Loss -14000.17
Total Net Profit -3857.92
-100%
-50%
0%
50%
100%
AUD/USD Oct 2024 - Jan 2025
0.67
Total Trades 192
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -34.51
Gross Profit 13588.00
Gross Loss -20213.00
Total Net Profit -6625.00
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.67
Total Trades 174
Won Trades 56
Lost trades 118
Win Rate 32.18 %
Expected payoff -32.11
Gross Profit 11219.00
Gross Loss -16806.00
Total Net Profit -5587.00
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.67
Total Trades 310
Won Trades 104
Lost trades 206
Win Rate 33.55 %
Expected payoff -31.05
Gross Profit 19217.00
Gross Loss -28843.00
Total Net Profit -9626.00
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.64
Total Trades 333
Won Trades 103
Lost trades 230
Win Rate 30.93 %
Expected payoff -18.98
Gross Profit 11033.84
Gross Loss -17354.10
Total Net Profit -6320.26
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.57
Total Trades 359
Won Trades 99
Lost trades 260
Win Rate 27.58 %
Expected payoff -25.09
Gross Profit 11711.00
Gross Loss -20718.00
Total Net Profit -9007.00
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.42
Total Trades 162
Won Trades 42
Lost trades 120
Win Rate 25.93 %
Expected payoff -58.65
Gross Profit 6820.03
Gross Loss -16320.83
Total Net Profit -9500.80
-100%
-50%
0%
50%
100%
AUD/USD Oct 2025 - Feb 2026
0.39
Total Trades 218
Won Trades 58
Lost trades 160
Win Rate 26.61 %
Expected payoff -44.96
Gross Profit 6313.00
Gross Loss -16114.00
Total Net Profit -9801.00
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.38
Total Trades 232
Won Trades 58
Lost trades 174
Win Rate 25.00 %
Expected payoff -42.35
Gross Profit 5898.00
Gross Loss -15724.00
Total Net Profit -9826.00
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.27
Total Trades 86
Won Trades 15
Lost trades 71
Win Rate 17.44 %
Expected payoff -111.93
Gross Profit 3547.04
Gross Loss -13172.67
Total Net Profit -9625.63
-100%
-50%
0%
50%
100%

Comments