Quantcast
Channel: MT4talk.com - Artificial Intelligence Forex Robot! — ► Download over 5,000 Forex robots from over 16,000+ forum posts!
Viewing all 2411 articles
Browse latest View live

Best indicator Expert

$
0
0

Share your best Indicator and expert advisor . Go help us .


EA 20%/month.

$
0
0

EA takeprofit 20-50% mỗi tháng. Chăm sóc backtest trước khi chạy acount sống. 
Goodl luck for you.

Star Trade EA: Sending Signals and Execute Trades

$
0
0

Hi,

After sharing the great Trend Martingale EA last time (Hopefully admin still keep it as sticky. https://mt4talk.com/viewtopic.php?pid=55510), I want to share another EA that I found as a great tool to trade. Although this is an EA, but this also an Indicator that you can use to execute the trade (the TP and SL will be placed automatically as per the settings).

This is a FREE EA, NOT crack-ed EA, no expiry limit and easy to use. I received it after I registered with their site.

Simply attach it to any pair that you want to trade, M30 chart and you are ready to go.
The EA will send the signal recommendation (buy or sell) and it's up to you whether you want to execute it or not. Pay attention to the winning probability, it was calculated from the past trades and it doesn't repaint, which means all the previous signals whether it's win or loose will be taken into account of the winning percentage (%). 

https://mt4talk.com/img/m/28507/5c079155366243.69155325.png


For the settings on TP & SL, it will require your risk management and your knowledge about each pair. You can also set the max spread for the signal. There are 3 options for the signal to be send: by alert on your terminal, send an email to you, or push the notification to your MT4 mobile.
https://mt4talk.com/img/m/28507/5c0791df8f3b76.07924308.png


If you choose to push (OnPush) the notification to your MT4 mobile, then do the following. Open the Options tab and select the "notifications" bar and click on Enable Push Notifications. Dont forget to enter your MetaQuotes ID which you can find in your MT4 mobile.


https://mt4talk.com/img/m/28507/5c0792488566d2.80972282.png
That's all. Hope this will help your trade.

Turbo Profit

$
0
0

Now works with EUR/USD, AUD/JPY, GOLD and more...

experts gpro

$
0
0

best expert working at EURUSD AND GBPUSD F: 5 and 15M
Need risk 3000 per 0.01 
https://mt4talk.com/img/m/29513/5c082688895e08.66385202.png
https://mt4talk.com/img/m/29513/5c08271fb05e46.44888230.gif

EUROBLASTER EA

$
0
0

I hope this helps to all members

This is a goood robot EA, it is very stable, with a stop loss.

$
0
0

This is a very good EA, it is very stable, there are stop-loss.

Ronix v4 EA

$
0
0

best forex robot SCALPING this is the robot trading frame on 5m any chart
https://mt4talk.com/img/m/26594/5c096680d6e040.22690920.png


Moving GRID ea Most Profitable!

$
0
0
//+------------------------------------------------------------------+
//|                                                          mmm.mq4 |
//|                                      Copyright 2018, Querido Alp |
//|                                             https://www.mql4.com  |
//+--------------------------------------------------------- ---------+
#property copyright "Copyright 2018, Q. Alp"
#property link      "https://www.mql5.com"
#property version   "1.03"
#property strict

extern double    LOTS=0.02; // not used in this version  ***option to turn on/off
extern int       LEVELS=3;
extern int       MAGIC=1803;
extern bool      CONTINUE=true;
extern double    Open_Loss_To_CloseTrades=-100;

extern string    StdDev="==== Standard Deviation ====================";
extern int       MA_Period=10;
extern int       MA_Shift=0;     //MA shift. 
extern string    Methods="**0-SMA,1-EMA,2-SMMA,3-LWMA**";
extern int       MA_Method=1;
extern string    ApPrice="**0-Close,1-Open,2-Hi,3-Low,4-Med,5-Typ,6-Weighted**";
extern int       Applied_Price=0;
extern int       Shift=0;
extern int       TimeFrame=15; // 0=Null=current chart=not recommended 
extern string    TurnOffSTD="**Set STD to 0.0 to turn off filter**";
extern double    STD=0.0020;  //  Set to value given for above MA period and timeframe   **if set to zero STD is turned off
//+------------------------------------------------------------------+
//---- input parameters 
//// don't remove used for daily range
double  Risk_to_Reward_ratio=3.0;
int First_av=5;
int Second_av= 10;
int Third_av = 20;
int nDigits;

bool             MONEY_MANAGEMENT=false;
int              RISK_RATIO=2;
bool             UseEntryTime=false;
int              EntryTime=0;
double           MAX_LOTS=99;
bool             UseProfitTarget=false;
bool             UsePartialProfitTarget=false;
int              Target_AutoIncrement=10;
int              First_Target=10;

//+------------------------------------------------------------------+

bool Enter=true;
int nextTP;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   IndicatorShortName("TSR");
   if(Symbol()=="GBPJPY" || Symbol()=="EURJPY" || Symbol()=="USDJPY" || Symbol()=="GOLD" || Symbol()=="USDMXN") nDigits = 2;
   if(Symbol()=="GBPUSD" || Symbol()=="EURUSD" || Symbol()=="NZDUSD" || Symbol()=="USDCHF"  ||
      Symbol()=="USDCAD"|| Symbol()=="AUDUSD"|| Symbol()=="EURUSD"|| Symbol()=="EURCHF"|| Symbol()=="EURGBP"
      || Symbol()=="EURCAD" || Symbol()=="EURAUD")nDigits=4;

//+------------------------------------------------------------------+ 
   nextTP=First_Target;
//+------------------------------------------------------------------+

   return(INIT_SUCCEEDED);

  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//----Collects daily range info
   int R1=0,R5=0,R10=0,R20=0,RAvg=0,AutoIncrement=0;
   int RoomUp=0,RoomDown=0,StopLoss_Long=0,StopLoss_Short=0;
   double   SL_Long=0,SL_Short=0;
   double   low0=0,high0=0;
   string   Text="";
   int i=0;

   R1=(iHigh(NULL,PERIOD_D1,1)-iLow(NULL,PERIOD_D1,1))/Point;
   for(i=1;i<=First_av;i++)
      R5=    R5+(iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point;
   for(i=1;i<=Second_av;i++)
      R10=R10+(iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point;
   for(i=1;i<=Third_av;i++)
      R20=R20+(iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point;

   R5=R5/First_av;
   R10 = R10/Second_av;
   R20 = R20/Third_av;
   RAvg=(R1+R5+R10+R20)/4; //RAvg  =  (R5+R10+R20)/3;new setting    
                           // from the TSR daily range indicator 
   low0  =  iLow(NULL,PERIOD_D1,0);
   high0 =  iHigh(NULL,PERIOD_D1,0);
   RoomUp   =  RAvg - (Bid - low0)/Point;
   RoomDown =  RAvg - (high0 - Bid)/Point;
   StopLoss_Long  =  RoomUp/Risk_to_Reward_ratio;
   SL_Long        =  Bid - StopLoss_Long*Point;
   StopLoss_Short =  RoomDown/Risk_to_Reward_ratio;
   SL_Short       =  Bid + StopLoss_Short*Point;

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////AutoIncrement calculation  R1 = Previous Day range, R5 = 5 day,  R10=10 Day
//////////////AutoIncrement replaces the need to manaully set increment.  PreviousDay R1 is more heavily weighted
//////////////then the R5 range.  
//Equation history for reference
   AutoIncrement =((((R5*0.4) + (R1*0.6))  / (LEVELS + 1)) / (2));     //((((R5*0.4) + (R1*0.6))  / (LEVELS + 1)) / (2));
                                                                       // (((R5)/(LEVELS + 1))/2);    

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////

   int Slippage=5;
   int ticket,cpt,profit,total=0,BuyGoalProfit,SellGoalProfit,PipsLot;
   double ProfitTarget=AutoIncrement*1,BuyGoal=0,SellGoal=0,spread=(Ask-Bid)/Point,InitialPrice=0;
//----

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//---- StdDev indicator Settings

   double sval=iStdDev(NULL,TimeFrame,MA_Period,MA_Shift,MA_Method,Applied_Price,Shift);

//----//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//  If StdDev is below STD setting the EA will pause until market picks up

   if(sval<=STD)
     {

      Comment("                                          ","\n",
              "**Market is not volatile enough to enter**","\n",
              "StdDev is currently:  "+sval,"\n",
              "StdDev needs to be: "+STD,"\n",
              "AutoIncrement: "+AutoIncrement,"\n",
              "Lots:  ",LOTS,"\n",
              "Levels: "+LEVELS,"\n",
              "5 Day Range:"+R5,"\n",
              "Previous Day Range: "+R1,"\n");

      return;
     }

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//+------------------------------------------------------------------+
   if(AccountProfit()<=Open_Loss_To_CloseTrades)
     {
      for(i=OrdersTotal()-1;i>=0;i--)
        {
         OrderSelect(i,SELECT_BY_POS);
         int type=OrderType();

         bool result=false;

         switch(type)
           {
            //Close opened long positions
            case OP_BUY  : result=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),Slippage,Pink);
            break;

            //Close opened short positions
            case OP_SELL : result=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),Slippage,Pink);

           }

         if(result==false)
           {
            Sleep(3000);
           }
        }
      Print("Account Cutoff Limit Reached. All Open Trades Have Been Closed");
      return;
     }

   Comment("Balance: ",AccountBalance(),", Account Equity: ",AccountEquity(),", Account Profit: ",AccountProfit(),
           "\nMy Account Cutoff Limit: ",Open_Loss_To_CloseTrades);

//+------------------------------------------------------------------+

//----Money Management 

   if(AutoIncrement<MarketInfo(Symbol(),MODE_STOPLEVEL)+spread) AutoIncrement=1+MarketInfo(Symbol(),MODE_STOPLEVEL)+spread;
   if(MONEY_MANAGEMENT) LOTS=NormalizeDouble(AccountBalance()*AccountLeverage()/1000000*RISK_RATIO,0)*MarketInfo(Symbol(),MODE_MINLOT);
   if(LOTS<MarketInfo(Symbol(),MODE_MINLOT))
     {
      Comment("Not Enough Free Margin to begin");
      return;
     }
   for(cpt=1;cpt<LEVELS;cpt++) PipsLot+=cpt*AutoIncrement;
   for(cpt=0;cpt<OrdersTotal();cpt++)
     {
      OrderSelect(cpt,SELECT_BY_POS,MODE_TRADES);
      if(OrderMagicNumber()==MAGIC && OrderSymbol()==Symbol())
        {
         total++;
         if(!InitialPrice) InitialPrice=StrToDouble(OrderComment());
         if(UsePartialProfitTarget && UseProfitTarget && OrderType()<2)
           {
            double val=getPipValue(OrderOpenPrice(),OrderType());
            takeProfit(val,OrderTicket());
           }
        }
     }
   if(total<1 && Enter && (!UseEntryTime || (UseEntryTime && Hour()==EntryTime)))
     {
      if(AccountFreeMargin()<(100*LOTS))
        {
         Print("Not enough free margin to trade");
         return;
        }
      //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
      // - Open Check - Start Cycle
      InitialPrice=Ask;
      SellGoal=InitialPrice-(LEVELS+1)*AutoIncrement*Point;
      BuyGoal=InitialPrice+(LEVELS+1)*AutoIncrement*Point;
      for(cpt=1;cpt<=LEVELS;cpt++)
        {
         OrderSend(Symbol(),OP_BUYSTOP,LOTS,InitialPrice+cpt*AutoIncrement*Point,2,SellGoal,BuyGoal,DoubleToStr(InitialPrice,MarketInfo(Symbol(),MODE_DIGITS)),MAGIC,0);
         OrderSend(Symbol(),OP_SELLSTOP,LOTS,InitialPrice-cpt*AutoIncrement*Point,2,BuyGoal+spread*Point,SellGoal+spread*Point,DoubleToStr(InitialPrice,MarketInfo(Symbol(),MODE_DIGITS)),MAGIC,0);
        }

      //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
      //////////////////////////////////////////////////////////////////////////////////////////////////////////////////

     } // initial setup done - all channels are set up
   else // We have open Orders
     {
      BuyGoal=InitialPrice+AutoIncrement*(LEVELS+1)*Point;
      SellGoal=InitialPrice-AutoIncrement*(LEVELS+1)*Point;
      total=OrdersHistoryTotal();
      for(cpt=0;cpt<total;cpt++)
        {
         OrderSelect(cpt,SELECT_BY_POS,MODE_HISTORY);
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC && StrToDouble(OrderComment())==InitialPrice){EndSession();return;}
        }
      if(UseProfitTarget && CheckProfits(LOTS,OP_SELL,true,InitialPrice)>ProfitTarget) {EndSession();return;}
      BuyGoalProfit=CheckProfits(LOTS,OP_BUY,false,InitialPrice);
      SellGoalProfit=CheckProfits(LOTS,OP_SELL,false,InitialPrice);
      if(BuyGoalProfit<ProfitTarget)
         // - Incriment Lots Buy
        {
         for(cpt=LEVELS;cpt>=1 && BuyGoalProfit<ProfitTarget;cpt--)
           {
            if(Ask<=(InitialPrice+(cpt*AutoIncrement-MarketInfo(Symbol(),MODE_STOPLEVEL))*Point))
              {
               ticket=OrderSend(Symbol(),OP_BUYSTOP,cpt*LOTS,InitialPrice+cpt*AutoIncrement*Point,2,SellGoal,BuyGoal,DoubleToStr(InitialPrice,MarketInfo(Symbol(),MODE_DIGITS)),MAGIC,0);
              }
            if(ticket>0) BuyGoalProfit+=LOTS*(BuyGoal-InitialPrice-cpt*AutoIncrement*Point)/Point;
           }
        }
      if(SellGoalProfit<ProfitTarget)
         // - AutoIncrement Lots Sell
        {
         for(cpt=LEVELS;cpt>=1 && SellGoalProfit<ProfitTarget;cpt--)
           {
            if(Bid>=(InitialPrice-(cpt*AutoIncrement-MarketInfo(Symbol(),MODE_STOPLEVEL))*Point))
              {
               ticket=OrderSend(Symbol(),OP_SELLSTOP,cpt*LOTS,InitialPrice-cpt*AutoIncrement*Point,2,BuyGoal+spread*Point,SellGoal+spread*Point,DoubleToStr(InitialPrice,MarketInfo(Symbol(),MODE_DIGITS)),MAGIC,0);
              }
            if(ticket>0) SellGoalProfit+=LOTS*(InitialPrice-cpt*AutoIncrement*Point-SellGoal-spread*Point)/Point;
           }
        }
     }
//+------------------------------------------------------------------+   

   Comment("mGRID EXPERT ADVISOR ver 2.0\n",
           "FX Acc Server:",AccountServer(),"\n",
           "Date: ",Month(),"-",Day(),"-",Year()," Server Time: ",Hour(),":",Minute(),":",Seconds(),"\n",
           "Minimum Lot Sizing: ",MarketInfo(Symbol(),MODE_MINLOT),"\n",
           "Account Balance:  $",AccountBalance(),"\n",
           "Symbol: ",Symbol(),"\n",
           "Price:  ",NormalizeDouble(Bid,4),"\n",
           "Pip Spread:  ",MarketInfo("EURUSD",MODE_SPREAD),"\n",
           "Lots:  ",LOTS,"\n",
           "Levels: "+LEVELS,"\n",
           "Free Margin: "+AccountFreeMargin(),"\n",
           "Free Equity: "+AccountEquity(),"\n",
           "Increment: "+AutoIncrement,"\n",
           "5 Day Range:"+R5,"\n",
           "Daily Range: "+R1,"\n");
   return;
  }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//+------------------------------------------------------------------+

int CheckProfits(double LOTS,int Goal,bool Current,double InitialPrice)
  {
   int profit=0,cpt;
   if(Current)//return current profit
     {
      for(cpt=0;cpt<OrdersTotal();cpt++)
        {
         OrderSelect(cpt,SELECT_BY_POS,MODE_TRADES);
         if(OrderSymbol()==Symbol() && StrToDouble(OrderComment())==InitialPrice)
           {
            if(OrderType()==OP_BUY) profit+=(Bid-OrderOpenPrice())/Point*OrderLots()/LOTS;
            if(OrderType()==OP_SELL) profit+=(OrderOpenPrice()-Ask)/Point*OrderLots()/LOTS;
           }
        }
      return(profit);
     }
   else
     {
      if(Goal==OP_BUY)
        {
         for(cpt=0;cpt<OrdersTotal();cpt++)
           {
            OrderSelect(cpt,SELECT_BY_POS,MODE_TRADES);
            if(OrderSymbol()==Symbol() && StrToDouble(OrderComment())==InitialPrice)
              {
               if(OrderType()==OP_BUY) profit+=(OrderTakeProfit()-OrderOpenPrice())/Point*OrderLots()/LOTS;
               if(OrderType()==OP_SELL) profit-=(OrderStopLoss()-OrderOpenPrice())/Point*OrderLots()/LOTS;
               if(OrderType()==OP_BUYSTOP) profit+=(OrderTakeProfit()-OrderOpenPrice())/Point*OrderLots()/LOTS;
              }
           }
         return(profit);
        }
      else
        {
         for(cpt=0;cpt<OrdersTotal();cpt++)
           {
            OrderSelect(cpt,SELECT_BY_POS,MODE_TRADES);
            if(OrderSymbol()==Symbol() && StrToDouble(OrderComment())==InitialPrice)
              {
               if(OrderType()==OP_BUY) profit-=(OrderOpenPrice()-OrderStopLoss())/Point*OrderLots()/LOTS;
               if(OrderType()==OP_SELL) profit+=(OrderOpenPrice()-OrderTakeProfit())/Point*OrderLots()/LOTS;
               if(OrderType()==OP_SELLSTOP) profit+=(OrderOpenPrice()-OrderTakeProfit())/Point*OrderLots()/LOTS;
              }
           }
         return(profit);
        }
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
bool EndSession()
  {
   int cpt,total=OrdersTotal();
   for(cpt=0;cpt<total;cpt++)
     {
      Sleep(3000);
      OrderSelect(cpt,SELECT_BY_POS,MODE_TRADES);
      if(OrderSymbol()==Symbol() && OrderType()>1) OrderDelete(OrderTicket());
      else if(OrderSymbol()==Symbol() && OrderType()==OP_BUY) OrderClose(OrderTicket(),OrderLots(),Bid,3);
      else if(OrderSymbol()==Symbol() && OrderType()==OP_SELL) OrderClose(OrderTicket(),OrderLots(),Ask,3);

     }
   if(!CONTINUE) Enter=false;
   return(true);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
double getPipValue(double ord,int dir)
  {
   double val;
   RefreshRates();
   if(dir==1) val=(NormalizeDouble(ord,Digits)-NormalizeDouble(Ask,Digits));
   else val=(NormalizeDouble(Bid,Digits)-NormalizeDouble(ord,Digits));
   val=val/Point;
   return(val);
  }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//========== FUNCTION takeProfit

void takeProfit(int current_pips,int ticket)
  {
   if(OrderSelect(ticket,SELECT_BY_TICKET))
     {

      if(current_pips>=nextTP && current_pips<(nextTP+Target_AutoIncrement))
        {
         if(OrderType()==1)
           {
            if(OrderClose(ticket,MAX_LOTS,Ask,3))
               nextTP+=Target_AutoIncrement;
            else
               Print("Error closing order : ",GetLastError());
           }
         else
           {
            if(OrderClose(ticket,MAX_LOTS,Bid,3))
               nextTP+=Target_AutoIncrement;
            else
               Print("Error closing order : ",GetLastError());
           }
        }
     }
  }
//+------------------------------------------------------------------+

EA trading ZigZag pointing outside the Bollinger Bands.

$
0
0
#property version   "1.1"

#include <stdlib.mqh>
#include <stderror.mqh>

int LotDigits; //initialized in OnInit
int MagicNumber = 1492878;
extern double MM_Martingale_Start = 0.1;
extern double MM_Martingale_ProfitFactor = 1;
extern double MM_Martingale_LossFactor = 2;
extern bool MM_Martingale_RestartProfit = true;
extern bool MM_Martingale_RestartLoss = false;
extern int MM_Martingale_RestartLosses = 1000;
int MaxSlippage = 3; //adjusted in OnInit
bool crossed[4]; //initialized to true, used in function Cross
bool Audible_Alerts = true;
int MaxOpenTrades = 1000;
int MaxLongTrades = 1000;
int MaxShortTrades = 1000;
int MaxPendingOrders = 1000;
bool Hedging = true;
int OrderRetry = 5; //# of retries if sending order returns error
int OrderWait = 5; //# of seconds to wait if sending order returns error
double myPoint; //initialized in OnInit

double MM_Size() //martingale / anti-martingale
  {
   double lots = MM_Martingale_Start;
   double MaxLot = MarketInfo(Symbol(), MODE_MAXLOT);
   double MinLot = MarketInfo(Symbol(), MODE_MINLOT);
   if(SelectLastHistoryTrade())
     {
      double orderprofit = OrderProfit();
      double orderlots = OrderLots();
      double boprofit = BOProfit(OrderTicket());
      if(orderprofit + boprofit > 0 && !MM_Martingale_RestartProfit)
         lots = orderlots * MM_Martingale_ProfitFactor;
      else if(orderprofit + boprofit < 0 && !MM_Martingale_RestartLoss)
         lots = orderlots * MM_Martingale_LossFactor;
      else if(orderprofit + boprofit == 0)
         lots = orderlots;
     }
   if(ConsecutiveLosses(MM_Martingale_RestartLosses))
      lots = MM_Martingale_Start;
   if(lots > MaxLot) lots = MaxLot;
   if(lots < MinLot) lots = MinLot;
   return(lots);
  }

bool Cross(int i, bool condition) //returns true if "condition" is true and was false in the previous call
  {
   bool ret = condition && !crossed[i];
   crossed[i] = condition;
   return(ret);
  }

void myAlert(string type, string message)
  {
   if(type == "print")
      Print(message);
   else if(type == "error")
     {
      Print(type+" | ZZ Trader @ "+Symbol()+","+Period()+" | "+message);
      if(Audible_Alerts) Alert(type+" | ZZ Trader @ "+Symbol()+","+Period()+" | "+message);
     }
   else if(type == "order")
     {
      if(Audible_Alerts) Alert(type+" | ZZ Trader @ "+Symbol()+","+Period()+" | "+message);
     }
   else if(type == "modify")
     {
     }
  }

int TradesCount(int type) //returns # of open trades for order type, current symbol and magic number
  {
   int result = 0;
   int total = OrdersTotal();
   for(int i = 0; i < total; i++)
     {
      if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == false) continue;
      if(OrderMagicNumber() != MagicNumber || OrderSymbol() != Symbol() || OrderType() != type) continue;
      result++;
     }
   return(result);
  }

bool SelectLastHistoryTrade()
  {
   int lastOrder = -1;
   int total = OrdersHistoryTotal();
   for(int i = total-1; i >= 0; i--)
     {
      if(!OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) continue;
      if(OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber)
        {
         lastOrder = i;
         break;
        }
     } 
   return(lastOrder >= 0);
  }

double BOProfit(int ticket) //Binary Options profit
  {
   int total = OrdersHistoryTotal();
   for(int i = total-1; i >= 0; i--)
     {
      if(!OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) continue;
      if(StringSubstr(OrderComment(), 0, 2) == "BO" && StringFind(OrderComment(), "#"+ticket+" ") >= 0)
         return OrderProfit();
     }
   return 0;
  }

bool ConsecutiveLosses(int n)
  {
   int count = 0;
   int total = OrdersHistoryTotal();
   for(int i = total-1; i >= 0; i--)
     {
      if(!OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) continue;
      if(OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber)
        {
         double orderprofit = OrderProfit();
         double boprofit = BOProfit(OrderTicket());
         if(orderprofit + boprofit >= 0)
            break;
         count++;
        }
     }
   return(count >= n);
  }

int myOrderSend(int type, double price, double volume, string ordername) //send order, return ticket ("price" is irrelevant for market orders)
  {
   if(!IsTradeAllowed()) return(-1);
   int ticket = -1;
   int retries = 0;
   int err;
   int long_trades = TradesCount(OP_BUY);
   int short_trades = TradesCount(OP_SELL);
   int long_pending = TradesCount(OP_BUYLIMIT) + TradesCount(OP_BUYSTOP);
   int short_pending = TradesCount(OP_SELLLIMIT) + TradesCount(OP_SELLSTOP);
   string ordername_ = ordername;
   if(ordername != "")
      ordername_ = "("+ordername+")";
   //test Hedging
   if(!Hedging && ((type % 2 == 0 && short_trades + short_pending > 0) || (type % 2 == 1 && long_trades + long_pending > 0)))
     {
      myAlert("print", "Order"+ordername_+" not sent, hedging not allowed");
      return(-1);
     }
   //test maximum trades
   if((type % 2 == 0 && long_trades >= MaxLongTrades)
   || (type % 2 == 1 && short_trades >= MaxShortTrades)
   || (long_trades + short_trades >= MaxOpenTrades)
   || (type > 1 && long_pending + short_pending >= MaxPendingOrders))
     {
      myAlert("print", "Order"+ordername_+" not sent, maximum reached");
      return(-1);
     }
   //prepare to send order
   while(IsTradeContextBusy()) Sleep(100);
   RefreshRates();
   if(type == OP_BUY)
      price = Ask;
   else if(type == OP_SELL)
      price = Bid;
   else if(price < 0) //invalid price for pending order
     {
      myAlert("order", "Order"+ordername_+" not sent, invalid price for pending order");
	  return(-1);
     }
   int clr = (type % 2 == 1) ? clrRed : clrBlue;
   while(ticket < 0 && retries < OrderRetry+1)
     {
      ticket = OrderSend(Symbol(), type, NormalizeDouble(volume, LotDigits), NormalizeDouble(price, Digits()), MaxSlippage, 0, 0, ordername, MagicNumber, 0, clr);
      if(ticket < 0)
        {
         err = GetLastError();
         myAlert("print", "OrderSend"+ordername_+" error #"+err+" "+ErrorDescription(err));
         Sleep(OrderWait*1000);
        }
      retries++;
     }
   if(ticket < 0)
     {
      myAlert("error", "OrderSend"+ordername_+" failed "+(OrderRetry+1)+" times; error #"+err+" "+ErrorDescription(err));
      return(-1);
     }
   string typestr[6] = {"Buy", "Sell", "Buy Limit", "Sell Limit", "Buy Stop", "Sell Stop"};
   myAlert("order", "Order sent"+ordername_+": "+typestr[type]+" "+Symbol()+" Magic #"+MagicNumber);
   return(ticket);
  }

void myOrderClose(int type, int volumepercent, string ordername) //close open orders for current symbol, magic number and "type" (OP_BUY or OP_SELL)
  {
   if(!IsTradeAllowed()) return;
   if (type > 1)
     {
      myAlert("error", "Invalid type in myOrderClose");
      return;
     }
   bool success = false;
   int err;
   string ordername_ = ordername;
   if(ordername != "")
      ordername_ = "("+ordername+")";
   int total = OrdersTotal();
   for(int i = total-1; i >= 0; i--)
     {
      while(IsTradeContextBusy()) Sleep(100);
      if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) continue;
      if(OrderMagicNumber() != MagicNumber || OrderSymbol() != Symbol() || OrderType() != type) continue;
      while(IsTradeContextBusy()) Sleep(100);
      RefreshRates();
      double price = (type == OP_SELL) ? Ask : Bid;
      double volume = NormalizeDouble(OrderLots()*volumepercent * 1.0 / 100, LotDigits);
      if (NormalizeDouble(volume, LotDigits) == 0) continue;
      success = OrderClose(OrderTicket(), volume, NormalizeDouble(price, Digits()), MaxSlippage, clrWhite);
      if(!success)
        {
         err = GetLastError();
         myAlert("error", "OrderClose"+ordername_+" failed; error #"+err+" "+ErrorDescription(err));
        }
     }
   string typestr[6] = {"Buy", "Sell", "Buy Limit", "Sell Limit", "Buy Stop", "Sell Stop"};
   if(success) myAlert("order", "Orders closed"+ordername_+": "+typestr[type]+" "+Symbol()+" Magic #"+MagicNumber);
  }

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {   
   //initialize myPoint
   myPoint = Point();
   if(Digits() == 5 || Digits() == 3)
     {
      myPoint *= 10;
      MaxSlippage *= 10;
     }
   //initialize LotDigits
   double LotStep = MarketInfo(Symbol(), MODE_LOTSTEP);
   if(LotStep >= 1) LotDigits = 0;
   else if(LotStep >= 0.1) LotDigits = 1;
   else if(LotStep >= 0.01) LotDigits = 2;
   else LotDigits = 3;
   int i;
   //initialize crossed
   for (i = 0; i < ArraySize(crossed); i++)
      crossed[i] = true;
   return(INIT_SUCCEEDED);
  }

//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
  }

