Historical data doesnt keep in touch with stock splits

barset = api.get_barset('OCN', '1D', limit=507,after="{}T09:30:00-04:00".format("2020-08-11"))["OCN"]

OCN got a stock split 1:15 on 2020-08-11 and the data I got from the bar set contains the pre and post-stock split price. So I got:

#first one is 8/11/2020, the second one is 8/12/2020
 Bar({'**c': 1.48,** 'h': 1.56, 'l': 1.42, 'o': 1.48, 't': 1597204800, 'v': 1549860}), 
Bar(**{'c': 21**, 'h': 22.2, 'l': 20.25, 'o': 22.2, 't': 1597291200, 'v': 55049})

literally right next to each other. I cant perform any calculations on this.
the Bar sets NEED to update stock price after stock split

Hi @darrenzou, thank you for reporting this, we are looking into the issue and will get back soon.

@darrenzou we are seeing the correct values for the adjusted data, are you using the adjustment parameter for querying?

{
    "bars": [
        {
            "t": "2020-08-11T04:00:00Z",
            "o": 24.15,
            "h": 24.45,
            "l": 21.75,
            "c": 21.75,
            "v": 101635,
            "n": 4320,
            "vw": 23.072055
        },
        {
            "t": "2020-08-12T04:00:00Z",
            "o": 22.2,
            "h": 23.4,
            "l": 21.3,
            "c": 22.35,
            "v": 49628,
            "n": 2636,
            "vw": 22.108935
        }
    ],
    "symbol": "OCN",
    "next_page_token": null
}
1 Like

I didnt know that existed, it wasn’t in the documentations, also shouldnt that be the default?

1 Like

I second darrenzou’s requests. I have not been able to find any references to the adjustment parameter on the documentation. Please let us know how to get it to work.
thanks

1 Like

Hi @darrenzou & @newbiealpaca,

Please see the adjustment parameter under bars: Historical data - Documentation | Alpaca

1 Like

thank you Abel, you are a lifesaver. I swear I reviewed the docs but for some reason I didnt see it.