Waddah Attar Win

Profit factor:
1.32
Orders Execution
It automatically opens orders when conditions are reachedChecks for the total of open ordersIt Closes Orders by itself
4 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

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%
GBP/CAD Jul 2025 - Sep 2025
2.80
Total Trades 164
Won Trades 105
Lost trades 59
Win Rate 64.02 %
Expected payoff 24.78
Gross Profit 6324.01
Gross Loss -2260.80
Total Net Profit 4063.21
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
1.58
Total Trades 207
Won Trades 132
Lost trades 75
Win Rate 63.77 %
Expected payoff 13.02
Gross Profit 7361.96
Gross Loss -4666.38
Total Net Profit 2695.58
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.89
Total Trades 17
Won Trades 8
Lost trades 9
Win Rate 47.06 %
Expected payoff -6178.72
Gross Profit 843944.80
Gross Loss -948983.00
Total Net Profit -105038.20
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
2.60
Total Trades 60
Won Trades 40
Lost trades 20
Win Rate 66.67 %
Expected payoff 27.27
Gross Profit 2657.70
Gross Loss -1021.50
Total Net Profit 1636.20
-100%
-50%
0%
50%
100%
USD/JPY Jan 2025 - Jul 2025
2.39
Total Trades 1043
Won Trades 695
Lost trades 348
Win Rate 66.63 %
Expected payoff 22.20
Gross Profit 39761.74
Gross Loss -16608.26
Total Net Profit 23153.48
-100%
-50%
0%
50%
100%
USD/CHF Jan 2025 - Jul 2025
0.32
Total Trades 112
Won Trades 57
Lost trades 55
Win Rate 50.89 %
Expected payoff -71.44
Gross Profit 3723.14
Gross Loss -11724.55
Total Net Profit -8001.41
-100%
-50%
0%
50%
100%
NZD/USD Jan 2025 - Jul 2025
0.61
Total Trades 157
Won Trades 85
Lost trades 72
Win Rate 54.14 %
Expected payoff -25.72
Gross Profit 6410.00
Gross Loss -10447.60
Total Net Profit -4037.60
-100%
-50%
0%
50%
100%

Comments