Lib - EAPADPRO Adding our panel to your Expert Advisor

Lib - EAPADPRO Adding our panel to your Expert Advisor

27 July 2018, 11:26
Vladislav Andruschenko
8
4 079

Description

Method of programming the information panel in any adviser.

The success of any program is, first of all, the interface of the program and the first impression of the program.

We can not guarantee that the information and interface of the program will give you a profit on transactions, but we will definitely say that even the simplest interface of the program can strengthen the first impression.

In this article, we will tell you how to apply our information panel to the EAPADPRO advisor





EAPADPRO - Have the information!

EapadPRO is information that the user of any Expert Advisor receives in real time.

In order to create such a panel it took us about 2 weeks, but to bring the interface of the program to a friendly design (graphical user interface, GUI ), it took us months of painstaking work.

Not having enough experience in the development of such panels, you can not make the interface of the program suitable for use.

We do not insist on the ideal GUI of our panel, but according to experience and feedback, it has a number of useful blocks that give a complete picture of what is happening on the graph of your terminal.

We suggest you use our panel in your experts. EAPADPRO - Have the information!




Where to begin?

First, you should read the complete instructions for using and managing our panel. Read EAPadPRO - Information panel for our experts

Our panel is distributed as a LIBRARY, which can be used in both MT4 and MT5 ( cross-platform code)

You can download our library in the advisors section for forex , I put in the library archive and examples of use.

All you need is our EAPADPRO LIBRARY library and 10 minutes of time to install into your expert ....


Attention: When installing our library from the MQL5 site, the library is installed in the folder of your terminal MQLx \ Scripts


Installing the Library

  1. Copy the MQL5 or MQL4 folder to the folder of your terminal \;
  2. These folders include all the necessary files and resources for the work of our library;
  3. Open your Expert Advisor;
  4. Open our sample and step-by-step guide to installing our code, file Exp - EAPADPRO v26 LIBRARY TEST;
  5. Do each Step as written in the recommendation or use our step-by-step instruction from the site.

EAPADPRO personalization

All that you can change in our panel is described in this paragraph:

  1. versionea - The version of your Expert Advisor that is displayed in the panel;
  2. BMPLOGO - the logo of your BMP 60x60 adviser that is displayed on the panel;
  3. icon - The icon of your expert, which is displayed in the properties of the expert;
  4. defEANAME - the name of your Expert Advisor that is displayed in the panel;
  5. YourName - your name or nickname that is displayed in the panel;
  6. copyright - Your copyright, which is displayed in the properties of the Expert Advisor;
  7. CreateInputs - The function of displaying your external variables on the panel. There are 10 such parameters in total. The format of the filling: "Name", "Value";
  8. CreateStrategy - The function of displaying your strategy values on the panel. There are 10 such parameters in total. The format of the filling: "Name", "Value";
  9. MagicForEaPadPRO = 0 - Magic number, which will be watched by our panel (All information is filtered by magic number), at -1 = the panel will take all positions from the account by this symbol, at 0 = only manual;
  10. MagicForEaPadPRO_Open = -1 - Magic number, which will be assigned to the items opened from our panel;
  11. CommentForEaPadPRO = "" - A comment that will be assigned to items opened from our panel;
  12. TypeFillingForEaPadPRO = 0 - Type of fill orders at opening, only for terminal MT5;
  13. ShowBuySell = true - Show the trading panel in 1 click (BUY SELL)

You can also set external variables:

  1. ShowEaPadPro = true;
  2. FontName = "Roboto";
  3. Notice_Open_NameSound = "ok";
  4. Notice_Close_NameSound = "request";
  5. Notice_Modify_NameSound = "stops";
  6. Notice_Error_NameSound = "alert2";

Terms of Use

Our library with the information panel  EAPADPRO is distributed free of charge on the back link to our page.

If you wish to sell your expert in the market or on the Internet, you need to add the following text to the description of your product:

  1. The  EAPADPRO information graphic panel  was developed by the  team.
  2. The author of the  EAPADPRO information panel  is not responsible for the advisor or indicator that uses our panel.
  3. Our  EAPADPRO panel  is designed solely for the purpose of providing additional information about trading on your account.

Programming EAPADPRO 10 steps

In our example, you can find the steps (STEP) that you need to perform in order for the panel to be displayed in your Expert Advisor!

Step 1:

Copy the following code to the top of your EA and change the data that is available for editing (EAPADPRO Personalization):

 // Step 1 ####################################################################
