Forex_CashCow_r1

Profit factor:
0.56
Price Data Components
Series array that contains open time of each bar
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reachedIt Closes Orders by itself It can change open orders parameters, due to possible stepping strategy
3 Views
1 Downloads
0 Favorites
Forex_CashCow_r1


extern int     Delta       = 140;
extern int     CurLoDist   = 70;
extern int     PrevHiDist  = 30;
extern int     SL          = 60;
extern int     TP          = 100;

int            PrevBarHiLo, LastDayTrade;
int            JT_SL,                                 // Jumlah Trades Sell Limit
               JT_BL,                                 // Jumlah Trades Buy Limit
               JT_SS,                                 // Jumlah Trades Sell Stop
               JT_BS,                                 // Jumlah Trades Buy Stop
               JT_OS,                                 // Jumlah Trades Open Sell
               JT_OB;                                 // Jumlah Trades Open Buy

int start()
{
   PrevBarHiLo = (High[1]-Low[1])/Point;
   if (PrevBarHiLo >= Delta)                          // Req.#1
   {
      if (Open[1]>Close[1])                           // Sell Direction
      {
         if ((Low[1]-Bid)/Point>=PrevHiDist)          // Req.#2
         {
            if ((High[0]-Bid)/Point>=CurLoDist)       // Req.#3
            {
               if (OrdersTotal()<=0 && TimeDayOfYear(CurTime())!=LastDayTrade)
               {
                  LastDayTrade=TimeDayOfYear(CurTime());
                  OrderSend(Symbol(),OP_SELL,1,Bid,0,Bid+(SL*Point),Bid-(TP*Point),"Sell",0,0,Red);
               }
            }
         }
      }
      
      if (Open[1]<Close[1])                           // Buy Direction
      {
         if ((Ask-High[1])/Point>=PrevHiDist)         // Req.#2
         {
            if ((Ask-Low[0])/Point>=CurLoDist)        // Req.#3
            {
               if (OrdersTotal()<=0 && TimeDayOfYear(CurTime())!=LastDayTrade)
               {
                  LastDayTrade=TimeDayOfYear(CurTime());
                  OrderSend(Symbol(),OP_BUY,1,Ask,0,Ask-(SL*Point),Ask+(TP*Point),"Buy",0,0,Blue);
               }
            }
         }
      }
   }
   ChkAllTrd();
   if (JT_OS>0 || JT_OB>0)
   {
      SetSLtoBEP();
      if (TimeHour(CurTime())==23 && TimeMinute(CurTime())==30)
      {
         TutupOpenPosisi();
      }
   }
   return(0);
}

void ChkAllTrd()
{
   int ecnt, total;
   JT_SL=0;
   JT_BL=0;
   JT_SS=0;
   JT_BS=0;
   JT_OS=0;
   JT_OB=0;
   total=OrdersTotal();
   for (ecnt=0;ecnt<total;ecnt++)
   {
      OrderSelect(ecnt,SELECT_BY_POS, MODE_TRADES);
      if       (OrderType()==OP_SELLLIMIT && OrderSymbol()==Symbol())
         JT_SL++;
      else if  (OrderType()==OP_BUYLIMIT  && OrderSymbol()==Symbol())
         JT_BL++;         
      else if  (OrderType()==OP_SELLSTOP  && OrderSymbol()==Symbol())
         JT_SS++;
      else if  (OrderType()==OP_BUYSTOP   && OrderSymbol()==Symbol())
         JT_BS++;         
      else if  (OrderType()==OP_SELL      && OrderSymbol()==Symbol())
         JT_OS++;
      else if  (OrderType()==OP_BUY       && OrderSymbol()==Symbol())
         JT_OB++;         
   }
}

void TutupOpenPosisi()
{
   int total=OrdersTotal();
   int ecnt;
   for (ecnt=0;ecnt<total;ecnt++)
   {
      OrderSelect(ecnt,SELECT_BY_POS, MODE_TRADES);
      OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),0,Indigo);
   }
}

void SetSLtoBEP()
{
   int total=OrdersTotal();
   int ecnt;
   for (ecnt=0;ecnt<total;ecnt++)
   {
      OrderSelect(ecnt,SELECT_BY_POS, MODE_TRADES);
      if (OrderProfit()/10>=30)
      {
         OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Brown);
      }
   }
}

Profitability Reports

USD/CAD Jul 2025 - Sep 2025
0.37
Total Trades 50
Won Trades 9
Lost trades 41
Win Rate 18.00 %
Expected payoff -22.67
Gross Profit 654.97
Gross Loss -1788.68
Total Net Profit -1133.71
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.93
Total Trades 23
Won Trades 8
Lost trades 15
Win Rate 34.78 %
Expected payoff -2.48
Gross Profit 800.00
Gross Loss -857.00
Total Net Profit -57.00
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 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%
EUR/USD Jul 2025 - Sep 2025
0.98
Total Trades 56
Won Trades 21
Lost trades 35
Win Rate 37.50 %
Expected payoff -0.70
Gross Profit 2061.00
Gross Loss -2100.00
Total Net Profit -39.00
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.80
Total Trades 26
Won Trades 8
Lost trades 18
Win Rate 30.77 %
Expected payoff -7.92
Gross Profit 800.00
Gross Loss -1006.00
Total Net Profit -206.00
-100%
-50%
0%
50%
100%
USD/CAD Oct 2024 - Jan 2025
0.61
Total Trades 63
Won Trades 18
Lost trades 45
Win Rate 28.57 %
Expected payoff -11.78
Gross Profit 1180.72
Gross Loss -1923.07
Total Net Profit -742.35
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.26
Total Trades 50
Won Trades 7
Lost trades 43
Win Rate 14.00 %
Expected payoff -37.18
Gross Profit 667.00
Gross Loss -2526.00
Total Net Profit -1859.00
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.40
Total Trades 67
Won Trades 13
Lost trades 54
Win Rate 19.40 %
Expected payoff -28.96
Gross Profit 1300.00
Gross Loss -3240.00
Total Net Profit -1940.00
-100%
-50%
0%
50%
100%
AUD/USD Oct 2024 - Jan 2025
0.65
Total Trades 54
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -14.76
Gross Profit 1500.00
Gross Loss -2297.00
Total Net Profit -797.00
-100%
-50%
0%
50%
100%

Comments