2

I have been struggling for over an hour, reading documentation, experimenting, google searching for information on how to ask for the closing price of the NASDAQ index. I don't want a stock on that index, I want the daily closing prices of the index itself. No stock name, no entity, no entity class that I have tried seems to work. Is this even possible?

K7PEH
  • 619
  • 1
  • 6
  • 16
  • According to the documentation, this should work FinancialData["^IXIC"] but it does not. There are a lot of issues with FinancialData. e.g. see this. – Rohit Namjoshi Mar 03 '20 at 20:44
  • @RohitNamjoshi -- yes, I tried that and other variations. Some of those seems to be known quantities but nothing is produced reported by Missing[NotAvailable]. But, for others an error is produced saying that the entity name, class, etc. is not known. I have had problems with FinancialData before, enough that for awhile I went directly to Yahoo via Python/SQL scripts which seemed to work better but definitely not nice as if it were integrated into Mathematica. – K7PEH Mar 03 '20 at 22:14
  • @VitaliyKaurov -- Thanks, got the link booked to read tomorrow. – K7PEH Mar 05 '20 at 02:49

2 Answers2

2

Tickers with a caret don't always work. But I think your post from 2020 is moot now, FinancialData["^IXIC"] works just fine in 13.3 on Linux.

I find the Yahoo Finance data API quite reliable and fast, have a look at

now=Round@AbsoluteTime[Date[]]-AbsoluteTime[{1970,1,1,0,0,0}];
Import["https://query1.finance.yahoo.com/v7/finance/download/^IXIC?period1=1410825600&period2="<>ToString[now]<>"&interval=1d&events=history&includeAdjustedClose=true"]
Andreas Lauschke
  • 4,009
  • 22
  • 20
0

As of version 13.1 this works:

(* get timeseries *)
nasdaq = FinancialData["^IXIC", "Close", {{2018, 1, 1}, {2022, 11, 03}}];

To get the daily closing prices you can do nasdaq["Values"]

You can also opreate directly on the TimeSeries

(*check most recent data*)
nasdaq["LastDate"] (* DateObject[{2022, 11, 2, 0, 0, 0}, "Instant", "Gregorian", 0.]*)
nasdaq["LastValue"] (* 10524.8 *)

(annualised vol) 16StandardDeviation@Differences@Log@nasdaq ( 0.267453 *)

(eye ball your data) DateListPlot[nasdaq]

Nasdaq