Date Format for Mathematica

Since I am trying to build several financial time series in Mathematica, I just ran into the problem illustrated in the figure below:

It seems that data is no longer being considered after 2000

Is there any way to fix this?

What would be the best format for exporting time series from Bloomberg or Excel to use them in Mathematic (using version 8).

I know about the function of FinancialData. However, without knowing the exact characters, it is extremely difficult to use Mathematica for this.

enter image description here

+4
source share
3 answers

Use the DateFunction parameter to tell DateListPlot how to convert dates:

 DateFunction -> (DateList[{#, {"MonthNameShort", "YearShort"}}] &) 

(Brackets are important.)

+5
source

Why not use the WolframAlpha function [...] - it imports the native Mathematica format and matches current dates:

  timeseries = WolframAlpha["msft close Jan 1, 2010 to Jan 21 2011", {{"DateRangeSpecified:Close:FinancialData", 1}, "TimeSeriesData"}]; DateListPlot[timeseries] 

enter image description here

This was just an input example. I'm not sure what kind of data you need exactly, but you can get a lot of it with the WolframAlpha function. Read this:

1) WolframAlpha 2) Data formats in Wolfram | Alpha

+6
source

Here, the function of converting these date strings to Mathematica format can do better:

 dateConv = With[{s = StringSplit[#, "-"]}, {DateList[{s[[2]], "YearShort"}][[1]], DateList[s[[1]]][[2]]}] & 

You can try

 DateListPlot[data, DateFunction -> dateConv] 

EDIT: I originally tried DateList[{"Nov-11", {"MonthNameShort", "YearShort"}}] , but that tells me String "Nov- 11" cannot be interpreted as a date in format {"MonthNameShort", "YearShort"}. . Perhaps a mistake?

+3
source

Source: https://habr.com/ru/post/1391464/


All Articles