A stochastic system is one that works mostly by chance. It is therefore a mathematical algorithm that deals with processes whose evolution is random and that bases its result on probabilities that change over time. The fact that probability calculations vary over time is the difference with a non-stochastic probabilistic model.

From the previous words we can deduce that the stochastic indicator will provide us with a value that corresponds to a probability that will help us to predict the behavior of the market. Stochastic series in financial markets were applied for the first time in the 1950s and since then stochastic has been one of the most common indicators in technical analysis.

Stochastic is, by definition, an oscillator-type indicator that ranges from 0 to 100, measuring overbought and oversold conditions in the market.

The Stochastic is made up of two lines, called% K and% D. The K line is the stochastic itself and the% D line is a moving average of% K (once again we have two lines obtained from the same calculation, a slow (% D) and a fast (% K) whose crossing can be use as buy and sell signals).

The formula:

% K = 100x (C-Min) / Max-Min

Where C is the value of the last close, Max is the maximum of the calculation period and Min the minimum for the same period, by default this period is 5 and% D is the moving average of% K of 3 periods.

Looking at the formula we can see that if the closing price approaches the minimum values for the period,% K will decrease. In the same way, if the closing is close to the maximum of the period,% K will increase. Therefore we can say, in a more practical way, that the stochastic informs us about the situation of the closing price of the last candle with respect to the maximum and minimum of the period given for the calculation.

## Practical use of stochastic

The most popular form of use of stochastic is through overbought and oversold zones and the crossing of% D with% K. As with other oscillator-type indicators, the use of divergences between price and indicator is also common.

- Crossover of% K and% D: As we said a few paragraphs above, the% D line is a moving average of the% K line, the same concept of the crossing of moving averages can be used to take signals. In the case of the stochastic indicator, the slow moving average is% D and the fast moving average is% K, therefore a buy signal will appear when the% K line crosses, from the bottom up, the% D line. On the contrary, a sell signal will appear when the% D line crosses, from top to bottom, the% K line. These crossing signals of% K and% D generate too many false signals, however, their reliability can be greatly increased by taking along with the overbought and oversold areas that we will see below.
- Overbought and oversold zones: When the stochastic indicator is added to a chart, you can, among other options, choose two levels that will help you mark the overbought and oversold zones. These levels are set by default at 80 and 20.
- In short, when the stochastic falls below the lower level, it will be said that the price of the currency pair in question is oversold and that an upward movement can be expected. The ideal time to go up in this situation is the one that coincides with the crossing of% K and% D from bottom to top.
- Quote / Stochastic divergence: Analogously to the divergences of any other oscillator divergences can be constructed using stochastic in such a way that when new highs appear higher and higher in the price and its corresponding peaks in the stochastic are progressively smaller, a bearish divergence will appear that can be a sell signal. The bullish divergence, which will be taken as a possible buy signal, appears when the price appears lower and lower consecutive lows and the corresponding lows in the stochastic are increasing.