Test case Annualized Return No Data on EndDate fails - follow up

Follow up to Test case Annualized Return No Data on EndDate fails
I have locally tested this case using a future date as the end date and my code takes the latest date into consideration for the sell value.
I’m not sure what modifications and other checks that I’m missing for this one case. Any hint as to what this test case looks for would be awesome.

How are you taking the latest date? What is your approach?

I take the last element of the candles array that I receive from the API call for finding the sell value.

Which value are you taking for the sell value?
Sell value is the close value on the last date.

It’s sorted now. Earlier, I had bypassed the getStockQuote method and implemented my own method. Thanks for the effort!