Announcement

Collapse
No announcement yet.

getValue(CCIStudy.CCI) vs. getValue(0)

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • getValue(CCIStudy.CCI) vs. getValue(0)

    Assuming I have a CCI Study. I'm trying to determine the different between calling .getValue(0) and .getValue(CCIStudy.CCI) on it would be.

    I've been trying to find documentation on this. If I missed it, please direct me to the location for future reference.

    Thanks,
    Mike

  • #2
    Re: getValue(CCIStudy.CCI) vs. getValue(0)

    Mike
    Those are methods of different functions.
    .getValue(CCIStudy.CCI) is used with the CCIStudy() function while .getValue(0) is used with any function that returns a Series Object (such as the cci() function - see the link for a specific example of this)
    Alex


    Originally posted by mhufnagel
    Assuming I have a CCI Study. I'm trying to determine the different between calling .getValue(0) and .getValue(CCIStudy.CCI) on it would be.

    I've been trying to find documentation on this. If I missed it, please direct me to the location for future reference.

    Thanks,
    Mike

    Comment


    • #3
      Hi Alex,

      Thanks for the response and link. That article doesn't make reference to the value CCIStudy.CCI.

      Let me elaborate on my question. This code is taken from the article you sent.

      var xStudy = null;

      function main() {
      if (xStudy == null) {
      xStudy = cci(20);
      }

      // retrieve single values for conditional statements
      var nValue_0 = xStudy.getValue(0); // Current Bar Index value
      var nValue_1 = xStudy.getValue(-1); // Prior Bar Index value

      return nValue_0; // Plot Current Bar Index Value
      }

      What would the difference between xStudy.getValue(0); and xStudy.getValue(CCIStudy.CCI); be?

      Thanks,
      Mike

      Comment


      • #4
        Mike
        As I indicated in my previous reply .getValue(CCIStudy.CCI) is used for the CCIStudy() function [see the link in that post] and not with the cci() function which requires instead the use of the syntax shown in the example you refer to
        Alex


        Originally posted by mhufnagel
        Hi Alex,

        Thanks for the response and link. That article doesn't make reference to the value CCIStudy.CCI.

        Let me elaborate on my question. This code is taken from the article you sent.

        var xStudy = null;

        function main() {
        if (xStudy == null) {
        xStudy = cci(20);
        }

        // retrieve single values for conditional statements
        var nValue_0 = xStudy.getValue(0); // Current Bar Index value
        var nValue_1 = xStudy.getValue(-1); // Prior Bar Index value

        return nValue_0; // Plot Current Bar Index Value
        }

        What would the difference between xStudy.getValue(0); and xStudy.getValue(CCIStudy.CCI); be?

        Thanks,
        Mike

        Comment


        • #5
          Alex,

          Sorry - I'm not being clear and thus being redundant.

          New example:

          If I had this code:

          var vCCI = null;

          function main() {
          if (vCCI == null) vCCI = new CCIStudy(14, "Close");

          return vCCI.getValue(CCIStudy.CCI);
          // OR
          // return vCCI.getValue(0);
          }

          What would the difference in those two returns be? Please forgive syntax errors, etc. I typed that on the fly but I think it finally gets to my actual question.

          Comment


          • #6
            Mike
            If you are using the CCIStudy() function you need to use the getValue(CCIStudy.CCI) member to retrieve its values. For values other than the current you would use a bar index eg myStudy.getValue(CCIStudy.CCI,-1) for the previous bar, -2 for two bars back etc.
            Alex


            Originally posted by mhufnagel
            Alex,

            Sorry - I'm not being clear and thus being redundant.

            New example:

            If I had this code:

            var vCCI = null;

            function main() {
            if (vCCI == null) vCCI = new CCIStudy(14, "Close");

            return vCCI.getValue(CCIStudy.CCI);
            // OR
            // return vCCI.getValue(0);
            }

            What would the difference in those two returns be? Please forgive syntax errors, etc. I typed that on the fly but I think it finally gets to my actual question.

            Comment


            • #7
              Hi Alex,

              Thanks. Now I'm starting to understand.

              One follow-up question...

              What exactly does the CCIStudy.CCI do? i.e. what is special about this value?

              Sorry to belabor this point. I just really want to understand what I'm looking at.

              Thanks,
              Mike
              Last edited by mhufnagel; 04-09-2012, 11:29 AM.

              Comment


              • #8
                Mike
                As I said getValue(CCIStudy.CCI) allows you to retrieve the values created by the CCIStudy() function
                The CCIStudy() is one of the functions that were provided in the initial release of EFS included with version 7.0 in 2002 (if I remember correctly)
                In 2005 eSignal released EFS2 with version 7.9 which included a completely new set of functions [amongst which the cci() function] that offered enhanced functionality such as the ability to syncronize across multiple symbols and/or intervals, accept custom variables as the source, etc
                Alex


                Originally posted by mhufnagel
                Hi Alex,

                Thanks. Now I'm starting to understand.

                One follow-up question...

                What exactly does the CCIStudy.CCI do? i.e. what is special about this value?

                Sorry to belabor this point. I just really want to understand what I'm looking at.

                Thanks,
                Mike

                Comment


                • #9
                  Excellent! Thanks Alex.

                  Comment


                  • #10
                    Mike
                    You are welcome
                    Alex


                    Originally posted by mhufnagel
                    Excellent! Thanks Alex.

                    Comment

                    Working...
                    X