// Эта шаг для установки нашей панели в вашего эксперта
// ###########################################################################
//+------------------------------------------------------------------+
// Вставляем в начале кода
//+------------------------------------------------------------------+
// Авторские права моей панели! Не изменять!
#define  EAPADPRODescription "\n\nEAPADPRO pad"
#property  strict
#ifdef  __MQL5__ 
#define  MT "MT5" 
#endif
 #ifdef  __MQL4__ 
#define ORDER_FILLING_FOK 0 
#define  MT "MT4" 
#endif
 //===========================
// Данные о Вашей программе |
//===========================
// Уведомление о том, что это демо версия вашей программы (Будет отображаться в панели)
bool DEMO= false ;
// Версия
#define  versionea "77.777"
#property  version versionea
// BMP LOGO 60x60 
#define  BMPLOGO "Images\\EAPADPRO_Images\\YOURLOGO.bmp" 
#resource  "\\" +BMPLOGO;
// Иконка Вашего продукта
#property  icon "\\Images\\EAPADPRO_Images\\YOURLOGO.ico" 
// Имя эксперта
#define  defEANAME "EA NAME"
// Ваше описание продукта 
#property  description defEANAME+ " for " +MT+ " " +EAPADPRODescription 
// Ваш ник или имя, отображается внизу панели 
#define  YourName "Your Nick" 
// Ваши авторские права
#property  copyright YourName+ " Your Copyright" 
// ########################################################################### 

Step 2:

This replacement is needed only to exclude the same output to the log.

 // Step 2 ####################################################################
// Эта шаг для установки нашей панели в вашего эксперта
// ###########################################################################
//+------------------------------------------------------------------+
// Заменить Print на EAPADPRO_LIBRARY_PrintToLogs
// Например: EAPADPRO_LIBRARY_PrintToLogs("Этот принт будет напечатан в журнале ");
//+------------------------------------------------------------------+
// ###########################################################################
 

Step 3:

In order for the MODIFY ONLY option to work in your Expert Advisor, you need to add the following code if (MODIFYONLY) return (false);in the function of opening positions or orders.

 // Step 3 ####################################################################
// Эта шаг для установки нашей панели в вашего эксперта
// ###########################################################################
//+------------------------------------------------------------------+
// Добавить в начало функции открытия позиций или ордеров 
//+------------------------------------------------------------------+
// if(MODIFYONLY)return(false);
// ########################################################################### 

Step 4:

The following function displays information about the error in the form of a PUSH notification to the phone, mail, and to the terminal screen. All these notifications in the future can be turned off in the settings of our panel.

 // Step 4 ####################################################################
// Эта шаг для установки нашей панели в вашего эксперта
// ###########################################################################
//+------------------------------------------------------------------+
// Добавить в обработку ошибок для уведомлений раздела NOTICE: 
//+------------------------------------------------------------------+
// EAPADPRO_LIBRARY_Notice_ErrorCheck(информация, информация о работе функции,номер ошибки);
// например:
// EAPADPRO_LIBRARY_Notice_ErrorCheck("СЮДА ЗАПИСЫВАЕМ ИНФОРМАЦИЮ","Line: "+__LINE__+" Function: "+__FUNCTION__+"\n"+__FUNCSIG__,GetLastError());
// например:
// Notice_ErrorCheck("ClosePosition ERROR "+OrderTicket(),"Line: "+__LINE__+" Function: "+__FUNCTION__ ,GetLastError());
// ########################################################################### 

Step 5:

Add the following code to your OnInit function and note the lines with the CreateInputs and CreateStrategy functions

 // Step 5 ####################################################################
// Эта шаг для установки нашей панели в вашего эксперта
// ###########################################################################
//+------------------------------------------------------------------+
//| внести код в OnInit |
//+------------------------------------------------------------------+
void OnInit ()
 {
 EAPADPRO_LIBRARY_PrintToLogs( "Этот принт будет напечатан в журнале " );
// Этот код мы также добавляем в OnTick:
// Сюда можно записать ваши внешние переменные в формате: "Название","Значение" Всего до 10 переменных
 CreateInputs( "Inputs_TEST1" , TimeCurrent (), "Inputs_TEST2" , "Inputs_TEST2" );
// Сюда можно записать ваши данные по стратегии в формате: "Название","Значение" Всего до 10 значений
 CreateStrategy( "Strategy_TEST1" , TimeCurrent (), "Strategy_TEST2" , "Strategy_TEST2" );

//============================================================================
// EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO
 EAPADPRO_LIBRARY_OnInit(ShowEaPadPro,- 1 ,- 1 , "EAPADPRO" ,DEMO,defEANAME, 0 ,FontName,Notice_Open_NameSound,Notice_Close_NameSound,Notice_Modify_NameSound,
 Notice_Error_NameSound,BMPLOGO,versionea,YourName, true );
// EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO
//============================================================================

 return ;
 }

