1
$\begingroup$

I would like to print only the stock price from below input , i have been trying since a couple of hours with no luck..this is what I did

Financial data for GE ={{{2016,1,4},30.4661},{{2016,1,5},30.4959},{{2016,1,6},30.0098},{{2016,1,7},28.7399},{{2016,1,8},28.2241},{{2016,1,11},28.353},{{2016,1,12},28.4125},{{2016,1,13},28.0157},{{2016,1,14},28.8292},{{2016,1,15},28.2637},{{2016,1,19},28.2637},{{2016,1,20},27.7776},{{2016,1,21},28.3629},{{2016,1,22},28.0157},{{2016,1,25},27.8173},{{2016,1,26},28.0852},{{2016,1,27},27.7776},{{2016,1,28},27.986},{{2016,1,29},28.8689}}

data4 = FinancialData["GE", "Price", {{2016, 1, 1}, {2016, 1, 29}}];
Print["Financial data for GE =", data4];


Print[" y coordinte value", lis[data4[1][0]]];

May I know where I am going wrong?

$\endgroup$
4
  • 1
    $\begingroup$ data4[[All, 2]] // Column $\endgroup$ Commented Feb 29, 2016 at 4:53
  • $\begingroup$ this is what I get when I try to run the examples of the documentation in 10.3.1 {{2000,1,1},{2000,4,1}} is not a valid date range for FinancialData, perhaps a bug? $\endgroup$ Commented Feb 29, 2016 at 4:56
  • $\begingroup$ Thank you Dr.belisarius....I was loooking for that...unfortunately i cannot mark your comment as solution....please advise me if there is anyway i can do it. $\endgroup$ Commented Feb 29, 2016 at 10:09
  • $\begingroup$ Bob's answer is more complete, don't need to post mine $\endgroup$ Commented Feb 29, 2016 at 15:38

1 Answer 1

3
$\begingroup$
data4 = FinancialData["GE", "Price",
   {{2016, 1, 1}, {2016, 1, 29}}];

The tabular data

{{{Style["Financial data for GE", Bold],
     SpanFromLeft}, {"ISO Date", "Price"}},
   ({DateString[#1, "ISODate"],
       #2} & @@@ data4)} // Flatten[#, 1] & //
 Grid[#, Frame -> All, FrameStyle -> LightGray] &

enter image description here

Incorporating the tabular data as Tooltip

DateListPlot[data4,
 Epilog -> {PointSize[Small],
   Tooltip[
      Point[#], 
      DateString[#[[1]], "ISODate"] <>
       "\n" <> ToString[#[[2]]]] & /@ 
    data4}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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