Announcement

Collapse
No announcement yet.

Passing the value of an efs to length of built in CCI.

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

  • Passing the value of an efs to length of built in CCI.

    I have tried to do this in a variety of ways, but I keep getting the error message parameter number 1 of function cci is invalid.

    if i do this, i get a working efs of "HilbertCyclePeriod"-

    var Length = null

    function main() {

    Length = efsExternal("HilbertCyclePeriod.efs")

    return Length

    }

    if i try "return cci(Length, hlc3());" i get the error message listed above.

    ?

    This worked in older versions of esignal, but I don't want to go back.

  • #2
    Re: Passing the value of an efs to length of built in CCI.

    jlipinsky
    You may want to run a null check on the value of Length prior to passing it to the cci() function eg
    if(Length.getValue(0)==null) return;
    Alex


    Originally posted by jlipinsky
    I have tried to do this in a variety of ways, but I keep getting the error message parameter number 1 of function cci is invalid.

    if i do this, i get a working efs of "HilbertCyclePeriod"-

    var Length = null

    function main() {

    Length = efsExternal("HilbertCyclePeriod.efs")

    return Length

    }

    if i try "return cci(Length, hlc3());" i get the error message listed above.

    ?

    This worked in older versions of esignal, but I don't want to go back.

    Comment


    • #3
      Thanks for the suggestion Alex. I still get the same error.

      Again, if I simply return Length, I get a perfect copy of the efsexternal that I'm calling.

      And passing values in the manner described in my 1st post worked in older versions of esignal. I have no clue why it isn't working now.

      Thanks to anyone who can suggest a solution.

      Comment


      • #4
        Hi,

        I'm just guessing here but doesn't an efsExternal call return a series. If so, the variable "Length" is a series not a value and cci(...) requires a value as the first parameter.

        If the above is correct then you would need to get the last or current value of the series "Length" to use as the first parameter of cci(...).

        Alex, please correct any mistakes in my logic.

        Wayne
        Last edited by waynecd; 09-28-2009, 02:07 PM.

        Comment


        • #5
          Thanks for the input Wayne, I also tried this:

          var xStudy = null;

          function main() {

          if (xStudy == null) xStudy = efsExternal("HilbertCyclePeriod.efs");

          var myPlot = xStudy.getValue(0);


          return cci(myPlot, hlc3());
          }


          which results in the same error.

          Comment


          • #6
            Hi,

            Assuming that "HilbertCyclePeriods" returns only one value and using Alex's info from below:
            PHP Code:
            if(Length.getValue(0)==null) return; 
            Try:

            PHP Code:
            var xStudy null;

            function 
            main() { 

            if (
            xStudy == nullxStudy efsExternal("HilbertCyclePeriod.efs");

            var 
            myPlot xStudy.getValue(0);
            debugPrintln(myPlot);//use this to trobleshoot and delete when done.
            if(myPlot==null) return;

            return 
            cci(myPlothlc3());

            or maybe
            PHP Code:
            var xStudy null;

            function 
            main() { 

            if (
            xStudy == nullxStudy efsExternal("HilbertCyclePeriod.efs",0);

            debugPrintln(xStudy);//use this to trobleshoot and delete when done.
            if(xStudy==null) return;

            return 
            cci(xStudyhlc3());

            or last:
            PHP Code:
            var xStudy null;
            var 
            bInit=false;

            function 
            main() { 
            if(
            bInit==false){
            if (
            xStudy == nullxStudy efsExternal("HilbertCyclePeriod.efs");
            bInit=true;
            }
            var 
            myPlot xStudy.getValue(0);
            debugPrintln(myPlot);//use this to trobleshoot and delete when done.
            if(myPlot==null) return;

            return 
            cci(myPlothlc3());

            If these don't work, I'm out of ideas and defer to the experts.

            Wayne
            Last edited by waynecd; 09-28-2009, 02:40 PM.

            Comment


            • #7
              it's working--thanks everybody! i'm elated, particularly since i don't have much programming experience.

              i needed to add a simple test to ensure myPlot was > 0.

              thanks again.

              Comment

              Working...
              X