Announcement

Collapse
No announcement yet.

RSI of non builtin study?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • RSI of non builtin study?

    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);
    }
    Attached Files

  • #2
    legend
    At this time builtin studies cannot use custom variables. You will need to write your own RSI study
    Alex

    Comment


    • #3
      Thanks Alex, I've worked it out.

      Comment

      Working...
      X