Hello Everyone,
During trading hours, I want to download 5 minutes price data (OHLC and Volume) for all stocks for current day (or for the last few hours).
I use TOS API code below and it only download Yesterday instead of today.
Can you please help?
Thank you so much,
PYPL
endpoint = 'https://api.tdameritrade.com/v1/marketdata/{stock_ticker}/pricehistory?periodType={periodType}&period={period}&frequencyType={frequencyType}&frequency={frequency}'
# yesterday 1 minute
full_url = endpoint.format(stock_ticker='AAPL',periodType='day',period=1,frequencyType='minute',frequency=1)
During trading hours, I want to download 5 minutes price data (OHLC and Volume) for all stocks for current day (or for the last few hours).
I use TOS API code below and it only download Yesterday instead of today.
Can you please help?
Thank you so much,
PYPL
endpoint = 'https://api.tdameritrade.com/v1/marketdata/{stock_ticker}/pricehistory?periodType={periodType}&period={period}&frequencyType={frequencyType}&frequency={frequency}'
# yesterday 1 minute
full_url = endpoint.format(stock_ticker='AAPL',periodType='day',period=1,frequencyType='minute',frequency=1)