S(t) is the spot price of a given currency pair on a given exchange at time t.
I is a closed interval in the domain of S
f(n,t) is the n-day
simple moving average of S(t)
p ϵ [0,1]
P is a probability function
For a given S, I, p, and i, calculate n such that P( S(t+i) ≥ f(n,t) ) ≥ p for all t in I.