Python API/ML Data Download Tips

I did a download test. For people doing % returns using Future%Chg or using ratios at the time of download you are ok! For people who are downloading the individual close/open prices you still need to account for splits. See below for why!

This is one of the tickers that had a future split that I downloaded using the python api:

You can see that the future prices for -6 and -11 days are all around $50 for the 8/27 date. Then on the next date 9/03 we see the prices fall to around $25. So the future dates account for the split price.

Granted I am not so sure about how the future%chg_d(5) is calculated. I thought that it would be a Monday to Monday price for 5 days, but it differs from my calculation. I also tried 6 days, but it is also different:
image

My future_change is: (Close(-6) / Close(-1) - 1) * 100. You can double check with the numbers in the table. I do recall checking that Close(-6) is the next weeks Monday, but maybe I am still missing something.

1 Like

If Iā€™m following, maybe the issue is that future_change is covering bars and future%chg_d_6 is covering weekdays. Since the 2023-08-27 period includes a holiday, an extra day is needed in the calculation.

Using future%chg() should work.

1 Like