Announcement

Collapse
No announcement yet.

Sma problem

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

  • Sma problem

    Hi,

    I have a problem with function "sma"

    exapmle:

    function main(Length,Lengthn){

    if(Length==null) Length = 4;
    if(Lengthn==null) Lengthn = 14;

    var PVI = efsInternal("calcPVI");
    var NVI = efsInternal("calcNVI");

    var PVINVI = PVI + NVI;

    var MaPVINVI1 = sma(Length,PVINVI);
    var MaPVINVI2 = sma(Lengthn,MaPVINVI1);

    return (MaPVINVI1,MaPVINVI2);

    }


    _____________________
    Error:

    "...line 22: Parameter Number 2 of Function sma is invalid "

    var MaPVINVI2 = sma(Lengthn,MaPVINVI1); !!!

    Why? How Can resolve it?
    Last edited by micman2; 06-09-2007, 04:12 AM.

  • #2
    micman2,

    Your line
    var PVINVI = PVI + NVI;
    is trying to add 2 series and create a new series. This won't work which is why PVINVI is invalid. You could use another efsInternal call to generate the PVINVI series and then use that series in the sma call.

    Steve

    Comment

    Working...
    X