66 lines
1.3 KiB
Plaintext
66 lines
1.3 KiB
Plaintext
///////////////////////////////////////////////////////
|
|
//
|
|
// SaherElm IT Center Stochastic Histogram
|
|
// ---------------------------------------------
|
|
// saherelm implementation of above oscillator ...
|
|
//
|
|
// Maintainer:
|
|
// ------------
|
|
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
|
|
//
|
|
//////////////////////////////////////////////////////
|
|
|
|
//
|
|
//@version=5
|
|
indicator(title="SaherElm Stochastic Histogram", shorttitle = "XS_STHS_OSC", overlay = false)
|
|
|
|
//
|
|
// START Inputs ....
|
|
//
|
|
STHSLength = input.int(defval= 14, minval = 1, title = "Length")
|
|
STHSSmoothK = input.int(defval = 3, minval = 1, title = "Smooth K")
|
|
//
|
|
// END Inputs ....
|
|
//
|
|
|
|
//
|
|
// START Functions ....
|
|
//
|
|
//
|
|
// END Functions ....
|
|
//
|
|
|
|
//
|
|
// START Calculations ....
|
|
//
|
|
STHSK = (ta.sma(ta.stoch(close, high, low, STHSLength), STHSSmoothK) - 50)
|
|
STHSColor = (STHSK > 0) ? color.green : (STHSK < 0) ? color.red : color.black
|
|
//
|
|
//
|
|
// END Calculations ....
|
|
//
|
|
|
|
//
|
|
// START Plots ....
|
|
//
|
|
// Draw Area ...
|
|
//
|
|
plot(series = STHSK, style = plot.style_histogram, color = STHSColor, title = "Histogram")
|
|
plot(series = STHSK, color = color.black, title = "Histogram Line")
|
|
//
|
|
// END Plots ....
|
|
//
|
|
|
|
//
|
|
// START Alerts ...
|
|
//
|
|
//
|
|
// END Alerts ...
|
|
//
|
|
|
|
//////////////////////////////////////////////////////
|
|
// TODOS:
|
|
// -------
|
|
// - []
|
|
//////////////////////////////////////////////////////
|