//+------------------------------------------------------------------+
//|                                             ThrottleStatus.mqh   |
//+------------------------------------------------------------------+

#ifndef THROTTLE_STATUS_MQH
#define THROTTLE_STATUS_MQH

//+------------------------------------------------------------------+
//| CThrottleStatus                                                  |
//+------------------------------------------------------------------+
struct CThrottleStatus
  {
   double            tokens_available;    // current token count, including fractional tokens
   double            token_capacity;      // maximum tokens the bucket can hold
   double            refill_rate;         // tokens added per second
   int               queue_depth;         // number of orders currently waiting in the queue
   int               queue_capacity;      // maximum orders the queue can hold
   int               executed_last_60s;   // orders dispatched to OrderSend in the last 60 seconds
   ulong             ms_until_next_token; // milliseconds until at least one full token is available
   bool              throttling_active;   // true when the bucket is empty and orders are being queued

                     CThrottleStatus(void)
     {
      tokens_available    = 0.0;
      token_capacity      = 0.0;
      refill_rate         = 0.0;
      queue_depth         = 0;
      queue_capacity      = 0;
      executed_last_60s   = 0;
      ms_until_next_token = 0;
      throttling_active   = false;
     }

                    ~CThrottleStatus(void)
     {
     }
  };

#endif // THROTTLE_STATUS_MQH
//+------------------------------------------------------------------+