Hacking Google Finance in Real-Time for Algorithmic Traders

21 October 2014, 18:16
TipMyPip
0
171

Forecasting risk in algorithmic stock trading is of paramount importance for everyone. You should always look for the ways how to detect sudden price changes and take immediate actions to protect your investments.

Imagine you opened a new long position last Wednesday for NASDAQ:NVDA buying 1500 shares at the market price of USD16.36. On the next day price goes down to USD15.75 at the end..

What the heck? Now we are one step closer to our own Hedge Fund, Right from our home.

If you have a problem believing me, Then go and read about the StartUp within 48 hours.

Or try to solve this :-)

Probably the most well-known examples of stopping times are (first) hitting times. They can be defined for general stochastic processes, but we will stick to simple random walks for the purposes of this example. So, let Xn = Pn k=0 ξk be a simple random walk, and let Tl be the first time X hits the level l ∈ N. More precisely, we use the following slightly non-intuitive but mathematically correct definition

Tl = min{n ∈ N0 : Xn = l}. The set {n ∈ N0 : Xn = l} is the collection of all time-points at which X visits the level l. The earliest one - the minimum of that set - is the first hitting time of l. In states of the world ω ∈ Ω in which the level l just never get reached, i.e., when {n ∈ N0 : Xn = l} is an empty set, we set Tl(ω) = +∞. In order to show that Tl is indeed a stopping time, we need to construct the decision functions Gn, n ∈ N0. Let us start with n = 0. We would have Tl = 0 in the (impossible) case X0 = l, so we always have G0 (X0) = 0. How about n ∈ N. For the value of Tl to be equal to exactly n, two things must happen:

(a) Xn = l (the level l must actually be hit at time n), and

(b) Xn−1 6= l, Xn−2 6= l, . . . , X1 6= l, X0 6= l (the level l has not been hit before).

Therefore,   G(x0, x1, . . . , xn) = (1, x0 6= l, x1 6= l, . . . , xn−1 6= l, xn = l 0, otherwise. )

The hitting time T2 of the level l = 2 for a particular trajectory of a symmetric simple

random walk is depicted below:

 

 After Solving Try the examples at the sources, and Start Up with your pleasureful model job seduction engineering... :-) hehehehe

Share it with friends: