//+------------------------------------------------------------------+ //| Globals_test_EA.mq5 | //| Copyright 2014, denkir | //| https://login.mql5.com/ru/users/denkir | //+------------------------------------------------------------------+ #property copyright "Copyright 2014, denkir" #property link "https://login.mql5.com/ru/users/denkir" #property version "1.00" #define GVARS_LIST_SIZE 6 //--- include #include "CGlobalVarList.mqh" //--- globals CGlobalVarList gvarList; //--- global variables: names string gVar_names[6]= { "gvarOpen_start","gvarOpen_finish", "gvarClose_start","gvarClose_finish", "gvarTrail_start","gvarTrail_finish" }; //--- test bool gToLog=false; string curr_module="Модуль: "; //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- fill the gvarList list with objects of the CGlobalVar type for(int idx=0;idx-1) continue; //--- PrintFormat("Failed to add a new gvar: %d",_LastError); return INIT_FAILED; } //--- PrintFormat("Failed to create a new gvar: %d",_LastError); return INIT_FAILED; } //--- create\check global variables for(int idx=0;idx>"); } } } } //--- return INIT_SUCCEEDED; } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { Comment(""); } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { Main(); } //+------------------------------------------------------------------+ //| Main module | //+------------------------------------------------------------------+ void Main(void) { //--- set flags for all modules for(int idx=0;idx>"); } } else Print("Program forced to terminate before execution: <<"+module_name+">>"); } //+------------------------------------------------------------------+