Module Trade.Trade_aggregation

type aggregated_trades = {
  1. symbol : Base.string;
  2. total_quantity : Base.float;
  3. volume_weighted_price : Base.float;
  4. total_commission : Base.float;
  5. trade_count : Base.int;
  6. first_trade_time : Timestamp.t;
  7. last_trade_time : Timestamp.t;
}
val aggregate_trades : trade Base.list -> aggregated_trades option
val calculate_twap : aggregated_trades -> Base.float
type execution_quality = {
  1. slippage : Base.float;
  2. implementation_shortfall : Base.float;
  3. is_favorable : Base.bool;
}
val execution_quality : trade -> benchmark_price:Base__Float.t -> execution_quality