Announcement

Collapse
No announcement yet.

setOnApply()

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

  • setOnApply()

    I am trying to figure out what this function does...the example code gives an error. Please advise.

    var bInit = false;
    var xSeriesMA = null;

    var fpArray = new Array();

    function preMain(){

    setPriceStudy(true);
    setStudyTitle("Moving Average");
    setOnApply();

    var x=0;

    fpArray[x] = new FunctionParameter("Length",FunctionParameter.NUMBE R);
    with(fpArray[x++]){
    setLowerLimit(1);
    setDefault(20);
    }
    };

    function main(Length){
    if(bInit == false){
    setColorPriceBars(true);
    xSeriesMA = getSeries(sma(Length));
    bInit = true;
    };

    return xSeriesMA;
    }

  • #2
    AndresPR
    See this article in the EFS KnowledgeBase. FYI I found the article by searching the KB for the word "setOnApply()"
    As to the error it is caused by the setColorPriceBars() statement which should be used in the preMain() function only
    Alex


    Originally posted by AndresPR View Post
    I am trying to figure out what this function does...the example code gives an error. Please advise.

    var bInit = false;
    var xSeriesMA = null;

    var fpArray = new Array();

    function preMain(){

    setPriceStudy(true);
    setStudyTitle("Moving Average");
    setOnApply();

    var x=0;

    fpArray[x] = new FunctionParameter("Length",FunctionParameter.NUMBE R);
    with(fpArray[x++]){
    setLowerLimit(1);
    setDefault(20);
    }
    };

    function main(Length){
    if(bInit == false){
    setColorPriceBars(true);
    xSeriesMA = getSeries(sma(Length));
    bInit = true;
    };

    return xSeriesMA;
    }

    Comment

    Working...
    X