//+------------------------------------------------------------------+ //| StrategyParamsBase.mqh | //| Copyright 2015, Vasiliy Sokolov. | //| http://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2015, Vasiliy Sokolov." #property link "http://www.mql5.com" #include #include //+------------------------------------------------------------------+ //| 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