Is it possible to create an efs for an RSI of a custom indicator rather than just an RSI of a builtin study?
I have written the following script to show a 10 period RSI of the StandardDeviation function. However, I get the following error message: RSIStudy parameter 2 invalid.
I've attached StandardDeviation.efs, though this appears to be called in without problem.
Any help would be greatly appreciated.
Many thanks.
function preMain() {
setStudyTitle("Comp");
setDefaultBarFgColor(Color.yellow)
setCursorLabelName("Comp");
addBand(70, PS_SOLID, 2, Color.red, "Upper");
addBand(30, PS_SOLID, 2, Color.red, "Lower");
}
function main(nCompLength,sdStudy) {
var sdStudy = callFunction("/Library/StandardDeviation.efs", "main", 10, "Close");
var Comp = null;
if (nCompLength == null) nCompLength = 10;
if (sdStudy == null) return;
if (Comp == null) Comp = new RSIStudy(nCompLength, sdStudy);
return Comp.getValue(RSIStudy.RSI);
}
I have written the following script to show a 10 period RSI of the StandardDeviation function. However, I get the following error message: RSIStudy parameter 2 invalid.
I've attached StandardDeviation.efs, though this appears to be called in without problem.
Any help would be greatly appreciated.
Many thanks.
function preMain() {
setStudyTitle("Comp");
setDefaultBarFgColor(Color.yellow)
setCursorLabelName("Comp");
addBand(70, PS_SOLID, 2, Color.red, "Upper");
addBand(30, PS_SOLID, 2, Color.red, "Lower");
}
function main(nCompLength,sdStudy) {
var sdStudy = callFunction("/Library/StandardDeviation.efs", "main", 10, "Close");
var Comp = null;
if (nCompLength == null) nCompLength = 10;
if (sdStudy == null) return;
if (Comp == null) Comp = new RSIStudy(nCompLength, sdStudy);
return Comp.getValue(RSIStudy.RSI);
}
Comment