iexcloud_api_wrapper icon indicating copy to clipboard operation
iexcloud_api_wrapper copied to clipboard

Get end day price for a particular date

Open munroe7 opened this issue 6 years ago • 2 comments

My Goal: I am trying to display if a stock is up or down on the 6m, 3m, 1m, and 1w chart. This way I can show a green or red circle in my app to signify the trend.

Is there an easy way to check this without pulling 6m data because that eats up your limit pretty quickly. I tried doing the following:

let threeMonthsAgo = await iex.history('SPY', {period: '3m', date: '20190624'});

but this didn't work. It's also more confusing that some of the history params aren't named the same in this wrapper. Shouldn't 'period' be 'range'?

munroe7 avatar Sep 24 '19 17:09 munroe7

try the following; it should work, any valid market date should work.

let threeMonthsAgo = await iex.history('SPY', { date: '20190624', chartByDay: true});

schardtbc avatar Oct 01 '19 00:10 schardtbc

let threeMonthsAgo = await iex.history('SPY', { date: '2019-06-24', chartByDay: true});

should work also.

schardtbc avatar Oct 01 '19 00:10 schardtbc