Hi, I'm trying to check that the values for SharesOutstanding in the Fundamental dataset are correct. I use the following code in my research notebook:

qb = QuantBook()
ticker = 'AAPL' # let's try for Apple
symbol = qb.AddEquity(ticker)
# for aprox 10 years
history = qb.History(Fundamental, qb.Securities.Keys, 365 * 10, Resolution.Daily).loc[ticker]

# print values for the first and the last items
print(f"first on {history.iloc[0].name}: {history.iloc[0]['companyprofile'].SharesOutstanding}")
print(f"last on {history.iloc[-1].name}: {history.iloc[-1]['companyprofile'].SharesOutstanding}")

# let's check. maybe not all items have the same data.
shares_outstanding = [x.SharesOutstanding for x in history['companyprofile']]
for i, x in enumerate(shares_outstanding):
    if x != shares_outstanding[0]:
        print(f"(i): (x)") # <-- this doesn't get printed
print(f"completed. i: {i}")

and I get the following:

first on 2009-06-26 00:00:00: 15552752000
last on 2023-12-23 00:00:00: 15552752000
completed. i: 3649

That is all items in the history seem to have the same value for SharesOutstanding. I believe that it should not be the same. On tradingview I see that the number of shares outstanding gets decreased every quarter. The same thing reproduces for MSFT.

I suspect that I'm doing something wrong. Could you please suggest.

PS: I'm new to quantconnect and I just started to try it on a free (not paid) account.