Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Panel sharing DiggerGo_Two source code Source code download and deployment instructions Source code download and deployment instructions - MT4/MT5 resources

author EAcpu | 3 reads | 0 comments |

Panel sharing DiggerGo_Two source code introduction: ① Editor's suggestion: → Disclaimer: This EA has not been tested ① Editor's suggestion: → Disclaimer: This EA has not been tested, please verify its effect through backtesting or real-time testing. This website is not responsible for any losses caused by the use of this EA. Enter the market at your own risk! → EA testing process suggestions: 1. Historical backtesting: simply verify the feasibility of the EA strategy through historical data, initially determine the applicable trading varieties and time periods, and screen out 1-2 EAs and their parameters that meet the needs. 2. Simulated disk test: run it on a simulated account for a period of time and observe the actual performance. 3. Real trading application: After confirming stable profits, enter real account trading. ②The editor says: →The essence of EA: EA is a tool that programs trading strategies and is automatically executed by a computer. It is not a scourge, nor is it an artifact for making money, but an auxiliary means. From a game theory perspective, the market is a zero-sum game, where your profits come from other people's losses and vice versa. If there is an "everyone wins" strategy, who bears the losses? If no one loses money, where will your profits come from? → Personalized selection: People with different personalities use the same EA, and the effects will be different due to different parameter settings. It is recommended to choose a suitable EA or EA combination according to your own personality, and adjust the parameters to fit it. Once you find the right fit, profits will naturally follow. → Usage suggestions: Choose EA according to your personal trading style, the one that suits you is the best. You can try to combine multiple EAs with different strategies and set parameters according to your trading philosophy and experience. Let each EA trade multiple varieties and control small risks on each variety to diversify risks, increase returns, and achieve long-term stable profits. ```cpp //+------------------------------------------------------------------+ //| Trading Panel System.mq4 | //| Copyright © 2023-2025, AI Programming zblog | //| http://www.eawalk.com | //+----------------------------------------------------------------+ #property copyright "Copyright 2024,eawalk.com" #property link "http://www.eawalk.com&quot; string ver = "Basket 1.1"; // Trading panel system.mq4 #property version "1.1" #property strict #property description "Account management advisor. Displays the instrument pairs that the current account is trading." #property description "Displays the profitability of each instrument pair during a specific period of time. Helps switch between multiple open windows." #property description "Account management advisor. Displays the instrument pairs that the current account is trading." #ifdef MQL5 MqlTick tick; MqlTradeRequest request; MqlTradeResult result; MqlTradeCheckResult check; ENUM_ORDER_TYPE_FILLINGFillingMode=ORDER_FILLING_RETURN; #endif //+--------------------------------------------------------------------------------+ input color background color = clrIvory; // background color input double window width ratio = 1.2; // window width ratio input double window height ratio = 1.0; // Window height ratio input color Profit color = clrLime; // Profit color input color Loss color = clrPink; // Loss color input bool Send email notification = true; // Send email notification input int Restart = false; // Restart input double Automatic closing = 0.0; // Automatic closing int orders=0,AN,Y=0,X=0,dY=0,dX=0,n=0; bool LANGUAGE=false; double tOrders[100][3]; double History[100][6]; string NameAccount,Symbl[100]; double ProfitAll[7]; //+----------------------------------------------------------------------------------+ void OnTimer(){ OnTick();} void OnTick() { //--------------------------------------------------------------------------------// // // // // Position control // // // // // //--------------------------------------------------------------------------------// ArrayInitialize(tOrders,0); double Profit=0,ProfitALL=0; int OT=0,i,j; string Symb; #ifdef MQL4//---------------------------------- MT4-------------------------------------------------- for (i=OrdersTotal()-1; i>=0;i--) { if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) continue; Symb = OrderSymbol(); Profit=OrderProfit()+OrderSwap()+OrderCommission(); if (OrderType()==OP_BUY)OT=1; else OT=-1; #endif #ifdef MQL5//-------------------------- MT5----------------------------------------------------------------- for(i=PositionsTotal()-1;i>=0; i--) { Symb=PositionGetSymbol(i); Profit=PositionGetDouble(POSITION_PROFIT)+PositionGetDouble(POSITION_SWAP)+GetPositionCommission()2; if(PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_BUY) OT=1; else OT=-1; #endif //-------------------------------------------------------------------------------- ProfitALL+=Profit; j=Insrt(Symb); if (n0)tOrders[j][1]++;// [1] Number of buy orders if (OT=automatic closing) { if (send email notification) SendMail(IntegerToString(AN)," Basket closes all positions"); CloseAll(); } //------------------------------------------------------------------------------------------------// // // // Display the profit table of each instrument // // // //----------------------------------------------------------------------------------// string name,SN; Y=25; int DY=19; for(j=0;j<=n;j++)//All instruments with open positions { SN=IntegerToString(j); name=StrCon("cmInsrt",SN);X=0; EditCreate(0,name,0,X,Y+DYj,100,20,Symbl[j],"Arial",8,ALIGN_CENTER,true,CORNER_LEFT_UPPER,clrBlack,clrWhite);//Tool name name=StrCon(name,"Profit");X+=105; EditCreate(0,name,0,X,Y+DYj,70,20,DoubleToString(tOrders[j][0],2),"Arial",8,ALIGN_CENTER,true,CORNER_LEFT_UPP ER,clrBlack,//Tool profit tOrders[j][0]>0?Profit color:tOrders[j][0]0?Profit color:History[j][i]0?Profit color:ProfitALL0?Profit color:ProfitAll[i]99) j=99; Symbl[j]=Sym; return(j); } //+------------------------------------------------------------------+ bool EditCreate(const long chart_ID=0, // Chart ID const string name="edit box", // Object name const int sub_window=0, // Sub-window number const int x=0, // X-axis coordinate const int y=0, // Y-axis coordinate const int width=50, // Width const int height=18, // Height const string text="text", // Text const string font="Arial", //Font const int font_size=8, // Font size const ENUM_ALIGN_MODE align=ALIGN_RIGHT, // Alignment const bool read_only=true, // Whether to read only const ENUM_BASE_CORNER corner=CORNER_RIGHT_LOWER, // Chart corners are bound const color clr=clrBlack, // text color const color back_clr=clrWhite, // background color const color border_clr=clrNONE, // border color const bool back=false, // whether in the background const bool selection=false, // Whether it can be selected for movement const bool hidden=true, // Whether it is hidden in the object list const long z_order=0) // Mouse click priority { ResetLastError(); if(ObjectFind(chart_ID,name)!=-1) ObjectDelete(chart_ID,name); if(!ObjectCreate(chart_ID,name,OBJ_EDIT,sub_window,0,0)) { Print(FUNCTION, ": Unable to create object",name,"! Error code = ",GetLastError()); return(false); } ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,(int)(dX+xwindow width ratio)); ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,(int)(dY+ywindow height ratio)); ObjectSetInteger(chart_ID,name,OBJPROP_XSIZE,(int)(widthwindow width ratio)); ObjectSetInteger(chart_ID,name,OBJPROP_YSIZE,(int)(heightwindow height ratio)); ObjectSetString(chart_ID,name,OBJPROP_TEXT,text); ObjectSetString(chart_ID,name,OBJPROP_FONT,font); ObjectSetInteger(chart_ID,name,OBJPROP_FONTSIZE,font_size); ObjectSetInteger(chart_ID,name,OBJPROP_ALIGN,align); ObjectSetInteger(chart_ID,name,OBJPROP_READONLY,read_only); ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,corner); ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr); ObjectSetInteger(chart_ID,name,OBJPROP_BGCOLOR,back_clr); ObjectSetInteger(chart_ID,name,OBJPROP_BORDER_COLOR,border_clr); ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back); ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection); ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection); ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden); ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order); return(true); } //+--------------------------------------------------------------------------------+ bool ButtonCreate(const long chart_ID=0, // Chart ID const string name="Button", // Button name const int sub_window=0, // Sub-window number const long x=0, // X-axis coordinate const long y=0, // Y-axis coordinate const int width=50, // Button width const int height=18, // Button height const string text="Button", // Text const string font="Arial", // Font const int font_size=10, // Font size const color clr=clrRed, // Text color const color clrfon=clrBlack, // Background color const color border_clr=clrNONE, // Border color const bool state=false, const ENUM_BASE_CORNER CORNER=CORNER_RIGHT_LOWER) { if(ObjectFind(chart_ID,name)==-1) { ObjectCreate(chart_ID,name,OBJ_BUTTON,sub_window,0,0); ObjectSetInteger(chart_ID,name,OBJPROP_YSIZE,(int)(heightwindow height ratio)); ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,CORNER); ObjectSetString(chart_ID,name,OBJPROP_FONT,font); ObjectSetInteger(chart_ID,name,OBJPROP_FONTSIZE,font_size); ObjectSetInteger(chart_ID,name,OBJPROP_BACK,0); ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,0); ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,0); ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,1); ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,1); } ObjectSetInteger(chart_ID,name,OBJPROP_STATE,state); ObjectSetInteger(chart_ID,name,OBJPROP_XSIZE,(int)(widthwindow width ratio)); ObjectSetInteger(chart_ID,name,OBJPROP_BORDER_COLOR,border_clr); ObjectSetInteger(chart_ID,name,OBJPROP_BGCOLOR,clrfon); ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr); ObjectSetString(chart_ID,name,OBJPROP_TEXT,text); ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,(int)(dX+xwindow width ratio)); ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,(int)(dY+ywindow height ratio)); return(true); } //---------------------- bool RectLabelCreate(const long chart_ID=0, // Chart ID const string name="rectangular label", // Label name const int sub_window=0, // Sub-window number const long x=0, // X-axis coordinate const long y=0, // Y-axis coordinate const int width=50, // Width const int height=18, // Height const color back_clr=clrNONE, // Background color const color clr=clrNONE, // Plane border color const ENUM_LINE_STYLE style=STYLE_SOLID, // Plane border style const int line_width=1, // Plane border thickness const bool back=false, // Whether to be in the background const bool selection=false, // Whether to select and move const bool hidden=true, // Whether to hide in the object list const long z_order=0, const int CORNER=CORNER_LEFT_LOWER) { ResetLastError(); if(ObjectFind(chart_ID,name)==-1) { ObjectCreate(chart_ID,name,OBJ_RECTANGLE_LABEL,sub_window,0,0); } ObjectSetInteger(chart_ID,name,OBJPROP_BORDER_TYPE,BORDER_FLAT); ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,CORNER); ObjectSetInteger(chart_ID,name,OBJPROP_STYLE,style); ObjectSetInteger(chart_ID,name,OBJPROP_WIDTH,line_width); ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back); ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection); ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection); ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden); ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order); ObjectSetInteger(chart_ID,name,OBJPROP_BGCOLOR,back_clr); ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,(int)(dX+xwindow width ratio)); ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,(int)(dY+ywindow height ratio)); return(true); } //-------------------------------------------------------------------- bool LabelCreate(const long chart_ID=0, // Chart ID const string name="label", // Label name const int sub_window=0, // Sub-window number const int x=0, // X-axis coordinate const int y=0, // Y-axis coordinate const ENUM_BASE_CORNER corner=CORNER_LEFT_UPPER, // Chart corner binding const string text="Labels", // Text const string font="Arial", // Font const int font_size=10, // Font size const color clr=clrBlack, // Color const double angle=0.0, // Text tilt angle const ENUM_ANCHOR_POINT anchor=ANCHOR_RIGHT_UPPER, // Anchor point method const bool back=false, // Whether in the background const bool selection=false, // Whether it can be selected and moved const bool hidden=true, // Whether it is hidden in the object list const long z_order=0) // Mouse click priority { ResetLastError(); if(ObjectFind(chart_ID,name)==-1) { if(!ObjectCreate(chart_ID,name,OBJ_LABEL,sub_window,0,0)) { return(false); } } ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,(int)(dX+xwindow width ratio)); ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,(int)(dY+ywindow height ratio)); ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,corner); ObjectSetString(chart_ID,name,OBJPROP_TEXT,text); ObjectSetString(chart_ID,name,OBJPROP_FONT,font); ObjectSetInteger(chart_ID,name,OBJPROP_FONTSIZE,font_size); ObjectSetDouble(chart_ID,name,OBJPROP_ANGLE,angle); ObjectSetInteger(chart_ID,name,OBJPROP_ANCHOR,anchor); ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr); ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back); ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection); ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection); ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden); ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order); return(true); } //+----------------------------------------------------------------------------------+ void OnDeinit(const int reason) { ObjectsDeleteAll(0); EventKillTimer(); } //--------------------------------------------------------------------------------- bool Liz() { if(AccountInfoInteger(ACCOUNT_TRADE_MODE)!=ACCOUNT_TRADE_MODE_REAL)return(true); if (AN==0) return(true); if (StringFind(NameAccount,"Хлыстов ВладимирСтепанович")!=-1) return(true); if (StringFind(NameAccount,"Владимир СтепановичХлыстов")!=-1) return(true); return(false); } //+--------------------------------------------------------------------------------+ void History() { double Profit=0; datetime OCT; ulong Ticket; int i,j; string Symb; ArrayInitialize(ProfitAll,0); ArrayInitialize(History,0); #ifdef MQL4 //----------------------------------MT4 -------------------------------------------------- for (i=OrdersHistoryTotal()-1;i>=0; i--) { if(!OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)) continue; if (OrderType()!=OP_BUY&& OrderType()!=OP_SELL) continue; Ticket = OrderTicket(); Symb =OrderSymbol(); Profit=OrderProfit()+OrderSwap()+OrderCommission(); OCT = OrderCloseTime(); Profit =OrderProfit()+OrderSwap()+OrderCommission(); Order ticket number, the transaction generated by it long deal_type; // Transaction operation type long position_ID; // Position identifier datetime from_date=0; // From the beginning datetime to_date=TimeCurrent(); // To the current moment HistorySelect(from_date,to_date); intdeals=HistoryDealsTotal(); for(i=0;i=iTime(NULL,PERIOD_D1,0)) {History[j][0]+=Profit;ProfitAll[0]+=Profit;}//Today else { if(OCT>=iTime(NULL,PERIOD_D1,1)) {History[j][1]+=Profit;ProfitAll[1]+=Profit;}//Yesterday else { if (OCT>=iTime(NULL,PERIOD_D1,2)) {History[j][2]+=Profit;ProfitAll[2]+=Profit;}//The day before yesterday} } if(OCT>=iTime(NULL,PERIOD_W1,0)) {History[j][3]+=Profit;ProfitAll[3]+=Profit;}//This week if(OCT>=iTime(NULL,PERIOD_MN1,0)) {History[j][4]+=Profit;ProfitAll[4]+=Profit;}//This month History[j][5]+=Profit;ProfitAll[5]+=Profit; // [5] Cumulative profit of this tool} } //+--------------------------------------------------------------------------------+ #ifdef MQL5 double GetPositionCommission(void) { doubleCommission=::PositionGetDouble(POSITION_COMMISSION); if(Commission==0) { ulongTicket=GetPositionDealIn(); if(Ticket>0) { const doubleLotsIn=::HistoryDealGetDouble(Ticket,DEAL_VOLUME); if(LotsIn>0) Commission=::HistoryDealGetDouble(Ticket,DEAL_COMMISSION)::PositionGetDouble(POSITION_VOLUME)/LotsIn; } } return(Commission); } //----------------------------------------------------------------------------- ulong GetPositionDealIn(const ulongHistoryTicket=0) { ulong Ticket=0; if((HistoryTicket==0) ? ::HistorySelectByPosition(::PositionGetInteger(POSITION_TICKET)): ::HistorySelectByPosition(HistoryTicket)) { const intTotal=::HistoryDealsTotal();for(int i=0; i0) if((ENUM_DEAL_ENTRY)::HistoryDealGetInteger(TicketDeal,DEAL_ENTRY)==DEAL_ENTRY_IN) { Ticket=TicketDeal; break; } } } return(Ticket); } //+--------------------------------------------------------------------------------+ #endif string StrCon(string t1=NULL, stringt2=NULL,string t3=NULL,string t4=NULL,string t5=NULL,string t6=NULL,stringt7=NULL,string t8=NULL,string t9=NULL,string t10=NULL,string t11=NULL) { string str; #ifdef MQL4str=StringConcatenate(#endif #ifdef MQL5StringConcatenate(str,#endif t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11); return(str); } //+------------------------------------------------------------------+ string AC; int OnInit() { AN=(int)AccountInfoInteger(ACCOUNT_LOGIN); NameAccount=AccountInfoString(ACCOUNT_NAME); AC = ""+AccountInfoString(ACCOUNT_CURRENCY); History(); EventSetTimer(1); LANGUAGE=TerminalInfoString(TERMINAL_LANGUAGE)=="Russian"; ChartSetInteger(0,CHART_COLOR_FOREGROUND,background color);//Color of axis, scale and OHLC row ChartSetInteger(0,CHART_COLOR_BACKGROUND,background color); ChartSetInteger(0,CHART_FOREGROUND,false);//The price chart is placed in the foreground ChartSetInteger(0,CHART_SHOW_GRID,false); ChartSetInteger(0,CHART_BRING_TO_TOP,true); ChartSetInteger(0,CHART_SHOW_ASK_LINE,false); ChartSetInteger(0,CHART_SHOW_BID_LINE,false); ChartSetInteger(0,CHART_SHOW_OHLC,false);//The upper left corner displays the OHLC value ChartSetInteger(0,CHART_SHOW_LAST_LINE,false); ChartSetInteger(0,CHART_SHOW_GRID,false); ChartSetInteger(0,CHART_SHOW_VOLUMES,false); ChartSetInteger(0,CHART_SHOW_OBJECT_DESCR,false); ChartSetInteger(0,CHART_CONTEXT_MENU,false);//Enable/disable the right-click context menu ChartSetInteger(0,CHART_CROSSHAIR_TOOL,false);/ /Cross line ChartSetInteger(0,CHART_MOUSE_SCROLL,false);//Left mouse button to scroll the chart horizontally ChartSetInteger(0,CHART_SHOW_ONE_CLICK,false); #ifdef MQL5 ChartSetInteger(0,CHART_SHOW,false);//Price chart drawing flag FillingMode=ORDER_FILLING_RETURN;//This mode is used for market orders intFILLING_MODE=(int)SymbolInfoInteger(_Symbol, SYMBOL_FILLING_MODE); if ((SYMBOL_FILLING_IOC &FILLING_MODE)==SYMBOL_FILLING_IOC) FillingMode=ORDER_FILLING_IOC;//All or part if ((SYMBOL_FILLING_FOK &FILLING_MODE)==SYMBOL_FILLING_FOK) FillingMode=ORDER_FILLING_FOK;//Must be executed exactly according to the specified quantity#endif ChartSetInteger(0,CHART_COLOR_CANDLE_BEAR,background color); ChartSetInteger(0,CHART_COLOR_CHART_DOWN,background color); ChartSetInteger(0,CHART_COLOR_CANDLE_BULL,background color); ChartSetInteger(0,CHART_COLOR_CHART_UP,background color); ChartSetInteger(0,CHART_COLOR_CHART_LINE,background color); ChartSetInteger(0,CHART_COLOR_STOP_LEVEL,background color); ChartSetInteger(0,CHART_COLOR_LAST,background color); ChartSetInteger(0,CHART_SHOW_TRADE_LEVEL,background color); ChartSetInteger(0,CHART_DRAG_TRADE_LEVELS,false); ChartSetInteger(0,CHART_SHOW_DATE_SCALE,false); ChartSetInteger(0,CHART_SHOW_PRICE_SCALE,false); ChartSetInteger(0,CHART_COLOR_VOLUME,background color); ChartSetInteger(0,CHART_HEIGHT_IN_PIXELS,100); _2",0,X,Y,70,20,"Profit","Arial",8,ALIGN_CENTER,true,CORNER_LEFT_UPPER,clrWhite,clrBlue);X+=75; EditCreate(0,"cm_b",0,X,Y,30,20,"Buy","Arial",8,ALIGN_CENTER,true,CORNER_LEFT_UPPER,clrWhite,clrBlue);X+=29; EditCreate(0,"cm_s",0,X,Y,30,20,"Sell","Arial",8,ALIGN_CENTER,true,CORNER_LEFT_UPPER,clrWhite,clrBlue);X+=35; EditCreate(0,"cm_3",0,X,Y,70,20,"Today","Arial",8,ALIGN_CENTER,true,CORNER_LEFT_UPPER,clrWhite,clrBlue);X+=75; EditCreate(0,"cm_4",0,X,Y,70,20,TimeToString(iTime(NULL,PERIOD_D1,1),TIME_DATE),"Arial",8,ALIGN_CENTER,true,CORNER_LEFT_UPPER,clrWhite,clrBlue);X+=75; EditCreate(0,"cm_5",0,X,Y,70,20,TimeToString(iTime(NULL,PERIOD_D1,2),TIME_DATE),"Arial",8,ALIGN_CENTER,true,CORNER_LEFT_UPPER,clrWhite,clrBlue);X+=75; EditCreate(0,"cm_6",0,X,Y,70,20,"This Week","Arial",8,ALIGN_CENTER,true,CORNER_LEFT_UPPER,clrWhite,clrBlue);X+=75; EditCreate(0,"cm_7",0,X,Y,70,20,"This Month","Arial",8,ALIGN_CENTER,true,CORNER_LEFT_UPPER,clrWhite,clrBlue);X+=75; EditCreate(0,"cm_8",0,X,Y,70,20,"Total","Arial",8,ALIGN_CENTER,true,CORNER_LEFT_UPPER,clrWhite,clrBlue); ChartSetInteger(0,CHART_BRING_TO_TOP,true); return(INIT_SUCCEEDED); } //+--------------------------------------------------------------------------------+ int Slippage = 1000; #ifdef MQL4 bool CloseAll(string Symbol1="ALL") { bool error=true; int j,err,nn=0,OT; string Symb; double Profit=0,OOP; while(!IsStopped()) { for (j = OrdersTotal()-1;j >= 0; j--) { if(OrderSelect(j, SELECT_BY_POS)) { Symb= OrderSymbol(); if(Symb == Symbol1 || Symbol1=="ALL") { OT = OrderType(); OOP=OrderOpenPrice(); Profit=OrderProfit()+OrderSwap()+OrderCommission(); if (OT>1) { error=OrderDelete(OrderTicket()); } if (OT==OP_BUY) { error=OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(MarketInfo(Symb,MODE_BID),(int)MarketInfo(Symb,MODE_DIGITS)),Slippage,Blue); } if (OT==OP_SELL) { error=OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(MarketInfo(Symb,MODE_ASK),(int)MarketInfo(Symb,MODE_DIGITS)),Slippage,Red); } if (!error) { err = GetLastError(); if (err10){/ALERT(StringConcatenate(Symb,LANGUAGE?" Failed to close all transactions, still remaining":"Failed to close all transactions, still remaining",k));/return(false);} Sleep(1000); RefreshRates(); } ObjectsDeleteAll(0,"cm"); OnInit(); return(true); } #endif //---------------------------------------------------------------- #ifdef MQL5 bool CloseAll(string Symbol1="ALL") { bool error=true; int i,err,nn=0; long OT; string Symb; int k=0; double Profit=0; while(!IsStopped()) { k=0; for (i =PositionsTotal()-1; i >= 0; i--) { Symb=PositionGetSymbol(i); if (Symb !=Symbol1 && Symbol1!="ALL") continue; Profit=PositionGetDouble(POSITION_PROFIT)+PositionGetDouble(POSITION_SWAP)+GetPositionCommission()*2; OT =PositionGetInteger(POSITION_TYPE); ZeroMemory(request); ZeroMemory(result); request.deviation = Slippage; request.volume=PositionGetDouble(POSITION_VOLUME); request.position = PositionGetInteger(POSITION_TICKET); request.action=TRADE_ACTION_DEAL; request.comment=""; request.type_filling = FillingMode; request.symbol= Symb; request.magic = PositionGetInteger(POSITION_MAGIC); k++; if(OT==POSITION_TYPE_BUY) { request.price=SymbolInfoDouble(Symb,SYMBOL_BID); request.type=ORDER_TYPE_SELL; } if(OT==POSITION_TYPE_SELL) { request.price=SymbolInfoDouble(Symb,SYMBOL_ASK); request.type=ORDER_TYPE_BUY; } if(!OrderSend(request,result)) { err= GetLastError(); if(err10)return(false); Sleep(1000); } return(true); } #endif //----------------------------------------------------------------------------- void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &name) { int i,j,ret=IDYES; long ch,prevChart=0; if(id==CHARTEVENT_OBJECT_CLICK) { string txt,Symb=NULL; if(StringFind(name,"cm Insrt")!=-1) { i=StringFind(name,"Profit"); if (i==-1)//Clicked the currency pair name button { Symb=ObjectGetString(0,name,OBJPROP_TEXT); i=-1; while(i

