PROphet





//+------------------------------------------------------------------+
//|                                                      PROphet.mq4 |
//|                                                        PraVedNiK |
//|                                                  taa-34@mail.ru  |        
//+------------------------------------------------------------------+
#property link      "taa-34@mail.ru"
//--------------------------------------------------------------------
 extern bool  daBUY=true;  extern int       x1=9,x2=29,x3=94,x4=125,slb=68; 
//---------------------------------------------------------------------------
  extern bool  daSELL=true; extern int    y1=61,y2=100,y3=117,y4=31,sls=72;       

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
      //-----ÐÓËÜ íà M5_EURUSD------
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
//--------------------------------------------------------------------
   static int  prevtime = 0;    int ticket=0;   double lot=0.1;
//-----------------------------------------------------------------
int start(){    if (Time[0] == prevtime) return(0);    prevtime = Time[0];

    if (! IsTradeAllowed()) { prevtime = Time[1]; MathSrand(TimeCurrent());Sleep(30000 + MathRand());}
//-------------------------------------------------------------------------------------------------

 int total = OrdersTotal(); if(daBUY)BBB(total );if( daSELL)SSS(total ); return(0); } //--end_start--
//-------------------------------------------------------------------------------------------
void BBB(int tot) {  int sprb = MarketInfo(Symbol(), MODE_SPREAD)+2*slb;  int h=Hour();
      
                          
          for (int i = 0; i < tot; i++) { OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
  
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == 74) {//--------------------
      
      if(OrderType()==OP_BUY && h>18)OrderClose(OrderTicket(),OrderLots(),Bid,3);
      
    //----------------------------------------------------------------------------------
    
         if(Bid >(OrderStopLoss() + sprb * Point)  && OrderType()==OP_BUY)
     {   if(!OrderModify(OrderTicket(), OrderOpenPrice(),Bid-slb*Point,0,0,Blue))
                           {Sleep(30000);prevtime=Time[1];}}
    //----------------------------------------------------------------------------------
    
             
                  
         return(0);
     } 
 }//-----------------------------------------------------------------------------------------
       ticket = -1;  RefreshRates();
  //-----------------------------------------------------------------------------------------
  if (Qu(x1,x2,x3,x4)>0 && h>=10 && h<=18 && IsTradeAllowed()) { 
  
      ticket=OrderSend(Symbol(),OP_BUY,lot,Ask,4,Bid-slb*Point,0,"ÄëèííÿÊ", 74, 0, Blue); 
      
                               PlaySound("bil.wav"); 
      
              if (ticket < 0) { Sleep(30000);prevtime = Time[1]; }
                     }    //-- Exit -


 return(0); } 
//-------------------------------------------------------------------------------------------
void SSS(int tot) {   int sprs = MarketInfo(Symbol(), MODE_SPREAD)+2*sls;  int h=Hour();
                          
          for (int i = 0; i < tot; i++) { OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
  
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == 81) {//--------------------
      
    
      if(OrderType()==OP_SELL && h>18)OrderClose(OrderTicket(),OrderLots(),Ask,3);
      
    //----------------------------------------------------------------------------------
    
    
               if(Ask<(OrderStopLoss()-sprs * Point) && OrderType()==OP_SELL)
     {     if(!OrderModify(OrderTicket(),OrderOpenPrice(),Ask+sls*Point,0,0,Blue))
                           {Sleep(30000); prevtime=Time[1];}}
                  
         return(0);
     } 
 }//-----------------------------------------------------------------------------------------
      ticket = -1; RefreshRates();
  //-----------------------------------------------------------------------------------------
   if (Qu(y1,y2,y3,y4)>0 && h>=10 && h<=18 && IsTradeAllowed()) { 
    
      ticket = OrderSend(Symbol(),OP_SELL,lot,Bid,4,Ask+sls*Point,0,"ÊîðîÒûØ", 81, 0, Red); 
      
                          PlaySound("bil.wav"); 
      
                       if (ticket < 0) { Sleep(30000); prevtime = Time[1];}
                         }   //-- Exit -


 return(0); } 
//=====================================================================================================
     double Qu(int q1,int q2,int q3,int q4) {    return ((q1-100)*MathAbs(High[1]-Low[2])+
 (q2-100)*MathAbs(High[3]-Low[2])+(q3-100)*MathAbs(High[2]-Low[1])+(q4-100)*MathAbs(High[2]-Low[3]));}





Sample





Analysis



Market Information Used:

Series array that contains open time of each bar
Series array that contains the highest prices of each bar
Series array that contains the lowest prices of each bar


Indicator Curves created:


Indicators Used:



Custom Indicators Used:

Order Management characteristics:
Checks for the total of open orders

It Closes Orders by itself
It can change open orders parameters, due to possible stepping strategy
It automatically opens orders when conditions are reached

Other Features:

It plays sound alerts

BackTest : EURUSD on H1

From 2009-08-01 to 2009-10-01 Profit Factor:0.00 Total Net Profit:-19.20

BackTest : EURUSD on H1

From 2009-12-01 to 2010-01-17 Profit Factor:2.62 Total Net Profit:91.60

BackTest : EURUSD on H1

From 2010-03-01 to 2010-03-27 Profit Factor:0.38 Total Net Profit:-23.10

BackTest : EURUSD on H1

From 2010-04-01 to 2010-04-30 Profit Factor:0.00 Total Net Profit:-34.90

BackTest : EURUSD on H1

From 2010-05-01 to 2010-05-31 Profit Factor:0.00 Total Net Profit:0.00

BackTest : EURUSD on H1

From 2010-06-01 to 2010-06-30 Profit Factor:0.00 Total Net Profit:0.00

BackTest : GBPUSD on H1

From 2010-01-01 to 2010-02-27 Profit Factor:0.09 Total Net Profit:-81.90

BackTest : GBPUSD on H1

From 2010-01-01 to 2010-04-16 Profit Factor:0.00 Total Net Profit:-458.50

BackTest : USDCAD on H1

From 2009-01-01 to 2010-01-01 Profit Factor:0.33 Total Net Profit:-291.06

BackTest : USDCAD on H1

From 2009-12-01 to 2010-01-01 Profit Factor:0.22 Total Net Profit:-50.59

BackTest : USDCHF on H1

From 2009-12-01 to 2010-01-01 Profit Factor:1.71 Total Net Profit:6.07

BackTest : USDJPY on H1

From 2009-11-01 to 2009-11-30 Profit Factor:0.00 Total Net Profit:-31.07

Request Backtest for PROphet


From : (yyyy/mm/dd) To: (yyyy/mm/dd)

Pair: Period: