Wrong sell price (on mainCalculateAnnualReturn)

I’m getting 11 tests succeded out of 12. After debugging for the last one, I understood that I’m taking the wrong close value that is affecting my sell price. The sell price should be 271 but I’m getting the value as 157.
Screenshot.
Crio Workspace

Things I need help with:
Understanding how to get the close value.

Any help would be appreciated. Thank you.

If the closing price of a stock is not available for the given end date, use the latest available data prior to the closing date.

1 Like