Panel sharing DiggerGo_Two source code Source code download and deployment instructions Source code download and deployment instructions Important points before use

This page has been reorganized according to the reading path of search users, focusing on the applicable scenarios of EA source code, MQL4/MQL5 platform compatibility, parameter testing methods and real-time risk warnings, so as to quickly judge whether it is worth continuing to test before downloading or deploying.

Suitable for who to use

  • Traders who need to quickly screen EA source code and are willing to do simulation verification first.
  • People who are already familiar with the MT4/MT5 installation process and want to compare different EAs, indicators or source code projects.
  • People who want to record the backtest, parameters and risk control before deciding whether to enter the real market.

Testing and risk control suggestions

  • First use the default parameters for basic backtesting, and then adjust them one by one according to the variety, cycle and spread.
  • Grid, Martin, and scalping strategies should focus on observing maximum drawdown, continuous losses, and trading frequency.
  • It is recommended to observe the simulated trading performance for at least 2-4 weeks before the actual trading, and limit the account risk proportion of a single strategy.

FAQ

Can this file be sold directly?
It is not recommended to make a direct offer. Any EA or indicator requires first checking the source, parameters, platform version and historical performance.

Can MT4 and MT5 be used interchangeably?
Usually it cannot be used directly. MQ4/EX4 corresponds to MT4, MQ5/EX5 corresponds to MT5, and the source code project also needs to be compiled in the corresponding MetaEditor.

What else can I continue to watch?
Forex EA download , foreign exchange indicator download , EA evaluation , GitHub open source EA , MQL5 CodeBase .

English Search Notes

This page is also optimized for English search intent around panel sharing DiggerGo_Two source code source code download and deployment instructions source code download and deployment instructions . Related search terms include: MQL4 source code, MQL5 source code. Test any Forex EA, Expert Advisor, MT4/MT5 indicator or MQL source code with historical data and a demo account before live trading.

Verification code Refresh