Author: Copyright 2008, FXscalper
Profit factor:
0.60
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reachedIt Closes Orders by itself
7 Views
0 Downloads
0 Favorites
heikinashi
//+------------------------------------------------------------------+
//|                                                   heikinashi.mq4 |
//|                                      Copyright 2008, FX scalper  |
//|                                                                  |
//+------------------------------------------------------------------+


#property copyright "Copyright  2008, FXscalper"
#property link      ""




// “ü—̓pƒ‰ƒ[ƒ^’è‹`
extern double Lots = 1.0;
extern int SlipPage = 3;
extern  int Profit = 1000;
extern int StopLoss = 1000;




// ƒ}ƒWƒbƒNƒiƒ“ƒo[’è‹`
int MagicNumber = 111111;

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
  
  
    
//----
   // ‹¤’ʕϐ”’è‹`
   int ticket,  i;
  
   
      
     
// •½‹Ï‘«‚̎擾 
  double haopen , haclose;
   haopen=iCustom(NULL,0,"Heiken Ashi",2,1);
   haclose=iCustom(NULL,0,"Heiken Ashi",3,1);
 
 
   
  
   
   // ƒ|ƒWƒVƒ‡ƒ“‚̃`ƒFƒbƒN
   int buyTicket = -1; int sellTicket = -1;
   for (i = 0; i < OrdersTotal(); i++) {
      if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == true) {
         if(OrderSymbol() == Symbol() && OrderMagicNumber()==MagicNumber) {
            if (OrderType() == OP_BUY) buyTicket = OrderTicket();
            else if (OrderType() == OP_SELL) sellTicket = OrderTicket();
         }
      }
   }

 
  

   if (buyTicket == -1  ) {
     //ƒo[‚ÌŽn’l‚łȂ¯‚ê‚Ώˆ—–³‚µ
   if(Volume[0] > 1 || IsTradeAllowed() == false) return(0);

      if (  haopen<haclose) {
      
         // ”ƒ‚¢’•¶‚ð”­’‚·‚é
         ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, SlipPage, 
                                    Ask-StopLoss*Point,Ask+Profit*Point, NULL, MagicNumber, 0, Blue);
        
      } 
      }
      
   if (sellTicket == -1  ) {
    //ƒo[‚ÌŽn’l‚łȂ¯‚ê‚Ώˆ—–³‚µ
   if(Volume[0] > 1 || IsTradeAllowed() == false) return(0);
   
       if (haopen>haclose) {
         // ”„‚蒍•¶‚ð”­’‚·‚é
         ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, SlipPage, 
                                    Bid+StopLoss*Point,Bid-Profit*Point, NULL, MagicNumber,0 , Red);
         
      }
   }


   // ƒNƒ[ƒYðŒ
   if (buyTicket != -1 && haopen>=haclose  ) {
      // ”ƒ‚¢’•¶‚ðŒˆÏ‚·‚é
      if (OrderClose(buyTicket, OrderLots(), Bid, SlipPage, Blue) == false) {
         
      }
   } else if (sellTicket != -1 && haopen<=haclose) {
      // ”„‚蒍•¶‚ðŒˆÏ‚·‚é
      if (OrderClose(sellTicket, OrderLots(), Ask, SlipPage, Red) == false) {
         
      }
   }

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




Profitability Reports

GBP/USD Jul 2025 - Sep 2025
0.67
Total Trades 434
Won Trades 124
Lost trades 310
Win Rate 28.57 %
Expected payoff -21.20
Gross Profit 18348.00
Gross Loss -27549.00
Total Net Profit -9201.00
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.17
Total Trades 94
Won Trades 11
Lost trades 83
Win Rate 11.70 %
Expected payoff -98.56
Gross Profit 1946.68
Gross Loss -11211.53
Total Net Profit -9264.85
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.86
Total Trades 753
Won Trades 251
Lost trades 502
Win Rate 33.33 %
Expected payoff -12.85
Gross Profit 60999.00
Gross Loss -70675.00
Total Net Profit -9676.00
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.41
Total Trades 311
Won Trades 76
Lost trades 235
Win Rate 24.44 %
Expected payoff -30.71
Gross Profit 6614.00
Gross Loss -16165.00
Total Net Profit -9551.00
-100%
-50%
0%
50%
100%
USD/CAD Oct 2024 - Jan 2025
0.76
Total Trades 381
Won Trades 112
Lost trades 269
Win Rate 29.40 %
Expected payoff -12.14
Gross Profit 14689.60
Gross Loss -19316.56
Total Net Profit -4626.96
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.59
Total Trades 397
Won Trades 119
Lost trades 278
Win Rate 29.97 %
Expected payoff -24.19
Gross Profit 13991.00
Gross Loss -23593.00
Total Net Profit -9602.00
-100%
-50%
0%
50%
100%
AUD/USD Oct 2024 - Jan 2025
0.82
Total Trades 390
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -10.26
Gross Profit 17913.00
Gross Loss -21913.00
Total Net Profit -4000.00
-100%
-50%
0%
50%
100%

Comments