//+------------------------------------------------------------------+ //| Reporter.mqh | //| Copyright 2026, MasterOfPuppets | //| https://forge.mql5.io/masterofpuppets/mql5 | //+------------------------------------------------------------------+ #ifndef MASTER_OF_PUPPETS_LIB_REPORTER_MQH #define MASTER_OF_PUPPETS_LIB_REPORTER_MQH #include #include #property copyright "Copyright 2026, MasterOfPuppets" #property link "https://forge.mql5.io/masterofpuppets/mql5" //+------------------------------------------------------------------+ //| Constants | //+------------------------------------------------------------------+ const string MESSAGE_BUY = "BUY "; const string MESSAGE_SELL = "SELL "; //+------------------------------------------------------------------+ //| Last profit class | //+------------------------------------------------------------------+ class LastProfit : public CObject { public: const string message; const double profit; const string suffix; LastProfit(const string srcMessage, const double srcProfit, const string srcSuffix) : message(srcMessage), profit(srcProfit), suffix(srcSuffix) {} }; //+------------------------------------------------------------------+ //| Reporter class | //+------------------------------------------------------------------+ class Reporter { private: CDealInfo *m_dealInfo; int m_lastProfitsSize; CArrayObj m_lastProfits; double m_totalLastProfit; void CalculateTotalLastProfit(); const string GetMessage(const ENUM_DEAL_TYPE enumDealType) const; const string GetSuffix(const long dealReason) const; public: Reporter() : m_dealInfo(NULL), m_lastProfitsSize(0) {} void Init(CDealInfo *srcDealInfo, const int srcLastProfitsSize); void InitLastProfits(); const CArrayObj* GetLastProfits() const; const double GetTotalLastProfit() const; }; #include #endif //+------------------------------------------------------------------+