MRK bad data for 2021-06-11

sip daily adjusted or not. bad l value

  {
    "c": 65.68,
    "h": 66.18,
    "l": 13.19,
    "n": 145181,
    "o": 66.06,
    "t": "2021-06-11T04:00:00Z",
    "v": 23794463,
    "vw": 65.55
  },

take minute data of the same day and this 13.19 number doesn’t even exist there.

Hi :waving_hand:

That low value is coming from this trade:

$ curl -s -H "APCA-API-KEY-ID: ${APCA_API_KEY_ID}" -H "APCA-API-SECRET-KEY: ${APCA_API_SECRET_KEY}" "https://data.alpaca.markets/v2/stocks/trades?symbols=MRK&start=2021-06-11T21:11:15.285373952Z&limit=1" | jq .
{
  "next_page_token": "TVJLfDE2MjM0NDU4Nzc2MDY0OTQ3MjB8RHw3MTY5Mjg3NDcwMDEwNw==",
  "trades": {
    "MRK": [
      {
        "c": [
          " ",
          "P"
        ],
        "i": 71692874700088,
        "p": 15.32,
        "s": 225,
        "t": "2021-06-11T21:11:15.285373952Z",
        "x": "D",
        "z": "A"
      }
    ]
  }
}

According to the CTS specification a trade with condition P should update the High / Low value of the consolidated daily bar. You can find more details about bar aggregation rules here.

Thanks for clarification. I don’t know about the rules but alpaca minute data dont have that trade inside of it. as well webull daily data, ibkr daily data, google finance yahoo finance etc.

So I am guessing that in this particular case this trade should be omitted. no?

If you look at the rule table I linked, you can see that the P trades don’t update the High / Low values of minute bars, only daily bars.

I checked another data provider, MASSIVE and they have the exact same daily bar:

$ curl -s "https://api.massive.com/v2/aggs/ticker/MRK/range/1/day/2021-06-11/2021-06-11?apiKey=$MASSIVE_KEY" | jq .
{
  "ticker": "MRK",
  "queryCount": 1,
  "resultsCount": 1,
  "adjusted": true,
  "results": [
    {
      "v": 13928356,
      "vw": 76.1233,
      "o": 76.71,
      "c": 76.27,
      "h": 76.86,
      "l": 15.32, 
      "t": 1623384000000,
      "n": 99433
    }
  ],
  "status": "OK",
  "request_id": "b1731023ae412cd23ecc8ec3154fb7d0",
  "count": 1
}
1 Like

oh ok, thanks for your help.