Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to plot stocks showing some of the local maxima. As an exercise I first tried to load Apple's stock data from Wolfram Alpha with the following code:

appledata =TimeSeries[WolframAlpha["AAPL", {{"History", 1}, "ComputableData"}][[1]]];
  Show[DateListPlot[appledata],DateListPlot[FindPeaks[TimeSeriesResample[appledata], 12], 
  Joined -> False,PlotStyle -> Directive[PointSize[0.03], Red]]] 

However, I am returning the following errors:

DateListPlot::ldata: TimeSeries[NotAvailable] is not a valid dataset or list of datasets. >>
FindPeaks::arg: The argument TimeSeriesResample[TimeSeries[NotAvailable]] at position 1 is not a consistent list of real values. >>
DateListPlot::ldata: FindPeaks[TimeSeriesResample[TimeSeries[NotAvailable]],12] is not a valid dataset or list of datasets. >>
Show::gcomb: Could not combine the graphics objects in Show[DateListPlot[TimeSeries[NotAvailable]],DateListPlot[FindPeaks[TimeSeriesResample[TimeSeries[NotAvailable]],12],Joined->False,PlotStyle->Directive[PointSize[0.03],\!\(\*GraphicsBox[{{GrayLevel[0], RectangleBox[{0, 0}]},{GrayLevel[0], RectangleBox[{1, -1}]},{RGBColor[1, 0, 0], RectangleBox[{0, -1}, {2, 1}]}},AspectRatio->1,Frame->True,FrameStyle-RGBColor[0.6666666666666666, 0., 0.],FrameTicks->None,ImageSize->{Automatic, 10.8},PlotRangePadding->None]\)]]]. >>

I'd like to move beyond just searching stocks such as Apple and be able to search tickers, maybe something like

share|improve this question
Before stacking all the functions just try to get the W|A call to return something useful on its own. Financial data is obtained through Yahoo finance (well, at least FinancialData does that) and the results can be less than stable. Sometimes the same call that worked 5 minutes ago doesn't work now. – Sjoerd C. de Vries Jul 12 '14 at 1:09
up vote 8 down vote accepted

Calling Wolfram|Alpha is not generally an efficient way to retrieve bulk data; where possible, it is better to use a built in data function.

Part of the problem is figuring out what to submit to Wolfram|Alpha. In the code you supplied, the issue begins with Wolfram|Alpha returning Missing[NotAvailable]. WolframAlpha["AAPL history",{{"HistoryDaily:Close:FinancialData",1},"ComputableData"}] worked for me, however.

In this case it is easier to use FinancialData, which at least has a documented syntax. So:


enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.