//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   int ticket = -1;
   double price;   
   
   
   //Close Long Positions, instant signal is tested first
   if(Cross(1, iBands(NULL, PERIOD_CURRENT, 13, 2, 0, PRICE_CLOSE, MODE_LOWER, 0) < iCustom(NULL, PERIOD_CURRENT, "ZigZag", 12, 5, 3, 0, 0)) //Bollinger Bands crosses below ZigZag
   )
     {   
      if(IsTradeAllowed())
         myOrderClose(OP_BUY, 100, "");
      else //not autotrading => only send alert
         myAlert("order", "");
     }
   
   //Close Short Positions, instant signal is tested first
   if(Cross(0, iBands(NULL, PERIOD_CURRENT, 13, 2, 0, PRICE_CLOSE, MODE_LOWER, 0) > iCustom(NULL, PERIOD_CURRENT, "ZigZag", 12, 5, 3, 0, 0)) //Bollinger Bands crosses above ZigZag
   )
     {   
      if(IsTradeAllowed())
         myOrderClose(OP_SELL, 100, "");
      else //not autotrading => only send alert
         myAlert("order", "");
     }
   
   //Open Buy Order, instant signal is tested first
   if(Cross(2, iBands(NULL, PERIOD_CURRENT, 13, 2, 0, PRICE_CLOSE, MODE_LOWER, 0) > iCustom(NULL, PERIOD_CURRENT, "ZigZag", 12, 5, 3, 0, 0)) //Bollinger Bands crosses above ZigZag
   )
     {
      RefreshRates();
      price = Ask;   
      if(IsTradeAllowed())
        {
         ticket = myOrderSend(OP_BUY, price, MM_Size(), "");
         if(ticket <= 0) return;
        }
      else //not autotrading => only send alert
         myAlert("order", "");
     }
   
   //Open Sell Order, instant signal is tested first
   if(Cross(3, iBands(NULL, PERIOD_CURRENT, 13, 2, 0, PRICE_CLOSE, MODE_LOWER, 0) < iCustom(NULL, PERIOD_CURRENT, "ZigZag", 12, 5, 3, 0, 0)) //Bollinger Bands crosses below ZigZag
   )
     {
      RefreshRates();
      price = Bid;   
      if(IsTradeAllowed())
        {
         ticket = myOrderSend(OP_SELL, price, MM_Size(), "");
         if(ticket <= 0) return;
        }
      else //not autotrading => only send alert
         myAlert("order", "");
     }
  }
