Trade manager tools experts

close all and take profit experts

close all pending

close all specific

close on time

can someobody make these into one ea

Clipboard01.jpg
 

Attachments

  • Close all pending orders.mq4
    1 KB · Views: 29
  • Close_All_Specific.mq4
    1.3 KB · Views: 27
  • Close_ALL_Trades_After_Account_Profit_Reached pips.mq4
    2.4 KB · Views: 26
  • CloseTrades_After_Account_Profit_Reached.mq4
    2.5 KB · Views: 27
  • CloseTrades_After_Account_Loss_TooMuch.mq4
    3.2 KB · Views: 25
  • CloseOnTime.mq4
    2 KB · Views: 28
  • Close_ALL_Trades_After_Account_Profit_Reached[1].mq4
    2.4 KB · Views: 24
Last edited:
Can somebody make a free trade manager to share?

More experts

input bool CloseAllMarket=false;
input bool CloseAllPending=false;
input bool CloseAllMarketAndPending=false;
input bool PlaceSLTPForPending=false;
extern int StopLoss=100;
extern int TakeProfit=300;
extern int BreakEven=100;
input bool UseCloseFriday=true;
input string FridayCloseTime="19:00";
input string MondayStartTime="10:00";
 

Attachments

  • CloseOrders_v1-0.mq4
    3.5 KB · Views: 25
  • breakevenmaster.mq4
    4.1 KB · Views: 28
  • breakevenmaster (1).mq4
    4.1 KB · Views: 22
  • AutostopCyriac.mq4
    2.7 KB · Views: 22
  • OpenOrder_v1-0.mq4
    4.1 KB · Views: 23
  • SL&TP Values.mq4
    29 KB · Views: 28
  • trailingmaster.mq4
    4 KB · Views: 34
Last edited:
more with trade manager

MQL4:
//+------------------------------------------------------------------+
//|                                                SL_TP_manager.mq4 |
//|                        Copyright 2015, MetaQuotes Software Corp. |
//|                                             [URL]https://www.mql5.com[/URL] |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015,https://www.profitabletraders.co.uk."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
extern int StopLoss=600;
extern int TakeProfit=800;
extern int c_TP_1=40;
extern int c_TP_2=60;
extern int trailingStart    = 12;
extern int TrailingDistance = 20;
extern string CloseTime="19:00";
extern int BreakEven=20;
int slippage=3;
double point;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- create timer
   point=1/MathPow(10,(Digits-1));
//  EventSetTimer(60);
 
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//--- destroy timer
   EventKillTimer();
 
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
//  set_tp_sl();
   if (CloseTime!="" && (TimeCurrent()-TimeCurrent()%60)==StrToTime(TimeToStr(TimeCurrent(),TIME_DATE)+"  "+CloseTime))CloseAll();
   if (BreakEven>0)MoveBreakEven();
   if (trailingStart>0) Trailing();
   PartialClose();
  }
//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
//---
 
  }
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
//---
 
  }
//+------------------------------------------------------------------+
void set_tp_sl()
  {
   double SL,TP;
   int i,Total;
   int Dig=Digits();
   bool res;
 
//+------------------------------------------------------------------+
 
   Total=OrdersTotal();
   if(Total>0)
     {
      for(i=Total-1; i>=0; i--)
        {
         if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)
           {
            if(OrderSymbol()==Symbol() && OrderType()==OP_SELL && OrderStopLoss()==0 && OrderTakeProfit()==0)
              {
               if(StopLoss>0)SL=OrderOpenPrice()+StopLoss*Point;else SL=0;
               if(TakeProfit>0)TP=OrderOpenPrice()-TakeProfit*Point;else TP=0;
               res=OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(SL,Dig),NormalizeDouble(TP,Dig),OrderExpiration(),CLR_NONE);
               if(!res) Print("Error in OrderModify. Error code=",GetLastError());
              }
            if(OrderSymbol()==Symbol() && OrderType()==OP_BUY && OrderStopLoss()==0 && OrderTakeProfit()==0)
              {
               if(StopLoss>0)SL=OrderOpenPrice()-StopLoss*Point;else SL=0;
               if(TakeProfit>0)TP=OrderOpenPrice()+TakeProfit*Point;else TP=0;
               res=OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(SL,Dig),NormalizeDouble(TP,Dig),OrderExpiration(),CLR_NONE);
               if(!res) Print("Error in OrderModify. Error code=",GetLastError());
              }
           }
        }
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void CloseAll()
  {
   bool result=false;
   int count=0,total=OrdersTotal();
   for(count=total-1; count>=0; count--)
     {
      if(OrderSelect(count,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol())
           {
            result=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),slippage,CLR_NONE);
           }
        }
     }
  }
