Unlocking the Nevalyashka 10-Line EA: A Friendly Guide for MT4 Traders

Mike 2016.03.22 16:49 16 0 0
Attachments

Hey there, fellow traders! Today, I want to introduce you to the Nevalyashka 10-Line EA, a compact yet powerful trading tool for MetaTrader 4. Don't let its size fool you—this Expert Advisor can really shine with just a bit of optimization!

One of the cool features you can integrate is the Martingale system, which can boost your trading strategy. Let’s dive into the details!

Getting Started with the Nevalyashka EA

Here’s a simple code snippet to get you started:

//--------------------------------------------------------------------
extern int  stoploss    = 50,
            takeprofit  = 50;
double      Lot=1;
int         tip;
//--------------------------------------------------------------------
int init()
{
   OrderSend(Symbol(),OP_SELL,Lot,Bid,3,NormalizeDouble(Ask + stoploss*Point,Digits),
                        NormalizeDouble(Bid - takeprofit*Point,Digits)," ",777,Blue);
}
//--------------------------------------------------------------------
int start()
{
   for (int i=0; i<OrdersTotal(); i++){   
      if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true){
         if (OrderSymbol()==Symbol()){
            tip = OrderType();
            Lot = OrderLots();return;}}}
   if (Lot==0) return;
   if (tip==0) OrderSend(Symbol(),OP_SELL,Lot,Bid,3,NormalizeDouble(Ask + stoploss*Point,Digits),
                                    NormalizeDouble(Bid - takeprofit*Point,Digits)," ",777,Blue);
   if (tip==1) OrderSend(Symbol(),OP_BUY ,Lot,Ask,3,NormalizeDouble(Bid - stoploss*Point,Digits),
                                    NormalizeDouble(Ask + takeprofit*Point,Digits)," ",777,Blue);
   return(0);
}
//-----------------------------------------------------------------

Optimization Results

Check out how this EA performed after a bit of optimization:


So there you have it! The Nevalyashka 10-Line EA is definitely worth a look if you're looking to spice up your trading game. Happy trading!

List
Comments 0