Precipice_MartIn

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

Profitability Reports

AUD/USD Oct 2024 - Jan 2025
57.00 %
Total Trades 11
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -77.87
Gross Profit 1130.00
Gross Loss -1986.60
Total Net Profit -856.60
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
160.00 %
Total Trades 24
Won Trades 12
Lost trades 12
Win Rate 0.50 %
Expected payoff 42.89
Gross Profit 2754.60
Gross Loss -1725.20
Total Net Profit 1029.40
-100%
-50%
0%
50%
100%
Precipice_MartIn
//+------------------------------------------------------------------+
//|                                             Precipice_MartIn.mq4 |
//|                                                                  |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Maximus_genuine  "
#property link      "gladmxm@bigmir.net"
 
//---- input parameters
//..........................................................................
extern bool       MartIn =true;

//..........................................................................
extern bool      In_BUY   =true;
extern int       step_BUY =89;       //---âõîäíûå ïàðàìåòðû ïî ëîíãàì
extern int       level_BUY=50;  
 
//..........................................................................
extern bool      In_SELL   =true;
extern int       step_SELL =89;      //---âõîäíûå ïàðàìåòðû ïî øîðòàì
extern int       level_SELL=50; 
 
//..........................................................................
 
//---- 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(TimeCurrent());
//--------------------------------
    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                           &&
  
         OrdersTotal()==0              &&
  
        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() {      int k=1;  if ( !MartIn ) return (0.1);
 
       if (OrdersHistoryTotal()==0) return(0.1); 
       
       int i,accTotal=OrdersHistoryTotal()-1; 
      
     
                 for  (i=accTotal;i>-1;i--)// ïåðåáîð îðäåðîâ...
                 
                            { if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==false)
                            
                       { Print("Îøèáêà ïðè äîñòóïå ê èñòîðè÷åñêîé áàçå (",GetLastError(),")");
                       
                               break; } // ðàáîòà ñ îðäåðîì ...
                               
        if(OrderCloseTime()!=0 && OrderProfit()>0)   bool mart=true; //-------
  
        if (OrderCloseTime()!=0  && OrderProfit()<0 && !mart)  k=2*k;

                                      
     }//-end-for-
             return(k*0.1);}//-----
   //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

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