Author: Maximus_genuine
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reached
0 Views
0 Downloads
0 Favorites

Profitability Reports

AUD/USD Oct 2024 - Jan 2025
102.00 %
Total Trades 27
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff 0.80
Gross Profit 1166.10
Gross Loss -1144.50
Total Net Profit 21.60
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
89.00 %
Total Trades 57
Won Trades 27
Lost trades 30
Win Rate 0.47 %
Expected payoff -5.42
Gross Profit 2398.70
Gross Loss -2707.60
Total Net Profit -308.90
-100%
-50%
0%
50%
100%
Precipice
//+------------------------------------------------------------------+
//|                                                    Precipice.mq4 |
//|                                                Maximus_genuine   |
//|                                               gladmxm@bigmir.net |
//+------------------------------------------------------------------+
#property copyright "Maximus_genuine  "
#property link      "gladmxm@bigmir.net"

//---- input parameters
//..........................................................................
extern bool      In_BUY   =true;
extern int       step_BUY =89;       //---âõîäíûå ïàðàìåòðû ïî ëîíãàì
extern int       level_BUY=67;  

//..........................................................................
extern bool      In_SELL   =true;
extern int       step_SELL =89;      //---âõîäíûå ïàðàìåòðû ïî øîðòàì
extern int       level_SELL=67; 

//..........................................................................
 
//---- other parameters
   static int  prevtime=0;
          int    ticket=0;
          int         x=1;
       //-------------------------
          int Magic_BUY  =123;
          int Magic_SELL =321;
         
 
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//--------------------------------
      if(Digits == 5) x=10;
      
      MathSrand(GetTickCount());
//--------------------------------
    if (step_BUY< 20)  step_BUY=20;
    if (step_SELL<20) step_SELL=20;
    
    if( level_BUY< 1) level_BUY= 1;
    if( level_BUY>99) level_BUY=99;
    
    if( level_SELL<1 ) level_SELL= 1;
    if( level_SELL>99) level_SELL=99;
//--------------------------------
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//..........................................................................
    if (Time[0] == prevtime) return(0); 
                             prevtime = Time[0];
    if (!IsTradeAllowed()) {
     prevtime=Time[1]; Sleep(30000 + MathRand());  //--- ôîðìèðîâêà áàðà---
                           }
//..........................................................................
 
 
                My_Play( Magic_BUY, In_BUY, level_BUY, step_BUY);    //---òîðãîâëÿ ïî ëîíãàì
   
   
                My_Play(Magic_SELL,In_SELL,level_SELL,step_SELL);  //---òîðãîâëÿ  ïî øîðòàì
   
   
//..........................................................................
   return(0);//-----------âûõîä èç ñòàðòîâîé ôóíêöèè------------
  }
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
void  My_Play(int mn,bool flag,int level,int step) { 
 
         int total=OrdersTotal();
         
    for (int i = 0; i < total; i++) { OrderSelect(i, SELECT_BY_POS, MODE_TRADES);//---ïðîõîä ïî îðäåðàì--
    
    
                if (OrderSymbol() == Symbol() && OrderMagicNumber() == mn) { 
                
            
                
                return(0);
                                                                           } 
                                    }
 
//..........................................................................
      ticket = -1;  
      
   
 
  if (  flag                           &&
  
        level*327.68 > MathRand() &&    //----ðàíäîìíûé âõîä â ðûíîê ---
      
      
           IsTradeAllowed()) { 
           
           if (mn<200)      {
  
 ticket= OrderSend(Symbol(), OP_BUY,lot(),Ask,5*x,Bid-x*step*Point,Ask+x*step*Point,DoubleToStr(mn,0),mn,0,Blue);
                         
    
                            }
                         
                         
                         else {
                         
 ticket= OrderSend(Symbol(),OP_SELL,lot(),Bid,5*x,Ask+x*step*Point,Bid-x*step*Point,DoubleToStr(mn,0),mn,0, Red);
                        
                              }
        
   
                 RefreshRates();   
      
              if ( ticket < 0) { Sleep(30000);   prevtime = Time[1]; } 
                                           
                                           } //-- Exit ---
 
       return(0); } 
       
 
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
double lot() {  return(0.1);    } 
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


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