//+------------------------------------------------------------------+
//|                                                DrawdownTypes.mqh |
//+------------------------------------------------------------------+
#ifndef DRAWDOWNTYPES_MQH
#define DRAWDOWNTYPES_MQH

//+------------------------------------------------------------------+
//| CEquityPoint                                                     |
//| One point on the reconstructed equity curve: a timestamp and the |
//| account's running equity value at that moment.                   |
//+------------------------------------------------------------------+
struct CEquityPoint
  {
   datetime          time;
   double            equity;
  };

//+------------------------------------------------------------------+
//| CDrawdownEpisode                                                 |
//| One underwater period: the peak that preceded it, the trough it  |
//| reached, and either its recovery time or a flag marking it as    |
//| still open at the end of the queried range.                      |
//+------------------------------------------------------------------+
struct CDrawdownEpisode
  {
   datetime          start_time;
   datetime          trough_time;
   datetime          recovery_time;
   double            peak_equity;
   double            trough_equity;
   double            depth_percent;
   double            duration_days;
   bool              is_open;
  };

#endif // DRAWDOWNTYPES_MQH
//+------------------------------------------------------------------+