BigP3





#property copyright "@2009 Desynced Tech"
#property link      "http://desynced.no-ip.org/fx"

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+

datetime lastOrder;

extern int takeProfit = 60;

extern int       FastEMA=8;
extern int       FFastEMA=7;
extern int       FFFastEMA=6;
extern int       SlowEMA=17;
extern int       SSlowEMA=16;
extern int       SSSlowEMA=15;
extern int       SignalSMA=9;
extern int       SSignalSMA=8;
extern int       SSSignalSMA=7;


int ticket ;

double max = 0 ;

int MAGIC = 12;
int orderType ;
int decision () {


   
       double x = iCustom (NULL,0,"ama_slope",0,0); //azzul
       
       if ( x > 0.001 && calculateBuy(0.001 )  ) {
       
         max = x ;
        
         return(1);
       }
       
       
  
  return(0);
   

}


bool calculateBuy (double value ) {


      int pos = 0;
    
      double vals[14];   
      int z = 0;
         for(int i=1;i<5;i++) {
   
      
                   double x = iCustom (NULL,0,"ama_slope",0,i); //azzul
                   
                   double y = iCustom (NULL,0,"ama_slope",0,i+1); //azzul
                  
                  if ( x < y  ) return(false);
      
      
   }
   

   //Print("prob " , pos ,  " %"  , z );
   
   return(true);

}
int init()
  {
//----
   
//----
   return(0);
  }


void diffs (string str) {


//   double vs[14];
   
  
   for(int i=0;i<14;i++) {
   
      
      double x = iCustom (NULL,0,"ama_slope",0,i); //azzul
   //   double y = iCustom (NULL,0,"ama_slople",1,i); //vermelho 
   
   //   double diff = y -x ;
      str = StringConcatenate(str , " , " , x);
      
      
   }
   
   Print ( str ) ;

}


bool canTrade() {

   if ( Minute() == 0 ) return(false);

   if ( Hour() >= 1 && Hour() < 2 ) return (false);
   
   if ( Hour() >= 9 && Hour() < 10 ) return (false);
   
   if ( Hour() >= 13 && Hour() < 14 ) return (false);
   
   return (true);

}


//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
  
  int decision = decision();
  
  /*
  if ( OrdersTotal() > 0 ) {
      
      if ( (TimeCurrent() - lastOrder ) > 60*60*2 && orderType == OP_BUY) {
      
            OrderClose(ticket,0.1,Bid,3,Red);
      
      }
      if ( (TimeCurrent() - lastOrder ) > 60*60*2 && orderType == OP_SELL ) {
         OrderClose(ticket,0.1,Ask,3,Red);
      
      }
  
   return(0);
  }
  */
  
  double lots = 0.1;
  
  
  //if ( Hour()   == 17 || Hour() == 15 ) lots = 0.2;
  
   if ( !canTrade() ) return(0);
   if ( decision == 1 && (TimeCurrent() - lastOrder ) > (60*60*3 ) ) {
   
              
              
               if ( OrdersTotal() == 0 ) {
               //
                  //   Print("buy " , y0 , " " , y1);
              //       Print("buy ", (x0 - y0)*1000 , " ==>" , l0, " =>", val);
                      ticket = OrderSend(Symbol(),OP_BUY, lots, Ask, 3,0/* Ask-70*Point*/,Ask+takeProfit*Point,"", MAGIC, 0, Red); 
                       diffs(" buy " );
                      lastOrder = TimeCurrent();
                      orderType  = OP_BUY;
                      
               }
  
   
   }
   
    else if ( decision == -1 && (TimeCurrent() - lastOrder ) > (60*60*3 ) ) {
   
   if ( OrdersTotal() == 0 ) {
   
         
         ticket =  OrderSend(Symbol(),OP_SELL, lots, Bid, 3, 0/*Bid+70*Point*/,Bid-takeProfit*Point,"", MAGIC, 0, Red); 
         lastOrder = TimeCurrent();
         orderType = OP_SELL;
   }
  
  }

//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+



Sample





Analysis



Market Information Used:



Indicator Curves created:


Indicators Used:



Custom Indicators Used:

Order Management characteristics:
Checks for the total of open orders
It Closes Orders by itself
It automatically opens orders when conditions are reached

Other Features:

BackTest : EURUSD on H1

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

BackTest : EURUSD on H1

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

BackTest : EURUSD on H1

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

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 : USDCAD on H1

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

BackTest : USDCHF on H1

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

BackTest : USDJPY on H1

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

Request Backtest for BigP3


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

Pair: Period: