Waddah Attar Win

Profit factor:
1.64
Orders Execution
It automatically opens orders when conditions are reachedChecks for the total of open ordersIt Closes Orders by itself
6 Views
0 Downloads
0 Favorites
Waddah Attar Win
#property link      "waddahattar@hotmail.com"
 
extern int     Step=120;
extern double  FirstLot=0.1;
extern double  IncLot=0;
extern double  MinProfit=450;
extern int     Magic = 2008;

double gLotSell=0;
double gLotBuy=0;
double LSP,LBP;

int init()
{
  Comment("Waddah Attar Win");
  GlobalVariableSet("OldBalance",AccountBalance());
  return(0);
}
int deinit()
{
  Comment("");
  return(0);
}
int start()
{
  double i;
  double sl,p;

  if (AccountEquity()>=GlobalVariableGet("OldBalance")+MinProfit)
  {
    DeletePendingOrders(Magic);
    CloseOrders(Magic);
    GlobalVariableSet("OldBalance",0);
  }

  GlobalVariableSet("OldBalance",AccountBalance());

  if (MyOrdersTotal(Magic)==0)
  {
    OrderSend(Symbol(),OP_BUYLIMIT,FirstLot,Ask-Step*Point,3,0,0,"",Magic,0,Green);
    OrderSend(Symbol(),OP_SELLLIMIT,FirstLot,Bid+Step*Point,3,0,0,"",Magic,0,Red);
  }

  LSP=GetLastSellPrice(Magic);
  LBP=GetLastBuyPrice(Magic);
  
  if((LSP-Bid)<=5*Point)
  {
    OrderSend(Symbol(),OP_SELLLIMIT,gLotSell+IncLot,LSP+Step*Point,3,0,0,"",Magic,0,Red);
  }

  if((Ask-LBP)<=5*Point)
  {
    OrderSend(Symbol(),OP_BUYLIMIT,gLotBuy+IncLot,LBP-Step*Point,3,0,0,"",Magic,0,Red);
  }

  return(0);
}

int DeletePendingOrders(int Magic)
{
  int total  = OrdersTotal();
  
  for (int cnt = total-1 ; cnt >= 0 ; cnt--)
  {
    OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
    if (OrderMagicNumber() == Magic && OrderSymbol()==Symbol() && (OrderType()!=OP_BUY || OrderType()!=OP_SELL))
    {
      OrderDelete(OrderTicket());
    }
  }
  return(0);
}

int CloseOrders(int Magic)
{
  int total  = OrdersTotal();
  
  for (int cnt = total-1 ; cnt >= 0 ; cnt--)
  {
    OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
    if (OrderMagicNumber() == Magic && OrderSymbol()==Symbol())
    {
      if (OrderType()==OP_BUY)
      {
        OrderClose(OrderTicket(),OrderLots(),Bid,3);
      }
      
      if (OrderType()==OP_SELL)
      {
        OrderClose(OrderTicket(),OrderLots(),Ask,3);
      }
    }
  }
  return(0);
}

int MyOrdersTotal(int Magic)
{
  int c=0;
  int total  = OrdersTotal();

  for (int cnt = 0 ; cnt < total ; cnt++)
  {
    OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
    if (OrderMagicNumber() == Magic && OrderSymbol()==Symbol())
    {
      c++;
    }
  }
  return(c);
}

double GetLastBuyPrice(int Magic)
{
  int total=OrdersTotal()-1;

  for (int cnt = total ; cnt >=0 ; cnt--)
  {
    OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
    if (OrderMagicNumber() == Magic && OrderSymbol()==Symbol() && (OrderType()==OP_BUYLIMIT || OrderType()==OP_BUY))
    {
      gLotBuy=OrderLots();
      return(OrderOpenPrice());
      break;
    }
  }
  return(0);
}

double GetLastSellPrice(int Magic)
{
  int total=OrdersTotal()-1;

  for (int cnt = total ; cnt >=0 ; cnt--)
  {
    OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
    if (OrderMagicNumber() == Magic && OrderSymbol()==Symbol() && (OrderType()==OP_SELLLIMIT ||OrderType()==OP_SELL))
    {
      gLotSell=OrderLots();
      return(OrderOpenPrice());
      break;
    }
  }
  return(100000);
}

Profitability Reports

NZD/USD Jul 2025 - Sep 2025
3.74
Total Trades 65
Won Trades 42
Lost trades 23
Win Rate 64.62 %
Expected payoff 26.58
Gross Profit 2359.80
Gross Loss -631.80
Total Net Profit 1728.00
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
2.59
Total Trades 181
Won Trades 117
Lost trades 64
Win Rate 64.64 %
Expected payoff 27.36
Gross Profit 8056.30
Gross Loss -3104.80
Total Net Profit 4951.50
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
1.59
Total Trades 142
Won Trades 79
Lost trades 63
Win Rate 55.63 %
Expected payoff 14.17
Gross Profit 5398.70
Gross Loss -3387.02
Total Net Profit 2011.68
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
1.60
Total Trades 207
Won Trades 131
Lost trades 76
Win Rate 63.29 %
Expected payoff 13.33
Gross Profit 7341.98
Gross Loss -4582.23
Total Net Profit 2759.75
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
2.59
Total Trades 60
Won Trades 40
Lost trades 20
Win Rate 66.67 %
Expected payoff 27.21
Gross Profit 2658.20
Gross Loss -1025.30
Total Net Profit 1632.90
-100%
-50%
0%
50%
100%
USD/JPY Jul 2025 - Sep 2025
2.25
Total Trades 256
Won Trades 167
Lost trades 89
Win Rate 65.23 %
Expected payoff 21.40
Gross Profit 9855.06
Gross Loss -4376.02
Total Net Profit 5479.04
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
3.13
Total Trades 93
Won Trades 58
Lost trades 35
Win Rate 62.37 %
Expected payoff 35.66
Gross Profit 4870.59
Gross Loss -1554.22
Total Net Profit 3316.37
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
4.54
Total Trades 84
Won Trades 55
Lost trades 29
Win Rate 65.48 %
Expected payoff 25.88
Gross Profit 2787.28
Gross Loss -613.68
Total Net Profit 2173.60
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
3.74
Total Trades 65
Won Trades 43
Lost trades 22
Win Rate 66.15 %
Expected payoff 26.62
Gross Profit 2362.70
Gross Loss -632.20
Total Net Profit 1730.50
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
2.59
Total Trades 181
Won Trades 117
Lost trades 64
Win Rate 64.64 %
Expected payoff 27.36
Gross Profit 8056.30
Gross Loss -3104.80
Total Net Profit 4951.50
-100%
-50%
0%
50%
100%

Comments