TradeAggregationResponse

@Serializable
data class TradeAggregationResponse(val timestamp: Long, val tradeCount: Int, val baseVolume: String, val counterVolume: String, val avg: String, val high: String, val highR: Price, val low: String, val lowR: Price, val open: String, val openR: Price, val close: String, val closeR: Price) : Response

Represents a trade aggregation response from the Horizon API.

Trade aggregations represent aggregated statistics about trading activity for a given asset pair over a specified time period. They are similar to candlestick charts used in traditional trading platforms, showing open, high, low, and close (OHLC) prices, along with trading volume.

Trade aggregations are useful for:

  • Displaying price charts

  • Analyzing trading patterns

  • Computing trading statistics

  • Building trading bots and algorithms

See also

Constructors

Link copied to clipboard
constructor(timestamp: Long, tradeCount: Int, baseVolume: String, counterVolume: String, avg: String, high: String, highR: Price, low: String, lowR: Price, open: String, openR: Price, close: String, closeR: Price)

Properties

Link copied to clipboard
@SerialName(value = "avg")
val avg: String

The average price in this time period

Link copied to clipboard
@SerialName(value = "base_volume")
val baseVolume: String

The volume of the base asset traded

Link copied to clipboard
@SerialName(value = "close")
val close: String

The price of the last trade in this time period

Link copied to clipboard
@SerialName(value = "close_r")
val closeR: Price

The closing price as a ratio (numerator/denominator)

Link copied to clipboard
@SerialName(value = "counter_volume")
val counterVolume: String

The volume of the counter asset traded

Link copied to clipboard
@SerialName(value = "high")
val high: String

The highest price in this time period

Link copied to clipboard
@SerialName(value = "high_r")
val highR: Price

The highest price as a ratio (numerator/denominator)

Link copied to clipboard
@SerialName(value = "low")
val low: String

The lowest price in this time period

Link copied to clipboard
@SerialName(value = "low_r")
val lowR: Price

The lowest price as a ratio (numerator/denominator)

Link copied to clipboard
@SerialName(value = "open")
val open: String

The price of the first trade in this time period

Link copied to clipboard
@SerialName(value = "open_r")
val openR: Price

The opening price as a ratio (numerator/denominator)

Link copied to clipboard
@SerialName(value = "timestamp")
val timestamp: Long

The start time for this aggregation bucket (UNIX timestamp in milliseconds)

Link copied to clipboard
@SerialName(value = "trade_count")
val tradeCount: Int

The number of trades in this time period