0
$\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$
  • 1
    $\begingroup$ data4[[All, 2]] // Column $\endgroup$ – Dr. belisarius Feb 29 '16 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$ – tsuresuregusa Feb 29 '16 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$ – kranthi kumar Feb 29 '16 at 10:09
  • $\begingroup$ Bob's answer is more complete, don't need to post mine $\endgroup$ – Dr. belisarius Feb 29 '16 at 15:38
2
$\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, privacy policy and cookie policy

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