I am using the Alpha Vantage API for getting real-time stock data. The issue I am facing with the Indian market stocks(NSE) is that I am only getting partial data during market hours.
For Example:
This is how the output is during market hours. The intermediate entries between 9:30 and 12:00 are missing.
Time - STOCK - PRICE_CLOSE
9:15:00 - INFY - 1004.6
12:18:15 - INFY - 1007.3
The corrected output should be as follows(No missing intermediate entries):
Time - STOCK - PRICE_CLOSE
9:15:00 - INFY - 1004.6
10:15:00 - INFY - 1007.7
11:15:00 - INFY - 1009.2
12:15:00 - INFY - 1010.5
12:18:15 - INFY - 1007.3
The corrected view shows up as soon as the market hours come to an end. This is causing a lot of difficulty in doing any intra day real-time analysis. I wanted to know if others are also facing this issue? Is this happening only for NSE stocks? Any solution here? Has anyone contacted Alpha Vantage regarding this problem?
(Also sharing my code snippet below)
function_name <- "TIME_SERIES_INTRADAY"
stock_ticker <- stk_list$Symbol[i]
period <- "60min"
my_api_key <- "***************"
my_data_type <- "csv"
output_size <- "full"
api_call <- paste0("https://www.alphavantage.co/query?function=",
function_name,
"&symbol=",
stock_ticker,
"&interval=",
period,
"&outputsize=",
output_size,
"&apikey=",
my_api_key,
"&datatype=",
my_data_type)
t <- read.csv(url(api_call))