//+------------------------------------------------------------------+

BLESSING EA Free robot

$
0
0

Working robot, profitable and easy to use. For mt4 platform. Work with all pairs

Topics for advertising purpose! - YOU MUST READ!

$
0
0

If you create a forum topic for advertising purposes in any forum section, you must make your topic STICKY not more than 3 hours from the creation of the topic, otherwise, your topic will be deleted and you will be suspended to create further forum posts. There are no exceptions!

https://mt4talk.com/img/m/2/5c09795f062f22.27671060.jpg

You may also read the forum rules at https://mt4talk.com/forumrules.php

Grid EA

$
0
0

This RA need to be use in cent account. Tested 6 month result, OK!

Not tested

$
0
0

Can someone help to test out this grid EA from Indonesia.

I want see how many EA i uploaded only can download a file.

$
0
0

I want see how many EA i uploaded only can download a file.


No Sleep EA

$
0
0

Please test this No Sleep EA. May be it will sleep

Forexhackers-EA_V2

$
0
0

Hi, everybody, I have this robot with set file, is profitable every time on demo tests on GBP/CAD, GBP/USD, EUR/USD, EUR/GBP and other try it and have fun I haven't try on a real account

EA HIBRYD TT+F

$
0
0

Here is Hybrid! Enjoy
Use on 1hr timeframe and make sure you use low lot sizes.
I have account that has 10 pairs on it with starting lot size 0.03 and it makes about +500$ a day on demo

My recommendation is this 4 pairs on Hybrid using 0.01 and change Tp to 60

TP High SCALPER

$
0
0

EA is agressiv.
Use it for major pairs TF  M1-M5-M15
Avoid Gold ttading with it.

EA Life Changer fixed

$
0
0

Please read User Manual and  Read  this carefully .
Please watch these two screen shot.
For Lot size 0.01
 Deposit  1000 USD
Levrage  1.500 if Levrage  less then 1.500 then make  2000 USD deposit for  0.01 lot size .
open one chart only  and EA set on this chart .
Not open  many chart  always EA set on only one chart.
EA work on all time frame but M15 is best for EA.

Viewing all 2411 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>