//+------------------------------------------------------------------+ //| StrategyParamsBase.mqh | //| Copyright 2016, Vasiliy Sokolov, St-Petersburg, Russia | //| https://www.mql5.com/en/users/c-4 | //+------------------------------------------------------------------+ #property copyright "Copyright 2016, Vasiliy Sokolov." #property link "https://www.mql5.com/en/users/c-4" #include "Logs.mqh" #include "XML\XMLBase.mqh" //+------------------------------------------------------------------+ //| The class contains basic parameters of any CStrategy. | //| Parameters are loaded from the passed XML attribute | //+------------------------------------------------------------------+ class CParamsBase { private: bool m_is_valid; // The flag shows if all the required parameters of the strategy are properly set. uint m_magic; // The magic number of the strategy string m_name; // The name of the strategy string m_symbol; // The symbol of the strategy ENUM_TIMEFRAMES m_timeframe; // The timeframe of the strategy CLog* Log; // Logging ENUM_TIMEFRAMES StringToTimeframe(string stf); public: CParamsBase(CXmlElement *xmlStrategy); bool IsValid(void); bool CheckParams(void); uint Magic(void); string Name(void); string Symbol(void); ENUM_TIMEFRAMES Timeframe(void); }; //+------------------------------------------------------------------+ //| Creates a class of basic parameters of the strategy from special | //| XML element. | //+------------------------------------------------------------------+ CParamsBase::CParamsBase(CXmlElement *xmlStrategy) : m_is_valid(false), m_magic(0), m_name(""), m_symbol(""), m_timeframe(PERIOD_CURRENT) { Log=CLog::GetLog(); for(int i=0; i