Navigation:Home > Content >

TrueScalpperV11.mq4

Time: 2016-06-04 | Download file:TrueScalpperV11.mq4

//+------------------------------------+
//| TRUE_SCALPER                       |
//+------------------------------------+
//
// This is the one used successfully by Jean-Franзois 
//
// Designed for M5 but I attached it to M15 and it worked fine.
//	long if EMA3>EMA7:::EMA3RSIPos) {RSIPOS=true;  RSINEG=false;}
   if(RSI=0;cnt--)
     {
      OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
      if( OrderSymbol()==Symbol() )
        {
         OrdersPerSymbol++;
        }
     }


   // place new order based on direction
   // only if no other orders are open on this Symbol 
   if(OrdersPerSymbol==0)
     {
      //ENTRY Ask(buy, long) 
      if(bullMA3>(bearMA7+p) && RSINEG)
		  {
		   SL=Ask-(StopLoss*p);
		   TP=Ask+(TakeProfit*p);
         OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,SL,TP,"BUY"+CurTime(),0,0,White);
         bartick=0;
        }
        
      //ENTRY Bid (sell, short)
      if(bullMA3<(bearMA7-p) && RSIPOS)
        {
		   SL=Bid+(StopLoss*p);
		   TP=Bid-(TakeProfit*p);
         OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,SL,TP,"SELL"+CurTime(),0,0,Red);
         bartick=0;
        }
     } //if


   // have we run out of ticks for average time-to-profit?
   if(OrdersPerSymbol==1 && bartick==abandon)
     {

      if(OrderType()==OP_BUY)
        {
         // close losing BUY order to avoid more loss
         OrderClose(OrderTicket(),Lots,Bid,Slippage,White);
         // setup and trade new order 
         SL=Bid+(StopLoss*p);
         TP=Bid-(TakeProfit*p);
         OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,SL,TP,"SELL"+CurTime(),0,0,Red);
         // bump bartick to prevent multiple buys
         bartick++;
        } // if BUY

      if(OrderType()==OP_SELL)
        {
         // close losing SELL order to avoid more loss
         OrderClose(OrderTicket(),Lots,Ask,Slippage,Red);
         // setup and trade new order 
         SL=Ask-(StopLoss*p);
         TP=Ask+(TakeProfit*p);
         OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,SL,TP,"BUY"+CurTime(),0,0,White);
         // bump bartick to prevent multiple buys
         bartick++;
        } //if SELL

     } //if OrdersPerSymbol
     for(cnt=0;cnt 3*Point  )
                  {
                  OrderClose(OrderTicket(),Lots,Bid,0,White);
                  return(0);
                  } // if profit made
                 } // if magic
                } // if Buy
 
         if(OrderType()==OP_SELL)
            {           
            if (OrderMagicNumber()==0)
               {
               if(  OrderOpenPrice()-Ask > (3*Point)   )
                  {
                  OrderClose(OrderTicket(),Lots,Ask,0,Red);
                  return(0);
                  } // if profit made
                 } // if magic
               } //if Sell
              } // if Symbol
             } // for



   return(0);
  } // start()

Recommend