I am figuring out what is the method quantconnect used to calculate the dividend adjusted stock price, please help me on this. Thanks in advance.

For example, IBM most recent ex-dividend date is May 9, 2018 and the dividend payout amount for the ordinary stock is 1.57. The unadjusted close stock price on May 8, 2018 is 142.99 and the dividend adjusted stock price is 141.42. It looks right since the difference between the adjusted and unadjusted price is the dividend amount. however, when I compare other prices before May 8, I don't get the correct answer. Say, on April 9 2018, The unadjusted close stock price is 152.69 and the dividend adjusted stock price is 151.01, It does not make sense for the dividend adjusted stock price because it supposed to be 151.12 ( 152.69 - 1.57 = 151.12 ). I would like to know the algroithm quantconnect used to calculate the dividend adjusted stock price as 151.01.

Author