Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Histograms and Iterators - Beginner Question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97992] Re: [mg97910] Re: Histograms and Iterators - Beginner Question
  • From: Jon Rogers <jroge at mac.com>
  • Date: Fri, 27 Mar 2009 05:36:21 -0500 (EST)
  • References: <200903251045.FAA24619@smc.vnet.net>

Thank you for the responses Raffy and Sjoerd.

Sjoerd - Actually a histogram is what I am looking for. I have had no  
problems generating the various other plots, but, a histogram of the  
daily trading volume usually next to a plot of the daily closing  
prices is a fairly standard financial chart. You are right that the  
online documentation is excellent and I have been putting it to good  
use. It does seem that there are a few gaps - but the FinanacialData  
function seems to be fairly new so they haven't run through many of  
the possible use scenarios yet.

Raffy - What you suggested has gotten me one step closer, but it is  
not exactly what I am trying to achieve. What you suggested produced a  
chart with a range of volumes on the X-Axis and the number of days in  
which those volumes occurred on the y-axis. What I would like is the  
volume level on the y-axis and days (time) to run along the x-axis.

Thanks for your assistance,

Jon



Begin forwarded message:

> From: Raffy <raffy at mac.com>
> Date: March 25, 2009 3:45:06 AM PDT
> To: mathgroup at smc.vnet.net
> Subject: [mg97910] Re: Histograms and Iterators - Beginner Question
>
> On Mar 24, 3:28 am, Jon Rogers <jr... at mac.com> wrote:
>> Hello everyone:
>>
>> I am a new Mathematica user and have been teaching myself the program
>> using real-world examples and reverse-engineering the code. This
>> approach has worked well for the last few months since I began, but I
>> have run into a roadblock and was hoping someone will help me out.
>>
>> I am currently trying to import financial data and generate a
>> histogram of the daily volume for a given security. Ultimately I am
>> going to make this into a sparkline (very useful in my work). Use of
>> the options to create the sparkline is clear. Where I am getting  
>> stuck =
>
>> is the importing and formatting of the data. I think setting up the
>> iterators is my problem, but I have tried about every option and have
>> not found the answer yet.
>>
>> I have been using the default examples in the online documentation of
>> IBM and March 1, 2004. Here are a few of the approaches I have tried:
>>
>> Histogram[Table[FinancialData["IBM","Volume"],{"March 1,2004"}]]
>>
>> Histogram[Table[FinancialData["IBM","Volume",i],{i,"March 1,2004"}]]
>>
>> Histogram[Table[FinancialData["IBM","Volume",i],{i,"March
>> 1,2004","March 20,2009"}]]
>>
>> Any suggestions,
>>
>> Thanks,
>>
>> Jon
>
> To get the volume data:
>
> volume = FinancialData["IBM", "Volume", {"Mar 1, 2004", "Mar 24,
> 2009"}, "Value"];
>
> Then just plot it:
>
> Histogram[volume]
>


--Boundary_(ID_8jNfVOe8dmVuqkXBbXsSYQ)
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
X-Sun-Content-Length: 5789

<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; ">Thank you for the responses =
Raffy and Sjoerd.<div><br></div><div>Sjoerd - Actually a histogram is =
what I am looking for. I have had no problems generating the various =
other plots, but, a histogram of the daily trading volume usually next =
to a plot of the daily closing prices is a fairly standard financial =
chart. You are right that the online&nbsp;documentation&nbsp;is =
excellent and I have been putting it to good use. It does seem that =
there are a few gaps - but the FinanacialData function seems to be =
fairly new so they haven't run through many of the possible use =
scenarios yet.</div><div><br></div><div>Raffy - What you suggested has =
gotten me one step closer, but it is not exactly what I am trying to =
achieve. What you suggested produced a chart with a range of volumes on =
the X-Axis and the number of days in which those =
volumes&nbsp;occurred&nbsp;on the y-axis. What I would like is the =
volume level on the y-axis and days (time) to run along the =
x-axis.</div><div><br></div><div>Thanks for your =
assistance,</div><div><br></div><div>Jon</div><div><br></div><div><br></di=
v><div><div><br><div>Begin forwarded message:</div><br =
class="Apple-interchange-newline"><blockquote type="cite"><div><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; "><font face="Helvetica" size="3" color="#000000" =
style="font: 12.0px Helvetica; color: #000000"><b>From: =
</b></font><font face="Helvetica" size="3" style="font: 12.0px =
Helvetica">Raffy &lt;<a =
href="mailto:raffy at mac.com">raffy at mac.com</a>&gt;</font></div><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; "><font face="Helvetica" size="3" color="#000000" =
style="font: 12.0px Helvetica; color: #000000"><b>Date: =
</b></font><font face="Helvetica" size="3" style="font: 12.0px =
Helvetica">March 25, 2009 3:45:06 AM PDT</font></div><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; "><font face="Helvetica" size="3" color="#000000" =
style="font: 12.0px Helvetica; color: #000000"><b>To: </b></font><font =
face="Helvetica" size="3" style="font: 12.0px Helvetica"><a =
href="mailto:mathgroup at smc.vnet.net">mathgroup at smc.vnet.net</a></font></=
div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: =
0px; margin-left: 0px; "><font face="Helvetica" size="3" =
color="#000000" style="font: 12.0px Helvetica; color: =
#000000"><b>Subject: </b></font><font face="Helvetica" size="3" =
style="font: 12.0px Helvetica"><b>[mg97910] Re: Histograms and =
Iterators - Beginner Question</b></font></div><div style="margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; =
min-height: 14px; "><br></div> </div><div>On Mar 24, 3:28 am, Jon Rogers =
&lt;jr... at mac.com&gt; wrote:<br><blockquote type="cite">Hello =
everyone:<br></blockquote><blockquote =
type="cite"><br></blockquote><blockquote type="cite">I am a new =
Mathematica user and have been teaching myself the program =
&nbsp;<br></blockquote><blockquote type="cite">using real-world =
examples and reverse-engineering the code. This =
&nbsp;<br></blockquote><blockquote type="cite">approach has worked =
well for the last few months since I began, but I =
&nbsp;<br></blockquote><blockquote type="cite">have run into a =
roadblock and was hoping someone will help me =
out.<br></blockquote><blockquote =
type="cite"><br></blockquote><blockquote type="cite">I am currently =
trying to import financial data and generate a =
&nbsp;<br></blockquote><blockquote type="cite">histogram of the daily =
volume for a given security. Ultimately I am =
&nbsp;<br></blockquote><blockquote type="cite">going to make this into =
a sparkline (very useful in my work). Use of =
&nbsp;<br></blockquote><blockquote type="cite">the options to create =
the sparkline is clear. Where I am getting stuck =
=<br></blockquote><br><blockquote type="cite">is the importing and =
formatting of the data. I think setting up the =
&nbsp;<br></blockquote><blockquote type="cite">iterators is my =
problem, but I have tried about every option and have =
&nbsp;<br></blockquote><blockquote type="cite">not found the answer =
yet.<br></blockquote><blockquote =
type="cite"><br></blockquote><blockquote type="cite">I have been =
using the default examples in the online documentation of =
&nbsp;<br></blockquote><blockquote type="cite">IBM and March 1, 2004. =
Here are a few of the approaches I have =
tried:<br></blockquote><blockquote =
type="cite"><br></blockquote><blockquote =
type="cite">Histogram[Table[FinancialData["IBM","Volume"],{"March =
1,2004"}]]<br></blockquote><blockquote =
type="cite"><br></blockquote><blockquote =
type="cite">Histogram[Table[FinancialData["IBM","Volume",i],{i,"March =
1,2004"}]]<br></blockquote><blockquote =
type="cite"><br></blockquote><blockquote =
type="cite">Histogram[Table[FinancialData["IBM","Volume",i],{i,"March =
&nbsp;<br></blockquote><blockquote type="cite">1,2004","March =
20,2009"}]]<br></blockquote><blockquote =
type="cite"><br></blockquote><blockquote type="cite">Any =
suggestions,<br></blockquote><blockquote =
type="cite"><br></blockquote><blockquote =
type="cite">Thanks,<br></blockquote><blockquote =
type="cite"><br></blockquote><blockquote =
type="cite">Jon<br></blockquote><br>To get the volume =
data:<br><br>volume = FinancialData["IBM", "Volume", {"Mar 1, 2004", =
"Mar 24,<br>2009"}, "Value"];<br><br>Then just plot =
it:<br><br>Histogram[volume]<br><br></div></blockquote></div><br></div></b=
ody></html>=

--Boundary_(ID_8jNfVOe8dmVuqkXBbXsSYQ)--


  • Prev by Date: Re: Asking PlotRange to take a Dynamic value
  • Next by Date: Re: HoldAll for Integrate
  • Previous by thread: Re: Histograms and Iterators - Beginner Question
  • Next by thread: Re: Histograms and Iterators - Beginner Question