This is a section of script for RSI Bands. I'd like to make the source price "hlc3" rather than close?
I'm happy with adding the addoption and functionparameter (string) but need a little help where to add the "source" within the funtion main.
I'm happy with adding the addoption and functionparameter (string) but need a little help where to add the "source" within the funtion main.
PHP Code:
function main(nPeriods, nUpper, nLower, cColorU, cColorL, nThick, bClamp) {
var nState = getBarState();
var nIndex = getCurrentBarIndex();
if (bVersion == null) bVersion = verify();
if (bVersion == false) return;
if (bInit == false) {
setStudyTitle("RSI Bands (" + nPeriods + ", " + nUpper + ", " + nLower + ")");
setCursorLabelName("RSIB"+nUpper, 0);
setCursorLabelName("RSIB"+nLower, 1);
setDefaultBarFgColor(cColorU, 0);
setDefaultBarFgColor(cColorL, 1);
setDefaultBarThickness(nThick, 0);
setDefaultBarThickness(nThick, 1);
xUpperRSI = efsInternal("RSI_Band", nPeriods, nUpper, bClamp );
xLowerRSI = efsInternal("RSI_Band", nPeriods, nLower, bClamp );
bInit = true;
}
var nUpperRSI = xUpperRSI.getValue(0);
var nLowerRSI = xLowerRSI.getValue(0);
if (nUpperRSI == null || nLowerRSI == null) return;
return new Array(nUpperRSI, nLowerRSI);
}
Comment