Confused about endate

In TODOS it is given:

// Find out the closing price of the stock on the endDate and
// return the list of all symbols in ascending order by its close value on
// endDate

Is the endDate in the above comment the last data at which stock price is available or the args[1] argument provided from command line.
This is a bit confusing because some stocks dont have prices on the endDate given by args[1],
for e.g. for testcase : ./gradlew run --args=“trades.json 2020-01-01”
args[1] endDate = 2020-01-01
but there is no price for any symbol at endDate 2020-10-10 in the response.
So do i return an empty list or use the last date present in the response object ?

do you have the getforobject method in you portfoliomanagerapplication.java file

as said in todo
// Use RestTemplate#getForObject in order to call the API,

i am unable to find it

How end date works in Tiingo is like it take previous date of end date and it is obvious that 2020-10-10 will not give you anything because 09 October 2020 is yet to come. So just return your answer accordingly.

You’re going in right direction just let me know if you’re having any trouble with this. :blush:

Otherwise close this question It may help others!!

How you solve merge conflicts please explain in detail in other topic.

so i guess you take the close price of last available date of each symbol. Will try it out.

1 Like

Take a try! :star_struck::100:
If I say something beyond this that will be the answer. I just want to say that. You’re in right direction.

tescases working well thank you

1 Like

i didn’t get it, can you give some more hint?

@anmol1point0 try this, it will work


See above comments and just think like that If one person purchases stock on date x, and want to see the value of stock on y date where y > current date, then Tiingo api return all the prices between x and current date. Not up to y-1 date.

yes, so i should take the latest date i am getting from json file. right?

Just try IT!!! It will work :slight_smile: