Distribution of Random TICKs

Let's start with a definition of a single tick value... we'll make a randum integer between -1 and 1.  Obviously,  -1 will represent a downtick, 1 will represent an uptick, and 0 will represent a zero-tick.

In[50]:=

singletick := Random[Integer, {-1, 1}] ;

Now, we need a way to generate a market full of single ticks, of any size we want....

In[51]:=

market[sz_] := Table[ singletick, {sz} ] ;

Ok, now let's generate the TICK for a market, which is just the sum of the single ticks (Total[] in Mathematica parlance)...

In[52]:=

tick[mkt_] := Total[  mkt ] ;

Alright, now let's compute 1 million ticks for random markets with 3000 stocks....

In[53]:=

manyticks = Table[ tick[ market[3000] ], {1000000} ] ;

Alright, what were the maximum and minimum TICK values in our million markets?

In[54]:=

Max[manyticks]

Out[54]=

219

In[55]:=

Min[manyticks]

Out[55]=

-215

How did the ticks end up distributed?  Let's plot them raw...

In[56]:=

ListPlot[manyticks]

[Graphics:HTMLFiles/TICK_distribution_10.gif]

Out[56]=

-Graphics -

It's obvious that the majority of the values fell between -150 and 150.  If we sort the values prior to plotting, this will become more clear....

In[57]:=

ListPlot[Sort[manyticks]]

[Graphics:HTMLFiles/TICK_distribution_13.gif]

Out[57]=

-Graphics -

We can draw a histogram, to see the distribution:

In[58]:=

<<Graphics`Graphics`

In[59]:=

Histogram[manyticks]

[Graphics:HTMLFiles/TICK_distribution_17.gif]

Out[59]=

-Graphics -


Created by Mathematica  (January 24, 2007) Valid XHTML 1.1!