nboone

Stochastic Histogram

Last Edited: 5/19/16

Description:
This is a basic Stochastic histogram that essentially shows when the indicator
is either above or below the 50 level. Colors can be customized to your liking.
Length and smoothing factor can be adjusted as well. Defaults are 14 (Length)
and 3 (Smoothing Factor).


NOTE: The above chart contains the built-in stochastic indicator for comparison.
Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?
/////////////////////////////////////////////////////////////////////////////////////
// Last Edited: 5/19/16                                                            //    
// Created By: nboone                                                              //
//                                                                                 //
// Description:                                                                    //
// This is a basic Stochastic histogram that essentially shows when the indicator  //
// is either above or below the 50 level. Colors can be customized to your liking. //
// Length and smoothing factor can be adjusted as well. Defaults are 14 (Length)   //
// and 3 (Smoothing Factor).                                                       //                
/////////////////////////////////////////////////////////////////////////////////////
study(title="Stochastic Histogram", shorttitle="NB_StochHist")
length = input(14, minval=1)
smoothK = input(3, minval=1)

k = (sma(stoch(close, high, low, length), smoothK) - 50)
c = (k > 0) ? green : (k < 0) ? red : black

plot(k, style=histogram, color=c)
plot(k, color=black)