# Stochastic Cyber Cycle

This study calculates and displays a Stochastic Cyber Cycle and Trigger Line for the data given by the Input Data Input. This study is an ACSIL implementation of the Indicator given in Figures 8.4 and 8.5 of the book Cybernetic Analysis for Stocks and Futures by John Ehlers.

Let $$X$$ be a random variable denoting the Input Data, and let the Length Input be denoted as $$n$$.

We begin by computing the Stochastic Ratio of the Cyber Cycle, $$StochRat_t(CC(X,n),n)$$.

Then we compute a smoothed Stochastic Ratio, denoted as $$StochRat_t^{(S)}(CC(X,n),n)$$, which we compute as follows.

$$\displaystyle{StochRat_t^{(S)}(CC(X,n),n) = \frac{1}{10}\sum_{j = 1}^4 j \cdot StochRat_{t - 4 + j}(CC(X,n),n)}$$

We then compute the Stochastic Cyber Cycle, denoted as $$CC^{(Stoch)}_t(X,n)$$, as follows.

$$CC^{(Stoch)}_t(X,n) = 2\left(StochRat_t^{(S)}(CC(X,n),n) - 0.5\right)$$

The Trigger Line for this Indicator is given below.

$$Trig^{(SCC)}_t(X,n) = 0.96\left(CC^{(Stoch)}_{t - 1}(X,n) + 0.02\right)$$