LIP/EN/LIP_v01.006/LibreInfoPDO v1.006.mq5

149 lines
14 KiB
MQL5
Raw Permalink Normal View History

2025-05-30 15:03:51 +02:00
<EFBFBD><EFBFBD>//============================================================================================= MQL5 ===
// LibreInfoPDO v1.006 MQL5
// Main Event Processing Module
// Librecoin(c)2014-2018
//============================================================================================= MQL5 ===
// REVIEWS
//------------------------------------------------------------------------------------------------------
// Conclusion info about active and historical positions, deals, orders.
//============================================================================================= MQL5 ===
// PROPERTY
//------------------------------------------------------------------------------------------------------
#define ver "1.006"
#property copyright "Librecoin(c)2014-2018"
#property link "https://www.mql5.com/ru/users/kirillovyv"
#property strict
#property description "**************************************************"
#property description " Positions info v"+ver+" (MQL5)"
#property description " Positions, deals, orders info"
#property description " From Russia with Love! :-)"
#property description " https://www.mql5.com/ru/users/kirillovyv"
#property description "**************************************************"
#property version ver
const string vers = "LiP v"+ver; //Version
//============================================================================================= MQL5 ===
// INDICATOR PROPERTY
//------------------------------------------------------------------------------------------------------
#property indicator_separate_window
#property indicator_buffers 0
#property indicator_plots 0
//============================================================================================= MQL5 ===
// INCLUDE
//------------------------------------------------------------------------------------------------------
//----- Definitions of variables and structures
#include "Include\LIP_Def_5_v1.006.mqh" //Definitions of variables and structures MQL5
//----- Interface settings
#include "Include\LIP_Int_5_v1.006.mqh" //Interface settings MQL4/5
//----- Main algorithm
#include "Include\LIP_Man_5_v1.006.mqh" //Main algorithm MQL5
//----- Others (functions, calculations, graphics)
#include "Include\LIP_Fun1_5_v1.006.mqh" //Basic Algorithm Functions MQL5(Traling,Open-Close,MA,CalcSR)
#include "Include\LIP_Fun2_5_v1.006.mqh" //Basic technical calculations MQL5 (Calc...)
#include "Include\LIP_Fun3_5_v1.006.mqh" //Graphics, chart output and output conversions MQL5
//
//============================================================================================= MQL5 ===
// MAIN EVENT HANDLERS
//------------------------------------------------------------------------------------------------------
//
//============================================================================================= MQL5 ===
// OnInit()
//------------------------------------------------------------------------------------------------------
int OnInit()
{
return(On_Init());
}//OnInit()
//
//============================================================================================= MQL5 ===
// OnCalculate()
//------------------------------------------------------------------------------------------------------
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
On_Tick();
return(rates_total);
}//OnCalculate()
//
//============================================================================================= MQL5 ===
// OnTimer()
//------------------------------------------------------------------------------------------------------
void OnTimer()
{
On_Timer();
return;
}//OnTimer()
//
//============================================================================================= MQL5 ===
// OnDeinit()
//------------------------------------------------------------------------------------------------------
void OnDeinit(const int reason)
{
//----- Define the name of the program
string iProgramName=MQLInfoString(MQL_PROGRAM_NAME);
//----- Determine the type of program
string ProgramType="Expert";
{switch(MQLInfoInteger(MQL_PROGRAM_TYPE))
{
case PROGRAM_SCRIPT:
{
ProgramType="Script";
break;
}
case PROGRAM_EXPERT:
{
ProgramType="Expert";
break;
}
case PROGRAM_INDICATOR:
{
ProgramType="Indicator";
break;
}
default:
{
ProgramType="Expert";
}
}}//switch(MQLInfoInteger(MQL_PROGRAM_TYPE))
//----- We analyze and display information about the reason for the completion of work.
string ReasonTxt="REASON";
{switch(reason)
{
case REASON_PROGRAM:
ReasonTxt="[REASON_PROGRAM] "+ProgramType+" terminated its operation by calling the ExpertRemove() function.";break;
case REASON_REMOVE:
ReasonTxt="[REASON_REMOVE] "+ProgramType+" has been removed from chart.";break;
case REASON_RECOMPILE:
ReasonTxt="[REASON_RECOMPILE] "+ProgramType+" has been recompiled.";break;
case REASON_CHARTCHANGE:
ReasonTxt="[REASON_CHARTCHANGE] Symbol or chart period has been changed.";break;
case REASON_CHARTCLOSE:
ReasonTxt="[REASON_CHARTCLOSE] Chart has been closed.";break;
case REASON_PARAMETERS:
ReasonTxt="[REASON_PARAMETERS] Input parameters have been changed by a user.";break;
case REASON_ACCOUNT:
ReasonTxt="[REASON_ACCOUNT] Another account has been activated or reconnection to the trade server has occurred due to changes in the account settings.";break;
case REASON_TEMPLATE:
ReasonTxt="[REASON_TEMPLATE] New template was applied to chart.";break;
case REASON_INITFAILED:
ReasonTxt="[REASON_INITFAILED] "+ProgramType+" initialisation failed.";break;
case REASON_CLOSE:
ReasonTxt="[REASON_CLOSE] Terminal has been closed.";break;
default:ReasonTxt="Another reason";
}}//switch(reason)
Print("Terminal Build>>",TerminalInfoInteger(TERMINAL_BUILD)," ",ProgramType,":\"",iProgramName,"\" Deinit reason [",reason,"] >> "+ReasonTxt);
//----- Remove info from screen
DeleteGraph();
Comment("");
//----- Off timer
EventKillTimer();
//-----
return;
}//OnDeinit()