Navigation:Home > Content >

FXAnt_1.3_usdcad_h1.mq4

Time: 2013-06-10 | Download file:FXAnt_1.3_usdcad_h1.mq4

//+------------------------------------------------------------------+
//|                                                        FXAnt.mq4 |
//|                           Copyright © 2006, Renato P. dos Santos |
//|                                            http://www.reniza.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Renato P. dos Santos"
#property link      "http://www.reniza.com"

extern int MaxTrades=2;
extern double lots=1;
extern int stoploss=50,takeprofit=70;
extern bool UseHourTrade = False;
extern int  FromHourTrade = 8;
extern int  ToHourTrade = 18;
extern bool UseStoFilter=true;
extern int StoTF=240,K=5,D=3,SL=3,Confirm=1;

extern bool UseBothLinesMode=false;


int ID=983789;

void deinit() {
   Comment("");
}

int orderscnt(){
int cnt=0;
   for(int i =0;i=FromHourTrade&&Hour()<=ToHourTrade)){
   Comment("Non-Trading Hours!");
   return(0);
   }
   }
  int x=Confirm;
  double sl,tp;
   
   
   if (Period() < 30) {Comment("change to M30 or higher pls"); return(0); }
   if (MathMod(Minute(),Period()) >= 0.5*Period()) return(0);

   if ((High[0]-Low[0])>10*Point && Open[0]<(High[0]+Low[0])/2 && Ask < Open[0]){
      if(orderscnt()sto(2,x)) && (!UseBothLinesMode || sto(1,x)>80 && sto(2,x)>80) ){
         if(stoploss==0){sl=0;}else{sl=Bid-stoploss*Point;}
         if(takeprofit==0){tp=0;}else{tp=Bid+takeprofit*Point;}
         OrderSend(Symbol(),OP_BUY,lots,Ask,2,sl,tp,"FXAnt",ID,0,Blue); 
      }
   }
   if ((High[0]-Low[0])>10*Point && Open[0]>(High[0]+Low[0])/2 && Bid > Open[0]){
      if(orderscnt()        

Recommend