//+------------------------------------------------------------------+
void MoveBreakEven()
  {
   bool modify;
   int count=0,total=OrdersTotal();
   for(count=total-1; count>=0; count--)
     {
      bool select=OrderSelect(count,SELECT_BY_POS,MODE_TRADES);
      if(OrderType()==OP_BUY&&Bid>(OrderOpenPrice()+BreakEven*point)&&OrderStopLoss()!=OrderOpenPrice())  modify= OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Red);
      if(OrderType()==OP_SELL&&Ask<(OrderOpenPrice()-BreakEven*point)&&OrderStopLoss()!=OrderOpenPrice())  modify= OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Red);
     }
  }
//+------------------------------------------------------------------+
void Trailing()
  {
   bool mod;
   int count=0,total=OrdersTotal();
   for(count=total-1; count>=0; count--)
     {
      bool select=OrderSelect(count,SELECT_BY_POS,MODE_TRADES);
      if(OrderType()==OP_BUY && Bid>(OrderOpenPrice()+trailingStart*point))
        {
         if(NormalizeDouble(Bid-TrailingDistance*point,Digits)>OrderStopLoss())
           {
            mod=OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(Bid-TrailingDistance*point,Digits),OrderTakeProfit(),
                            OrderExpiration());
           }
        }
      if(OrderType()==OP_SELL && Ask<(OrderOpenPrice()-trailingStart*point))
        {
         if(NormalizeDouble(Ask+TrailingDistance*point,Digits)<OrderStopLoss()||OrderStopLoss()==0)
           {
            mod=OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(Ask+TrailingDistance*point,Digits),OrderTakeProfit(),
                            OrderExpiration());
           }
        }
     }
  }
//+------------------------------------------------------------------+
void PartialClose()
{
   bool result=false;
   int count=0,total=OrdersTotal();
   for(count=total-1; count>=0; count--)
     {
      bool select=OrderSelect(count,SELECT_BY_POS,MODE_TRADES);
      if(OrderType()==OP_BUY && Bid>(OrderOpenPrice()+c_TP_1*point)&&StringFind(OrderComment(),"from",0)==-1)
        {
        result = OrderClose(OrderTicket(),NormalizeDouble(OrderLots()/2,2),OrderClosePrice(),slippage);  
        }
           if(OrderType()==OP_BUY && Bid>(OrderOpenPrice()+c_TP_2*point)&&StringFind(OrderComment(),"from",0)!=-1)
        {
        result = OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),slippage);  
        }
      if(OrderType()==OP_SELL && Ask<(OrderOpenPrice()-c_TP_1*point)&&StringFind(OrderComment(),"from",0)==-1)
        {
        result = OrderClose(OrderTicket(),NormalizeDouble(OrderLots()/2,2),OrderClosePrice(),slippage);  
        }
      if(OrderType()==OP_SELL && Ask<(OrderOpenPrice()-c_TP_2*point)&&StringFind(OrderComment(),"from",0)!=-1)
        {
        result = OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),slippage);  
        }
     }
}
 

Attachments

  • SL_TP_manager_v2.ex4
    13.2 KB · Views: 62
  • Trade manager.mq4
    7.7 KB · Views: 78
Last edited by a moderator:
Try the EA in a demo account first before using in a live account.
The EA is free to use, but not to distribute. If someone wants to have a copy, tell them to download from here.
Disclaimer: I am not responsible for any loss you may incur using the Trade Manager EA. Use it at your own risk.


https://www.earnforex.com/forum/threads/trade-manager-tools-experts.30111/#post-150053



The partial close may not work , because many mt4 brokers do not allow partial close.This way broker gets two spreads by closing and re entering partial .Meta trader is designed for MAKING MONEY FOR BROKERS , not the trader.Broker tricks to stop partial from working.


 
  • 👍
Reactions: Henryudy