Author: Copyright 2008, FXscalper
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reachedIt Closes Orders by itself
0 Views
0 Downloads
0 Favorites

Profitability Reports

AUD/USD Oct 2024 - Jan 2025
82.00 %
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%
NZD/USD Oct 2024 - Jan 2025
59.00 %
Total Trades 397
Won Trades 119
Lost trades 278
Win Rate 0.30 %
Expected payoff -24.19
Gross Profit 13991.00
Gross Loss -23593.00
Total Net Profit -9602.00
-100%
-50%
0%
50%
100%
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);
  }
//+------------------------------------------------------------------+




Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---