newgrid_003

Author: Expert for tests
Profit factor:
0.01
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reached
0 Views
0 Downloads
0 Favorites
newgrid_003
#property copyright "Expert for tests"

extern double Lots = 0.1 ;
extern int max_trades = 10 ;
extern int grid_lines = 30 ;
extern double RangeMid = 1.5465 ;
extern double grid_separation = 0.0100 ;
extern double TP = 50 ;
   
int BarCount;
int Current;
bool TickCheck = False;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init() {

   return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit() {
   return(0);
}
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start() {
 
   int Entertradebuy =0 ;
   int Entertradesell =0 ;
   double level ;
   
   if(OrdersTotal()<max_trades)
   {
  for (int i = 1; i<grid_lines; i++)
   
   {
   level=GlobalVariableGet("level") ;
   if (Ask == RangeMid - grid_separation*i && level != RangeMid - grid_separation*i)
   {
   GlobalVariableSet("level", RangeMid - grid_separation*i) ;
   Entertradebuy=1 ;
   Print(level," and ", RangeMid - grid_separation*i );
   }
   if (Bid == RangeMid + grid_separation*i && level != RangeMid + grid_separation*i)
   {
   GlobalVariableSet("level", RangeMid + grid_separation*i) ;
   Entertradesell=1 ; 
   Print(level," and ",RangeMid + grid_separation*i );
   }
   }
   }
  
   
   if(Entertradebuy==1)
   {
   double Ticket1 = OrderSend(Symbol(), OP_BUY, Lots, Ask, 5, 0, Ask+TP*Point, "Buy(#" + 1 + ")", 1, 0, DodgerBlue) ;         
   }
   
   
   if(Entertradesell==1)
   {
   double Ticket2 = OrderSend(Symbol(), OP_SELL, Lots, Bid, 5, 0, Bid-TP*Point, "Sell(#" + 1 + ")", 1, 0, DeepPink) ;
   }
   

   return(0);
}
//+------------------------------------------------------------------+

Profitability Reports

USD/CAD Oct 2024 - Jan 2025
0.00
Total Trades 6
Won Trades 6
Lost trades 0
Win Rate 100.00 %
Expected payoff 3.61
Gross Profit 21.68
Gross Loss 0.00
Total Net Profit 21.68
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 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 Oct 2024 - Jan 2025
0.05
Total Trades 9
Won Trades 8
Lost trades 1
Win Rate 88.89 %
Expected payoff -83.21
Gross Profit 40.00
Gross Loss -788.90
Total Net Profit -748.90
-100%
-50%
0%
50%
100%
AUD/USD Oct 2024 - Jan 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