Heikin Ashi Rsi Oscilator
Heikin Ashi Rsi Oscilator
//@version=4
//@author=JayRogers
////////////////////////////////////////////////////////////////////////////////
// //
// //
// //
// //
// - https://www.investopedia.com/terms/h/heikinashi.asp //
// //
// //
// //
// Heikin Ashi function and retain it's oscillating nature. That goal //
// was met more easily than I anticipated with quite delightful results. //
// //
// ====== DISCLAIMER //
// //
// Any trade decisions you make are entirely your own responsibility. //
// I've made an effort to squash all the bugs, but you never know! //
// //
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// //
// //
////////////////////////////////////////////////////////////////////////////////
string TT_HARSI = "Period for the RSI calculations used to generate the" +
string TT_PBIAS = "Smoothing feature for the OPEN of the HARSI candles." +
"\n\n** By changing the Open values, High and Low can also" +
string TT_SMRSI = "This option smoothes the RSI in a manner similar to HA" +
" open, but uses the realtime rsi rather than the prior" +
string TT_STOCH = "Uses the RSI generated by the above settings, and as such" +
string TT_STFIT = "Adjusts the vertical scaling of the stochastic, can help" +
" to prevent distortion of other data in the channel." +
////////////////////////////////////////////////////////////////////////////////
// //
// //
////////////////////////////////////////////////////////////////////////////////
// -- Candle config
i_colUp = input( color.teal, "Colour Pallette ", input.color, group = GROUP_CAND, inline =
INLINE_COL )
i_colDown = input( color.red, " ", input.color, group = GROUP_CAND, inline = INLINE_COL
)
minval = 1 )
i_mode = input( true, "Smoothed Mode RSI?", input.bool, group = GROUP_PLOT,
tooltip = TT_SMRSI )
i_showStoch = input( false, "Show Stochastic? ", input.bool, group = GROUP_STOCH, inline =
INLINE_STDS,
tooltip = TT_STOCH )
minval = 1 )
minval = 1 )
minval = 1 )
minval = 1, maxval = 50 )
i_upperx = input( 30, "OB Extreme", input.integer, group = GROUP_CHAN, inline = "OB",
minval = 1, maxval = 50 )
i_lowerx = input( -30, "OS Extreme", input.integer, group = GROUP_CHAN, inline = "OS",
////////////////////////////////////////////////////////////////////////////////
// //
// //
////////////////////////////////////////////////////////////////////////////////
// the high and low are tricky, because unlike "high" and "low" by
// themselves, the RSI results can overlap each other. So first we just go
// ahead and get the raw results for high and low, and then..
// ..make sure we use the highest for high, and lowest for low
////////////////////////////////////////////////////////////////////////////////
// //
// //
////////////////////////////////////////////////////////////////////////////////
// stoch stuff
[ O, H, L, C ] = f_rsiHeikinAshi( i_lenHARSI )
// shadow, invisible
// rsi color
////////////////////////////////////////////////////////////////////////////////
// //
// //
////////////////////////////////////////////////////////////////////////////////
// channel fill
plot( i_showStoch ? StochK : na, "Stoch K Shadow", not i_ribbon ? colShadow : colNone, 3 )
plot( i_showStoch ? StochD : na, "Stoch D Shadow", not i_ribbon ? colShadow : colNone, 3 )
plot_stochK = plot( i_showStoch ? StochK : na, "Stoch K", not i_ribbon ? colStochK : colNone, 1 )
plot_stochD = plot( i_showStoch ? StochD : na, "Stoch D", not i_ribbon ? colStochD : colNone, 1 )
// -- PEANUT