[R-SIG-Finance] Yahoo Finance Stock data (FTSEMIB.MI) Issue
Daniel Cegiełka
d@n|e|@ceg|e|k@ @end|ng |rom gm@||@com
Thu Jun 18 18:48:36 CEST 2020
I did it quickly, but you can write some script in R.
curl and json (5 years):
curl 'https://charts.borsaitaliana.it/charts/services/ChartWService.asmx/GetPrices' -H 'Connection: keep-alive' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'DNT: 1' -H 'X-Requested-With: XMLHttpRequest' -H 'Content-Type: application/json; charset=UTF-8' -H 'Origin: https://charts.borsaitaliana.it' -H 'Sec-Fetch-Site: same-origin' -H 'Sec-Fetch-Mode: cors' -H 'Referer: https://charts.borsaitaliana.it/charts/Bit/SummaryChart.aspx?code=CB.FTSEMIB&lang=en' -H 'Accept-Encoding: gzip, deflate, br' --data-binary '{"request":{"SampleTime":"1d","TimeFrame":"5y","RequestedDataSetType":"ohlc","ChartPriceType":"price","Key":"FTSEMIB.IDX","OffSet":0,"FromDate":null,"ToDate":null,"UseDelay":true,"KeyType":"Topic","KeyType2":"Topic","Language":"en-US"}}' --compressed > FTSEMIB.json
And try fromJSON() etc.
btw:
[1592352000000,19585.89,19625.63,19876.12,19487.39,19585.89]
1592352000000 <--- it looks like POSIX time in milliseconds :)
so you need an extra trick:
> x <- 1592352000000
> z <- x/1000
> z
[1] 1592352000
> class(z) <- 'POSIXct'
> z
[1] "2020-06-17 02:00:00 CEST"
Best regards,
Daniel
> On 18 Jun 2020, at 16:58, Christopher Kromm via R-SIG-Finance <r-sig-finance using r-project.org> wrote:
>
> To whom it may concern,
>
> I am interested in the FTSE MIB (or Milano Indice di Borsa) index. I am
> trying to download the data up to the present date (18 June 2020). I am
> using the get.hist.quote command in R from the tseries package.
>
> I noticed the FTSE MIB from yahoo has no pricing of any kind (open,
> closed, adjusted, etc.) from 12 February 2018 to present. It appears from
> the Yahoo site that the prices exist to the present day based on the
> summary charts, but the other charts don't seem to show data. I am assuming
> this stock is still used, which is why I am a bit confused by all the
> missing data.
>
> Is it possible to obtain this FTSE MIB data without all the missing data
> from Yahoo Finance?
>
> If this is possible, how?
>
> If I cannot get the data from Yahoo Finance, are there alternative
> suggested sources for an R user to get this data?
>
> Thank you.
>
> Here is the url and the Yahoo Finance data symbol.
>
> https://finance.yahoo.com/quote/FTSEMIB.MI?p=FTSEMIB.MI
>
> Symbol: FTSEMIB.MI
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.
More information about the R-SIG-Finance
mailing list