73 行
2.3 KiB
MQL5
//+------------------------------------------------------------------+
| |||
//| Global.mqh |
| |||
//| Copyright 2025, Niquel Mendoza. |
| |||
//| https://www.mql5.com/es/users/nique_372 |
| |||
//+------------------------------------------------------------------+
| |||
#property copyright "Copyright 2025, Niquel Mendoza."
| |||
#property link "https://www.mql5.com/es/users/nique_372"
| |||
#property strict
| |||
| |||
#ifndef GLOBAL_MQH
| |||
#define GLOBAL_MQH
| |||
| |||
//+------------------------------------------------------------------+
| |||
//| |
| |||
//+------------------------------------------------------------------+
| |||
// Tf manager
| |||
#include <TSN\\MQLArticles\\Utils\\TFManager.mqh>
| |||
// Auto delete
| |||
#include <TSN\\Std\\Memory.mqh>
| |||
// Estado de la cuenta
| |||
#include <TSN\\MQLArticles\\RM\\AccountStatus.mqh>
| |||
// Lib de noticias
| |||
#include <TSN\\FastNL\\Main.mqh>
| |||
// Central back
| |||
#include <TSN\\FastNL\\CentralBank.mqh>
| |||
// Us event codes
| |||
#include <TSN\\FastNL\\UsEventCodes.mqh>
| |||
// Estrategias
| |||
#include <TSN\\MQLArticles\\Strategy\\Main.mqh>
| |||
// Try
| |||
#include <TSN\\Std\\Basics\\Try.mqh>
| |||
// Gestion de riesgo
| |||
#include <TSN\\MQLArticles\\RM\\RiskManagement.mqh>
| |||
| |||
//---
| |||
TSN::CNewBarManager g_new_bar_manager;
| |||
| |||
| |||
//+------------------------------------------------------------------+
| |||
//| |
| |||
//+------------------------------------------------------------------+
| |||
class CGlobalInit
| |||
{
| |||
private:
| |||
static bool init;
| |||
| |||
public:
| |||
//--- Incializacion global
| |||
CGlobalInit(void)
| |||
{
| |||
if(init)
| |||
return;
| |||
| |||
//---
| |||
CBasicEvents::Init();
| |||
| |||
//---
| |||
CAutoCleaner::AddFunction(TSN::CAccountStatus_Deinit); // Account status
| |||
CAutoCleaner::AddFunction(CBasicEvents::Deinit); // Basic events
| |||
| |||
//---
| |||
init = true;
| |||
}
| |||
//--- Deinicializacion global
| |||
~CGlobalInit(void) {}
| |||
};
| |||
//+------------------------------------------------------------------+
| |||
bool CGlobalInit::init = false;
| |||
| |||
//+------------------------------------------------------------------+
| |||
CGlobalInit g_global_instance;
| |||
//+------------------------------------------------------------------+
| |||
#endif // GLOBAL_MQH
|