Step 6:

Enter the following code into your OnDeinit function

 // Step 6 ####################################################################
// Эта шаг для установки нашей панели в вашего эксперта
// ###########################################################################
//+------------------------------------------------------------------+
//| внести код в OnDeinit |
//+------------------------------------------------------------------+
void OnDeinit ( const int reason)
 {
//============================================================================
// EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO
 EAPADPRO_LIBRARY_OnDeinit(reason);
// EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO
//============================================================================
 }
// ########################################################################### 

Step 7:

Enter the following code into your OnTick function and note the lines with the CreateInputs and CreateStrategy functions

 // Step 7 ####################################################################
// Эта шаг для установки нашей панели в вашего эксперта
// ###########################################################################
//+------------------------------------------------------------------+
//| внести код в OnTick |
//+------------------------------------------------------------------+
void OnTick ()
 {
//============================================================================
// EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO
 MODIFYONLY=Get_MODIFYONLY();
 STOPTRADING=Get_STOPTRADING();
 EAPADPRO_LIBRARY_OnTick(ShowEaPadPro);

// Копируем тот же код из OnInit
// Сюда можно записать ваши внешние переменные в формате: "Название","Значение" Всего до 10 переменных
 CreateInputs( "Inputs_TEST1" , TimeCurrent (), "Inputs_TEST2" , "Inputs_TEST2" );
// Сюда можно записать ваши данные по стратегии в формате: "Название","Значение" Всего до 10 значений
 CreateStrategy( "Strategy_TEST1" , TimeCurrent (), "Strategy_TEST2" , "Strategy_TEST2" );

// EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO
//============================================================================
 }

Step 8:

Enter the following code into your OnTrade function or if your code does not have the OnTrade function, then copy the lower code without changing:

 // Step 8 ####################################################################
// Эта шаг для установки нашей панели в вашего эксперта
// ###########################################################################
//+------------------------------------------------------------------+
//| внести код в OnTrade или добавить, Если нет |
//+------------------------------------------------------------------+
void OnTrade ()
 {
//============================================================================
// EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO
 EAPADPRO_LIBRARY_OnTrade(ShowEaPadPro);
// EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO
//============================================================================
 }
// ########################################################################### 

Step 9:

Enter the following code in your OnChartEvent function or if your code does not have the OnChartEvent function, then copy the lower code without changing:

 // Step 9 ####################################################################
// Эта шаг для установки нашей панели в вашего эксперта
// ###########################################################################
//+------------------------------------------------------------------+
//| внести код в OnChartEvent или добавить, Если нет |
//+------------------------------------------------------------------+
void OnChartEvent ( const int id, const long &lparam, const double &dparam, const string &sparam)
 {
//============================================================================
// EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO
 EAPADPRO_LIBRARY_OnChartEvent(id,lparam,dparam,sparam,ShowEaPadPro);
// EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO EAPADPRO
//============================================================================
 }
// ########################################################################### 

Step 10:

The final stage of programming our panel in your Expert Advisor, Copy the code that is below entirely to your Expert Advisor:

 // Step 10 ####################################################################
// Эта шаг для установки нашей панели в вашего эксперта
// ###########################################################################
//+------------------------------------------------------------------+
// Вставляем в конце кода
//+------------------------------------------------------------------+
input string EAPadPRO= " =============== EAPadPRO Info " ;
input bool ShowEaPadPro= true ;
input string FontName= "Roboto" ;
input string Notice_Open_NameSound= "ok" ;
input string Notice_Close_NameSound= "request" ;
input string Notice_Modify_NameSound= "stops" ;
input string Notice_Error_NameSound= "alert2" ;

bool STOPTRADING= false ;
bool MODIFYONLY= false ;

