One Minute Data

This notebook shows some fits of intraday data to the stable 2:3 order statistic distribution at the one minute level.

The data come from http://www.freestockcharts.com/, where one minute data may be downloaded free of charge into a text file.  I generally do this at the end of the day so the files contain a little more than two days of data with the most recent day at the end.  The file names, have the format aaayymmdd.txt, where aaa is the ticker symbol in lower case,  yy is the two digit year, mm: month, dd: day.

I have placed a variety of files into a zipped folder at this URL: http://pages.suddenlink.net/rhr/fin06/minData.zip.  The program analyzes all the files in the folder.
9/18/13 and 10/30/13 were FOMC meeting end days, and show interesting patterns at the 14:00 statement release, particularly in the SPY trading.  The graphics are described detail in the preceding pages in the index on the website home page.

There are only 389 log returns on the intraday minute data, so extreme tail points may not be well represented affecting the accuracy of α, nevertheless, most of the fits appear to show a power tail and look pretty good.  It does appear that the tail exponent varies from day to day on the same issue with volatility.

fileNames=Import["http://pages.suddenlink.net/rhr/fin06/minData.zip","FileNames"]

(*Execute S23Distribution.nb first*)
Do[data=Import["http://pages.suddenlink.net/rhr/fin06/minData.zip",{"ZIP",fileNames[[i]]}];
data1=ImportString[data,"CSV"];
lastDay=Split[{Quiet@DateList[#1],#2,#3,#4,#5,#6}&@@@Rest[data1],#1[[1]][[3]]==#2[[1]][[3]]&][[-1]];
lr=Differences[Log[lastDay[[All,5]]]];
symbol=StringSplit[fileNames[[i]],"."][[1]];

parm=Quiet@S23MLFit[lr,{3,0,0.01,0}];
skd=SmoothKernelDistribution[lr];
h1=Histogram[lr,25,"PDF",Frame->True];
g1=Plot[{PDF[skd,x],S23PDF[x,parm]},{x,Min[lr],Max[lr]},PlotRange->All,PlotStyle->{{Thick,Darker[Green]},{Thick,Darker[Red]}},Frame->True];
empD=EmpiricalDistribution[lr];
mx=Max[Abs[lr]];
sz=300;
Print[GraphicsGrid[{{DateListPlot[lastDay[[All,{1,5}]],PlotRange->All,PlotLabel-> symbol<>" Minute Prices"],DateListPlot[Transpose[{Rest[lastDay[[All,1]]],lr}],Filling->0,FillingStyle-> {{Thick,Darker[Red]},{Thick,Darker[Red]}},PlotStyle->{Darker[Red],PointSize[0]},PlotRange->All,PlotLabel-> symbol<>" Minute Log Returns"]},{Show[h1,g1,PlotLabel->symbol<>" Log Return Histogram\nFit density (Red), Empirical Density (Green}",ImageSize->sz],LogLogPlot[{CDF[empD,-x],1-CDF[empD,x],CDF[S23OrderDistribution[Sequence@@parm],-x],1-CDF[S23OrderDistribution[Sequence@@parm],x]},{x,0.00001,mx},PlotRange->All,PerformanceGoal->"Speed",Frame->True,GridLines -> Automatic,PlotStyle->{Darker[Blue],Darker[Red],Darker[Blue],Darker[Red]},PlotLabel-> "Tail Fit "<>symbol<> " with Empirical Distribution",ImageSize->sz]}}]];
CellPrint[TextCell["Stable 2:3 Order Statistic Distribution Parameters, {α, β, γ, δ}: "<>ToString[AccountingForm[parm,6,NumberSigns->{"-",""}]],TextAlignment->Center,FontSize->14]];

Print[DistributionFitTest[lr,S23OrderDistribution[parm],{"TestDataTable","AndersonDarling"}]];
CellPrint[TextCell["\n******************",TextAlignment->Center,FontSize->14]],

{i,Length[fileNames]}]

Financial Data Analysis Home

CellPrint[TextCell["\n\n© Copyright " <> ToString[DateList[][[1]]] <> " Robert H. Rimmer, Jr.    " <> DateString[DateList[], "DateShort"], "Text"]]

© Copyright 2013 Robert H. Rimmer, Jr.    Sat 2 Nov 2013