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 open-source

Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzarlo gratuitamente, ma il riutilizzo del codice è subordinato al rispetto del Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.

Vuoi usare questo script sui tuoi grafici?
/////////////////////////////////////////////////////////////////////////////////////
// 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)