HellAmbro / Trading212API

Unofficial Trading212 API
MIT License
57 stars 27 forks source link

Stock split order correction #19

Closed Adam48521 closed 1 year ago

Adam48521 commented 1 year ago

Hi,

I am trying to use the order extract to create a time series dataset of my portfolio, however I have come across an issue when stocks undergo a stock split. If I want to calculate the rolling weighted average of any stocks which I have purchased, it fails on any stocks which have had a stock split.

In the order dataframe, the values are not corrected retrospectively (e.g. Tesla stock went from ~$800 Aug 24 to ~$250 on Aug 25th, but the share/purchase price just jumps to the lower value from the stock split date). Is there any way to correct for this on your end when scraping the data? On the T212 portfolio, it is obviously corrected for, so I am wondering at what point this is done and why the output is not retrospectively corrected in the order sheet.

Thanks, Adam

HellAmbro commented 1 year ago

Hi Adam, i will look at this asap.