escape-easy NO STOP

Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reachedIt Closes Orders by itself
Miscellaneous
It plays sound alerts
0 Views
0 Downloads
0 Favorites

Profitability Reports

AUD/USD Oct 2024 - Jan 2025
53.00 %
Total Trades 4237
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -2.25
Gross Profit 10827.00
Gross Loss -20377.60
Total Net Profit -9550.60
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
55.00 %
Total Trades 4641
Won Trades 3961
Lost trades 680
Win Rate 0.85 %
Expected payoff -2.07
Gross Profit 11883.00
Gross Loss -21471.00
Total Net Profit -9588.00
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
46.00 %
Total Trades 3379
Won Trades 2832
Lost trades 547
Win Rate 0.84 %
Expected payoff -2.90
Gross Profit 8496.00
Gross Loss -18304.40
Total Net Profit -9808.40
-100%
-50%
0%
50%
100%
escape-easy NO STOP
//+------------------------------------------------------------------+
//|                                                       escape.mq4 |
//|                                    Copyright © 2009, OGUZ BAYRAM |
//|                                            es_cape77@hotmail.com |
//+------------------------------------------------------------------+
extern double lTakeProfit = 30;
extern double sTakeProfit = 30;
extern double lStopLoss = 300;
extern double sStopLoss = 300;
extern color clOpenBuy = Green;
extern color clOpenSell = Red;
extern string Name_Expert = "escape";
extern int Slippage = 5;
extern bool UseSound = false;
extern bool FractionalPips = true;
extern string NameFileSound = "dr alban.wav";
extern double Lots = 0.1;
extern int MaxOrders=10;      //Max numbre of open orders;
extern int Multiply=3;        //Value to multiply by max orders and obtain take profit;

double Profit=0;     //Inventory all orders and see if profit is equal or higher than MazOrders multiplied by the desired take profit

void deinit() {
   Comment("");
}
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start(){
   if(Bars<100){
      Print("bars less than 100");
      return(0);
   }
   if (Digits==3 || Digits==5)
   if(lTakeProfit<1){
      Print("TakeProfit less than 1");
      return(0);
   }
   if(sTakeProfit<1){
      Print("TakeProfit less than 1");
      return(0);
   }
   InventoryOrders();
   if (Profit>(MaxOrders*Multiply)) CloseAll();
   
   double diClose0=iClose(NULL,5,0);
   double diMA1=iMA(NULL,5,5,0,MODE_SMA,PRICE_OPEN,1);
   double diClose2=iClose(NULL,5,0);
   double diMA3=iMA(NULL,5,4,0,MODE_SMA,PRICE_OPEN,1);

   if(AccountFreeMargin()<(1000*Lots)){
      Print("We have no money. Free Margin = ", AccountFreeMargin());
      return(0);
   }
   if (!ExistPositions()){

      if ((diClose0<diMA1)){
         OpenBuy();
         return(0);
      }

      if ((diClose2>diMA3)){
         OpenSell();
         return(0);
      }
   }
   
   return (0);
}

bool ExistPositions() {
for (int i=MaxOrders; i<OrdersTotal(); i++) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol()==Symbol()) {
return(True);
}
} 
} 
return(false);
}
void OpenBuy() { 
   double ldLot, ldStop, ldTake; 
   string lsComm; 
   ldLot = GetSizeLot(); 
   ldStop = GetStopLossBuy(); 
   ldTake = GetTakeProfitBuy(); 
   lsComm = GetCommentForOrder(); 
   OrderSend(Symbol
(),OP_BUY,ldLot,Ask,Slippage,ldStop,ldTake,lsComm,0,0,clOpenBuy); 
   if (UseSound) PlaySound(NameFileSound); 
} 
void OpenSell() { 
   double ldLot, ldStop, ldTake; 
   string lsComm; 

   ldLot = GetSizeLot(); 
   ldStop = GetStopLossSell(); 
   ldTake = GetTakeProfitSell(); 
   lsComm = GetCommentForOrder(); 
   OrderSend(Symbol
(),OP_SELL,ldLot,Bid,Slippage,ldStop,ldTake,lsComm,0,0,clOpenSell); 
   if (UseSound) PlaySound(NameFileSound); 
} 
string GetCommentForOrder() { return(Name_Expert); } 
double GetSizeLot() { return(Lots); } 
double GetTakeProfitBuy() { return(Ask+lTakeProfit*Point); } 
double GetTakeProfitSell() { return(Bid-sTakeProfit*Point); }
double GetStopLossBuy() { return(Bid-lStopLoss*Point); }
double GetStopLossSell() { return(Ask+sStopLoss*Point); }

     void InventoryOrders()
      {
      Profit=0;
      int Buys = 0, Sells = 0, BuyLimits = 0, SellLimits = 0;
      for(int cnt = OrdersTotal() - 1 ; cnt >= 0 ; cnt-- )
        {
         OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
         if(OrderSymbol() == Symbol())
           {
            if(OrderType() == OP_BUY)
              {
               Profit=Profit+OrderProfit(); //Buys++;
              }
            if(OrderType() == OP_SELL)
              {
               Profit=Profit+OrderProfit(); //Sells++;
              }
            if(OrderType() == OP_BUYLIMIT)
              {
               Profit=Profit+OrderProfit(); //Sells++;
              }
            if(OrderType() == OP_SELLLIMIT)
              {
               Profit=Profit+OrderProfit(); //Sells++;
              }
           }
        }}
        
void CloseAll() 
{
   int l_cmd_8;
   int li_unused_12;
   int l_ord_total_0 = OrdersTotal();
   for (int l_pos_4 = l_ord_total_0 - 1; l_pos_4 >= 0; l_pos_4--) 
   {
      OrderSelect(l_pos_4, SELECT_BY_POS);
      l_cmd_8 = OrderType();
      li_unused_12 = 0;

      switch (l_cmd_8) 
      {
      case OP_BUY:
         li_unused_12 = OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), Slippage, Red);
         break;
      case OP_SELL:
         li_unused_12 = OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), Slippage, Red);
         break;
      case OP_BUYLIMIT:
      case OP_BUYSTOP:
      case OP_SELLLIMIT:
      case OP_SELLSTOP:
         li_unused_12 = OrderDelete(OrderTicket());
      }
   }
}     

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 ---