The Stochastic oscillaor

The Stochastic Oscillator (STOCH) consists of 2 lines, the main line is called the %K and the second line is called the %D. Both lines have a value between 0 and 100 and they will cross eachother on a regular basis. Both lines are calculated over a different period. In the picture below you will see an example of the STOCH indicator, the %K is the blue line and the %D is the red line. How does STOCH work?

When the %K line crosses the %D line upwards it is considered a buy signal, when the %K crossed down the %D it is considered to be a sell signal. As you can see in the example above, both lines cross eachother very frequently. Therefore it is used as a confirming indicator and not as a primary strategy because if you want to do that there are a lot of other factors that should be considered. A cross is considered a strong signal when it happens in the correspondending area like you may know from the RSI indicator. So if a buy cross happens below 30 it is considered a strong buy signal and if a sell cross happens above 70 it is a stong sell signal. Below is an example chart with circles around the strong signals. How to use STOCH in Gunbot

Like previously stated, you can only use STOCH as a confirming indicator, this means that both the setting of the main strategy AND the STOCH settings will have to be met before Gunbot will place an order. You will use STOCH for both buy and sell orders, in the example below we well show how it works.

Example: You are using GAIN as buy strategy with buy_level: 1 and you use STOCH as confirming indicator with STOCH_BUY_LEVEL: 30. When the price of a coin drops 1% below the lowest EMA, Gunbot will become interested in buying. But before it will place a buy order, Gunbot will check if both the %K as the %D lines are below 30. If this is the case then a buy order will be placed, if it is not than Gunbot will keep monitoring untill both lines are below 30 before placing a buy order. In any case, both the Gain settings as the STOCH settings will have to be met before Gunbot places an order.

This example can also be used with sell orders, only then Gunbot will check if both lines are above STOCH_SELL_LEVEL before an order is placed. To find out what the best settings for the STOCH buy and sell level are we highly advise to use the Backtesting add-on to find the most profitable settings for each pair you run.

To add STOCH as a confirming indicator, go to Settings > Strategy configurator and select the strategy you want to apply it on and go to the Indicator tab to enable STOCH for this strategy. When you click the Stoch Enabled button, a few new fields will appear which allows you to set all the STOCH related parameters, you will find an overview of all of them on the bottom of this article `STOCH_ENABLED` false Values: true or false. Setting this to true will make sure Gunbot only trades when both strategy trade conditions and `STOCH_BUY_LEVEL`/`STOCH_SELL_LEVEL` are met. `STOCH_METHOD` oscillator Values: oscillator or cross. Sets the method for using Stochastic. See `STOCH_BUY_LEVEL` and `STOCH_SELL_LEVEL` for detailed describtions of both methods. `STOCH_BUY_LEVEL` 20 Values: numerical, ranging between 1 and 99. Set this to the maximum Stochastic level you want to allow buy orders at.When set to 30, buy orders will only be placed when Stochastic is between 0 and 30. `STOCH_METHOD` = oscillator: a buy signal occurs when both Stoch %K and %D are below the set buy level. `STOCH_METHOD` = cross: a buy signal occurs when both Stoch %K and %D are below the set buy level, additionally %K must cross over %D. `STOCH_SELL_LEVEL` 80 Values: numerical, ranging between 1 and 99. Set this to the minimum Stochastic level you want to allow sell orders at.When set to 70, sell orders will only be placed when Stochastic is between 70 and 100. `STOCH_METHOD` = oscillator: a sell signal occurs when both Stoch %K and %D are above the set sell level. `STOCH_METHOD` = cross: a sell signal occurs when both Stoch %K and %D are above the set sell level, additionally %K must cross down %D. `STOCH_K` 14 Values: numerical, represents a number of periods. The number of periods used for calculating Stochastic %K. `SLOW_STOCH_K` 3 Values: numerical, represents a number of periods. The number of periods used for calculating Slow Stochastic %K. `STOCH_D` 3 Values: numerical, represents a number of periods. The number of periods used for calculating Stochastic %D.