MathGroup Archive 2009

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

Search the Archive

Re: FinancialData and disjoint result sets from range and

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99811] Re: [mg99794] FinancialData and disjoint result sets from range and
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Fri, 15 May 2009 04:18:32 -0400 (EDT)
  • Reply-to: hanlonr at cox.net

list1 = FinancialData["GE", "High", {{2005}, {2006}, "Month"}]

{{{2005, 1, 3}, 31.20283420979795}, 
   {{2005, 2, 1}, 
     31.160102272727272}, 
   {{2005, 3, 1}, 
     31.05757071547421}, 
   {{2005, 4, 1}, 
     31.160552486187846}, 
   {{2005, 5, 2}, 
     31.781990131578954}, 
   {{2005, 6, 1}, 
     31.80428282828283}, 
   {{2005, 7, 1}, 
     30.646347826086956}, 
   {{2005, 8, 1}, 
     29.655156203510856}, 
   {{2005, 9, 1}, 
     29.814594594594595}, 
   {{2005, 10, 3}, 
     29.74874668239457}, 
   {{2005, 11, 1}, 
     31.33460246360583}, 
   {{2005, 12, 1}, 
     31.490853067047077}}

Needs["Calendar`"]

DayOfWeek /@ list1[[All, 1]]

{Monday,Tuesday,Tuesday,Friday,Monday,Wednesday,Friday,Monday,Thursday,Monday,Tuesday,Thursday}

list1 appears to be the High for the first trading day of each month in 2005 rather than the high during each month.

list2 = FinancialData["GE", "High", {{2005, 1, 1}, {2005, 2, 1}}]

{{{2005, 1, 3}, 
     31.203757857338065}, 
   {{2005, 1, 4}, 
     31.172143845089906}, 
   {{2005, 1, 5}, 
     30.74689674366825}, 
   {{2005, 1, 6}, 
     30.80918829376036}, 
   {{2005, 1, 7}, 
     30.762958333333327}, 
   {{2005, 1, 10}, 
     30.57458089668616}, 
   {{2005, 1, 11}, 
     30.22919491525423}, 
   {{2005, 1, 12}, 
     30.19691704035875}, 
   {{2005, 1, 13}, 
     30.14680669883622}, 
   {{2005, 1, 14}, 
     30.134600225225224}, 
   {{2005, 1, 18}, 
     30.43691879866518}, 
   {{2005, 1, 19}, 
     30.369130925507907}, 
   {{2005, 1, 20}, 
     30.199151823579314}, 
   {{2005, 1, 21}, 
     30.312200398519778}, 
   {{2005, 1, 24}, 
     30.202240499149184}, 
   {{2005, 1, 25}, 
     30.352268907563023}, 
   {{2005, 1, 26}, 
     30.535981966751198}, 
   {{2005, 1, 27}, 
     30.19612468407751}, 
   {{2005, 1, 28}, 
     30.256917482517483}, 
   {{2005, 1, 31}, 
     30.602291724328808}, 
   {{2005, 2, 1}, 30.77459206174201}}

DayOfWeek /@ list2[[All, 1]]

{Monday,Tuesday,Wednesday,Thursday,Friday,Monday,Tuesday,Wednesday,Thursday,Friday,Tuesday,Wednesday,Thursday,Friday,Monday,Tuesday,Wednesday,Thursday,Friday,Monday,Tuesday}

Monday {2005, 1, 17} was a US National holiday (MLK Birthday)

list2 appears to be the Highs for each trading day in Jan and the first trading day of Feb. The real oddity is that there are different values for {2005, 2, 1}

list1[[2]]

{{2005,2,1},31.1601}

list2 // Last

{{2005,2,1},30.7746}


Bob Hanlon

---- N <enoman.nr at gmail.com> wrote: 

=============
I have a puzzle, probably easily explained; apparently so easily
that it hasn't even appeared here.

>From examples in the Mathematica ref/FinancialData:

Give the monthly highs for a stock price over a range of dates:

  FinancialData["GE", "High", {{2005}, {2006}, "Month"}]

High is defined as:
  High: Highest price during the trading day

My guess, then, is that the source set is all intraday prices
for from start {2005,1,1} until end {2006,1,1}.

Consequentially I expect that there will be an intersection
for January between that result and this result:

  FinancialData["GE", "High", {{2005, 1, 1}, {2005, 2, 1}}]

There is not. The maximum for the date range:

  Map[#[[2]] &,
    FinancialData["GE", "High", {{2005, 1, 1}, {2005, 2, 1}}]] // Max

  = 31.2038

While from the earlier "Month" query we have

  = {{2005, 1, 3}, 31.2028}


If one considers that the date-range version might have a superset
of times, and the high occured in that interregnum, then comparing
March's result will disappoint: the opposite occurs (the high appears
in the "Month" result).

If one wishes to explain this by precision effect during calculation,
although I find that dubious, consider that FoldList[] on "Return"
will produce what "CumulativeReturn" delivers.

So, what's the simple explanation?

Thanks,
--N



  • Prev by Date: Re: Introducing the Wolfram Mathematica Tutorial
  • Next by Date: Re: Random choice
  • Previous by thread: Re: unrecognized USB devices
  • Next by thread: Re: FinancialData and disjoint result sets from range and