//+------------------------------------------------------------------+
//|                                              ITradeSource.mqh    |
//|           Abstract source of trade records for the calculator    |
//+------------------------------------------------------------------+
#ifndef I_TRADE_SOURCE_MQH
#define I_TRADE_SOURCE_MQH

#include "RollingPFTypes.mqh"

//+------------------------------------------------------------------+
//| Anything that can report a trade count and return trades by      |
//| index. CTradeHistoryReader and CSyntheticTradeSource (in the     |
//| test script) both implement this, so CRollingWindowCalculator    |
//| depends on neither concretely.                                   |
//+------------------------------------------------------------------+
class ITradeSource
  {
public:
   virtual int       TradeCount(void) const = 0;
   virtual bool      GetTrade(const int index, STradeRecord &trade) const = 0;
  };

#endif // I_TRADE_SOURCE_MQH
//+------------------------------------------------------------------+