#ifdef __MQL5__ 
#import "Lib5 EAPadPRO for MT5.ex5"
#endif
#ifdef __MQL4__
#import "Lib4 EAPadPRO for MT4.ex4"
#endif
void EAPADPRO_LIBRARY_OnInit( bool ShowEaPadProexport= true ,
 int MagicForEaPadPRO= 0 ,
 int MagicForEaPadPRO_Open=- 1 ,
 string CommentForEaPadPRO= "" ,
 bool DemoForEaPadPRO= false ,
 string EaNameForEaPadPRO=defEANAME,
 int TypeFillingForEaPadPRO= 0 ,
 string FontNameForEaPadPRO= "" ,
 string Notice_Open_NameSoundForEaPadPRO= "" ,
 string Notice_Close_NameSoundForEaPadPRO= "" ,
 string Notice_Modify_NameSoundForEaPadPRO= "" ,
 string Notice_Error_NameSoundForEaPadPRO= "" ,
 string BMPLOGOForEaPadPRO=BMPLOGO,
 string versioneaForEaPadPRO=versionea,
 string NICKNAMEForEaPadPRO=YourName,
 bool ShowBuySell= true,
 double StartLotToEapadPRO=0

 );
bool Get_STOPTRADING();
bool Get_MODIFYONLY();

void EAPADPRO_LIBRARY_OnDeinit( const int reason);
void EAPADPRO_LIBRARY_OnTick( bool ShowEaPadProexport= true );
void EAPADPRO_LIBRARY_OnTrade( bool ShowEaPadProexport= true );
void EAPADPRO_LIBRARY_OnChartEvent( const int id, const long &lparam, const double &dparam, const string &sparam, bool ShowEaPadProexport= true );
void CreateInputs( string inputs_name_1= " " , string inputs_value_1= " " ,
 string inputs_name_2= " " , string inputs_value_2= " " ,
 string inputs_name_3= "" , string inputs_value_3= "" ,
 string inputs_name_4= "" , string inputs_value_4= "" ,
 string inputs_name_5= "" , string inputs_value_5= "" ,
 string inputs_name_6= "" , string inputs_value_6= "" ,
 string inputs_name_7= "" , string inputs_value_7= "" ,
 string inputs_name_8= "" , string inputs_value_8= "" ,
 string inputs_name_9= "" , string inputs_value_9= "" ,
 string inputs_name_10= "" , string inputs_value_10= "" );
void CreateStrategy( string strategy_name_1= " " , string strategy_value_1= " " ,
 string strategy_name_2= " " , string strategy_value_2= " " ,
 string strategy_name_3= "" , string strategy_value_3= "" ,
 string strategy_name_4= "" , string strategy_value_4= "" ,
 string strategy_name_5= "" , string strategy_value_5= "" ,
 string strategy_name_6= "" , string strategy_value_6= "" ,
 string strategy_name_7= "" , string strategy_value_7= "" ,
 string strategy_name_8= "" , string strategy_value_8= "" ,
 string strategy_name_9= "" , string strategy_value_9= "" ,
 string strategy_name_10= "" , string strategy_value_10= "" );
void EAPADPRO_LIBRARY_PrintToLogs( string text= "" );
void EAPADPRO_LIBRARY_Notice_ErrorCheck( string infoabouterror= "" , string techinfofunction= "" , int NumberofError=- 1 );

#import
 //+------------------------------------------------------------------+ 

Result

If you did everything correctly, then when you load your EA you will see the following image:




You can also download my other products:
Description MetaTrader 4  MetaTrader 5
Copy of deals and positions between terminals  COPYLOT  MT4  COPYLOT MT5
Trading panel in 1 click from the chart and keyboard  VIRTUALTRADEPAD MT4 VIRTUALTRADEPAD MT5
Automatic scalper without settings  TICK HAMSTER MT4  TICK HAMSTER MT5
Professional Automatic scalper, Smart Robot  TICKSNIPER MT4 TICKSNIPER MT5

Universal Expert Advisor on Custom Indicators  The xCUSTOMEA MT4 The xCUSTOMEA MT5
Universal Advisor on Standard Indicators  THE X MT4 THE X MT5
Averager, grid, additional opening of positions on Trend and against Trend  AVERAGER MT4 AVERAGER MT5
Duplicator of positions, copying positions on one terminal  DUPLICATOR MT4 DUPLICATOR MT5
Automatic installation of stop loss / take profit / trailing stop  ASSISTANT MT4 ASSISTANT MT5
Simulator for strategy tester  TESTERPAD MT4 TESTERPAD MT5
Professional account report   EXTRAREPORTPAD MT4 EXTRAREPORTPAD MT5




Share it with friends: