Coinbase Edge Fields
A coinbase alias reads public Coinbase Exchange market data for one product (symbol: BTC-USD). All 39 fields are numbers. Prices are in the product's quote currency; changes and _pct distances are fractions.
This page lists every field by group, with its unit and backtest support, then explains when candle-based fields go unavailable. Custom strategies on Kalshi and Polymarket US read a field as edge.<alias>.<field> once it is listed in the alias's fields. For the alias keys and refresh minimums, see Declaring and Reading Edge Data. Kalshi Perps reads the six MACD fields by name instead; see Kalshi Perps.
Price and quote fields
These come from Coinbase's 24-hour stats and top of book. They are the only fields that allow a 1s refresh.
| Field | Unit | Meaning | Backtest |
|---|---|---|---|
price | quote | Last trade price. | Yes (1-minute close, up to 60 s early) |
bid | quote | Best bid; unavailable when that side of the book is empty. | No, live only |
ask | quote | Best ask. | No, live only |
spread | quote | ask minus bid. | No, live only |
spread_bps | basis points | Spread divided by the midpoint, × 10,000. | No, live only |
change_24h | fraction | Last price vs. the price 24 hours ago: (last − open) ÷ open. | Yes (hourly candles, up to 1 h early) |
volume_24h | base asset | Volume traded over 24 hours, in the base asset (BTC for BTC-USD). | Yes (hourly candles, up to 1 h early) |
Change windows
Each change compares the latest close, including the candle still forming, with an earlier close. All are fractions (0.004 = +0.4%).
| Field | Built from | History needed | Backtest |
|---|---|---|---|
change_5m | latest 1-minute close vs. 5 candles earlier | 6 one-minute candles | Yes (up to 60 s early) |
change_15m | latest 1-minute close vs. 15 candles earlier | 16 one-minute candles | Yes (up to 60 s early) |
change_1h | latest 5-minute close vs. 12 candles earlier | 13 five-minute candles | Yes (up to 5 min early) |
change_4h | latest hourly close vs. 4 candles earlier | 5 hourly candles | Yes (up to 1 h early) |
High and low windows
Highest high or lowest low over recent candles, in the quote currency, including the candle still forming. With less history, fewer candles are used.
| Fields | Window | Backtest |
|---|---|---|
high_15m, low_15m | last 15 one-minute candles | Yes (up to 60 s early) |
high_1h, low_1h | last 12 five-minute candles | Yes (up to 5 min early) |
high_4h, low_4h | last 4 hourly candles | Yes (up to 1 h early) |
high_24h, low_24h | last 24 hourly candles | Yes (up to 1 h early) |
Moving averages
Averages of candle closes, in the quote currency.
| Field | Meaning | History needed | Backtest |
|---|---|---|---|
sma_20_1m | Simple average of the last 20 one-minute closes. | 20 one-minute candles | Yes (up to 60 s early) |
ema_12_1m | 12-period exponential average of one-minute closes, including the forming candle. | 12 one-minute candles | Yes (up to 60 s early) |
sma_50_5m | Simple average of the last 50 five-minute closes. | 50 five-minute candles | Yes (up to 5 min early) |
ema_26_5m | 26-period exponential average of five-minute closes, including the forming candle. | 26 five-minute candles | Yes (up to 5 min early) |
ema_26_15m | 26-period exponential average of completed 15-minute closes. | 26 or more completed 15-minute candles, with no gaps in the last 250 (about 62 hours) | Yes (completed candles only) |
EMA distance
Each EMA has two ready-made distance fields that measure how far price sits from it. Positive means spot is above the average, negative below.
| Field | Unit | Meaning |
|---|---|---|
ema_12_1m_distance_usd | quote | price − ema_12_1m |
ema_12_1m_distance_pct | fraction | (price − ema_12_1m) ÷ ema_12_1m |
ema_26_5m_distance_usd | quote | price − ema_26_5m |
ema_26_5m_distance_pct | fraction | (price − ema_26_5m) ÷ ema_26_5m |
ema_26_15m_distance_usd | quote | price − ema_26_15m |
ema_26_15m_distance_pct | fraction | (price − ema_26_15m) ÷ ema_26_15m |
A distance is unavailable whenever its EMA or price is. The _pct versions are handy across products, because a 0.2% band means the same on BTC and ETH, while a dollar band does not. All six are backtestable. When a rule reads an ema_26_15m field, backtests use the previous completed minute's close as spot.
To compare an EMA with a Kalshi strike rather than with spot, use the raw EMA field in a derived metric. See Recipe: spot and EMA vs. strike.
VWAP and velocity
| Field | Unit | Meaning | Backtest |
|---|---|---|---|
vwap_1h | quote | Volume-weighted average of the typical price, (high + low + close) ÷ 3, over the last 12 five-minute candles. | Yes (up to 5 min early) |
vwap_24h | quote | The same over the last 24 hourly candles. | Yes (up to 1 h early) |
velocity_1m | quote per second | Latest one-minute close minus the previous one, divided by the seconds between them (normally 60). | Yes (up to 60 s early) |
MACD
MACD compares a fast and a slow exponential average of completed candle closes. Each timeframe has three fields, all in signed quote currency.
| Field | Meaning |
|---|---|
macd_1m | MACD line: 12-period EMA minus 26-period EMA of completed one-minute closes. |
macd_signal_1m | Signal line: 9-period EMA of the MACD line. |
macd_histogram_1m | macd_1m minus macd_signal_1m. Positive when the MACD line is above its signal. |
macd_5m, macd_signal_5m, macd_histogram_5m | The same on completed five-minute closes. |
Each timeframe needs at least 34 completed candles (26 for the slow average plus 9 for the signal, minus the one they share), and every candle in the roughly 250 the Bot downloads must be back-to-back. One missing candle leaves all three fields unavailable until it is more than 250 candles old: about 4 hours for the _1m fields, about 21 hours for _5m. All six fields are backtestable and use completed candles only, in live and historical runs alike.
EMA distance and MACD, worked through
EMA distance (15-minute EMA-26)
price 102,500Last Coinbase tradeema_26_15m 102,300EMA of completed 15-minute closesema_26_15m_distance_usd +200Signed dollars. Positive: spot is above the EMA.ema_26_15m_distance_pct 0.00196A fraction, about 0.2%. Compare with 0.002, not 0.2.MACD (one-minute)
macd_1m +40MACD line, in dollarsmacd_signal_1m +28Signal line, in dollarsmacd_histogram_1m +12Positive: the line is above its signalSame test, two ways: macd_1m > macd_signal_1m using value_field, or macd_histogram_1m > 0. Both check the current relationship on every tick, not a one-time cross.
ema_12_1m field, which includes the candle still forming.MACD values are in the product's quote currency (dollars for -USD pairs), not percent, so their size scales with the product's price. A histogram threshold that fits BTC means something very different on ETH or SOL.
Candle history and freshness
There is no warm-up wait. On every refresh the Bot downloads about the last 250 candles of each size (1 minute, 5 minutes, 15 minutes, 1 hour), so indicators have values from the first fetch after you deploy. A field is unavailable only when:
- Coinbase's history is too short, for example a newly listed product.
- The history has gaps. Coinbase omits candles for intervals with no trades, which is common on thin products. MACD and
ema_26_15mneed every downloaded candle to be back-to-back, so a single gap leaves them unavailable for hours (see MACD). - The latest candle is late or missing. If the most recently completed candle is not in Coinbase's data within 10 seconds of its close, every field built from that candle size is unavailable for that refresh. Coinbase publishes no candle for an interval with no trades, so on thin products a quiet minute has the same effect as a late candle. The alias itself stays healthy.
| Candle size | Fields built from it |
|---|---|
| 1 minute | change_5m, change_15m, high_15m, low_15m, sma_20_1m, ema_12_1m and its distances, velocity_1m, the three _1m MACD fields |
| 5 minutes | change_1h, high_1h, low_1h, sma_50_5m, ema_26_5m and its distances, vwap_1h, the three _5m MACD fields |
| 15 minutes | ema_26_15m and its distances (completed candles only) |
| 1 hour | change_4h, high_4h, low_4h, high_24h, low_24h, vwap_24h |
| none | price, bid, ask, spread, spread_bps, change_24h, volume_24h |