Knowledge Base/How does Polygon create the OHLCV (open, high, low, close, volume) aggregate bars? ​

How does Polygon create the OHLCV (open, high, low, close, volume) aggregate bars? ​

Polygon uses the “Sale Conditions” attached to each trade to determine if that trade is eligible to update the aggregate

You can use the Conditions endpoint to answer this question. For example, if you want to know how condition ‘2’ on a stock trade affects the OHLCV, you can make the following request: ​

// GET /v3/reference/conditions?asset_class=stocks&data_type=trade&id=2


 "results": [ 

  { "id": 2, 
  "type": "sale_condition", 
  "name": "Average Price Trade",
  "asset_class": "stocks", 
  "sip_mapping": { 
  "CTA": "B", 
  "UTP": "W", 
  "FINRA_TDDS": "W" 

"update_rules": { 

  "consolidated": { 
  "updates_high_low": false, 
  "updates_open_close": false, 
  "updates_volume": true 

   "market_center": { 
   "updates_high_low": false,
   "updates_open_close": false, 
   "updates_volume": true 


"data_types": [ 





"status": "OK", 

"request_id": "ff53e56b645039df61bd933737b2ce92", 

"count": 1


The Conditions endpoint allows for filtering based on

, and
. In this case, our
is stocks, our
, and the condition ID is
, so our path all together is:


The same concept applies to Options data as well .​ The rules for updating the OHLCV are inside the

field. You’ll notice that there are two items inside of
: the
rules and the

The Securities Information Processors publish two sets of guidelines for aggregating based on these sale conditions: the consolidated processing guidelines and the “Market Center” processing guidelines. (See the CTA Output Specification, pg. 64, or the UTP Output Specification, pg. 43, for the sale conditions matrices and their guidelines for aggregation. Also see OPRA Output Specifications, pg. 24, for the option’s sale conditions and guidelines).

The Market Center guidelines are meant for aggregating on a per-exchange basis. On the other hand, currently only offers aggregates for the “consolidated” feed (meaning trades from all exchanges), so only the consolidated rules apply. ​ In this particular case, the ‘consolidated’ rules show that sale condition 2 (or “Average Price Trade”) only updates the volume, but not high and low:

is false and
is false, but
is true. ​

Note that OPRA and the Securities Information Processors publish end-of-day daily aggregate data, so their guidelines apply primarily to daily bars. Because we publish minute aggregates, for such data there are slight differences: in particular, trades in extended-hours markets can update OHLC for minute bars (otherwise there would be no minute aggregates during extended trading hours!).

Was this article helpful? us on Slack

Enter your email for an invite to our slack community!

Modernizing Wall St.

Reimagining financial market data for the 21st century.

About Polygon


Can’t find the answer you’re looking for? Contact our team.