Announcement

Collapse
No announcement yet.

Access "Cursor Labels"/Outputs

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

  • Access "Cursor Labels"/Outputs

    Hello

    I try to develpe an custom study. I want to use the third party TRIADES system.

    I test it on non-protectet efs-scripts:

    Code:
    var myStudy = efs("..\\DiNapoli\\MACD.efs"); // no inputs; 2 Outputs
    var myStudy2 = getSeries(myStudy,0); // Output 1: MACD
    var myStudy3 = getSeries(myStudy,1); // Output 2: Signal Line
    this worked perfectly and than i try to gettinformation from the triades system:

    Code:
    var myStudy = efsExternal("..\\Advanced\\Triades\\TriadesPivotsSwings.efs");
    var myStudy2 = getSeries(myStudy,0); // Output 1
    var myStudy3 = getSeries(myStudy,1); // Output 2
    I get no Outputs.

    Is there any possibility to access the "CursorLabel"- Data? Or are there other ways to access data from systems??

    Please help

    marco

  • #2
    Re: Access "Cursor Labels"/Outputs

    marco
    I am assuming that by "CursorLabel"- Data you mean that the efs you are calling is returning some values to the Cursor Window without plotting them which implies that those values are returned as strings.
    If this is the case then you will not be able to use the efsExternal() function as it can only retrieve values [returned by an efs] that are numbers.
    A solution would be to use the call() or callFunction() functions which can also retrieve strings. Keep in mind that these functions do not create a series [like efsExternal()] but return a single value. For the description and syntax of these functions see the links to the corresponding articles in the EFS KnowledgeBase.
    Alex


    Originally posted by trading-pc
    Hello

    I try to develpe an custom study. I want to use the third party TRIADES system.

    I test it on non-protectet efs-scripts:

    Code:
    var myStudy = efs("..\\DiNapoli\\MACD.efs"); // no inputs; 2 Outputs
    var myStudy2 = getSeries(myStudy,0); // Output 1: MACD
    var myStudy3 = getSeries(myStudy,1); // Output 2: Signal Line
    this worked perfectly and than i try to gettinformation from the triades system:

    Code:
    var myStudy = efsExternal("..\\Advanced\\Triades\\TriadesPivotsSwings.efs");
    var myStudy2 = getSeries(myStudy,0); // Output 1
    var myStudy3 = getSeries(myStudy,1); // Output 2
    I get no Outputs.

    Is there any possibility to access the "CursorLabel"- Data? Or are there other ways to access data from systems??

    Please help

    marco

    Comment


    • #3
      thank you!!! that was it what i am looking for!!

      Comment


      • #4
        marco
        You are most welcome.
        Alex


        Originally posted by trading-pc
        thank you!!! that was it what i am looking for!!

        Comment


        • #5
          trying to make a series ...

          Halle Alex,

          i try to get a series out of these "cursor labels" respectively the call() function.

          i want to do it with a doubeld function like this

          PHP Code:
          main(i1) {
              
          myStudy efsInternal ("makinTheOutput",i1);
              var 
          myStudy1 getSeries(myStudy,0);
              var 
          myStudy2 getSeries(myStudy,1);

              
          //now i have an SeriesObject in myStudy1 and myStudy2
          }

          makinTheOutput(i1){
              
          CurLab call("outputLessFunc",i1);
              return new Array (
          CurLab[0], CurLab[1]);

          this works Almost!

          the next outputs are from the attached file.

          the debugprintln within the triades_output-function gives me the following back:

          ...
          BAR -3:
          1: 50
          2: 20
          3: 5.25
          4: 3.37
          5: 6637.0000
          6: 6985.3857
          7: 2.54
          8: 2.64
          9: 1.07
          BAR -4:
          1: 50
          2: 20
          3: -5.43
          4: -5.48
          5: 7021.5000
          6: 6940.2166
          7: 4.38
          8: 0
          9: 0
          ...

          everthing is correct. after i returned the values to the main function and print it out with myStudy1.getValue(0) following "happens" with these variables:

          ...
          BAR -3:
          1: null
          2: null
          3: null
          4: null
          5: null
          6: null
          7: null
          8: null
          9: null
          BAR -4:
          1: null
          2: null
          3: null
          4: null
          5: null
          6: null
          7: null
          8: 0
          9: 0
          ...

          Everthing what ist not "0" gets to "null"!?

          now i think maybe it has problems with the conversion (return of double) so i returned manually the correct values:

          return new Array(50, 20, 5.25, 3.37, 6637.0000, 6985.3857, 2.54, 2.64, 1.07)

          and this works!?

          i am also able to use the series object. when i use getValue(-1) on the 8th and 9th variable i get "0" back on BAR -3.

          but i do not understand why i can't return the real values. must i something convert? "make redy to return" or should i do something completely different to getting a series object out of an call funcion?
          Attached Files

          Comment


          • #6
            Re: trying to make a series ...

            marco
            If the efs you are calling using the call() function is returning a string then the value returned by the call() function will also be a string hence the null output from the efsInternal() call (for the same reason I explained in a prior message regarding efsExternal()). You can easily verify this using the JavaScript typeof operator. If this is the case you need to convert the string to a number (for example by multiplying it by 1) prior to calling it with efsInternal()
            Alex


            Originally posted by trading-pc
            Halle Alex,

            i try to get a series out of these "cursor labels" respectively the call() function.

            i want to do it with a doubeld function like this

            PHP Code:
            main(i1) {
                
            myStudy efsInternal ("makinTheOutput",i1);
                var 
            myStudy1 getSeries(myStudy,0);
                var 
            myStudy2 getSeries(myStudy,1);

                
            //now i have an SeriesObject in myStudy1 and myStudy2
            }

            makinTheOutput(i1){
                
            CurLab call("outputLessFunc",i1);
                return new Array (
            CurLab[0], CurLab[1]);

            this works Almost!

            the next outputs are from the attached file.

            the debugprintln within the triades_output-function gives me the following back:

            ...
            BAR -3:
            1: 50
            2: 20
            3: 5.25
            4: 3.37
            5: 6637.0000
            6: 6985.3857
            7: 2.54
            8: 2.64
            9: 1.07
            BAR -4:
            1: 50
            2: 20
            3: -5.43
            4: -5.48
            5: 7021.5000
            6: 6940.2166
            7: 4.38
            8: 0
            9: 0
            ...

            everthing is correct. after i returned the values to the main function and print it out with myStudy1.getValue(0) following "happens" with these variables:

            ...
            BAR -3:
            1: null
            2: null
            3: null
            4: null
            5: null
            6: null
            7: null
            8: null
            9: null
            BAR -4:
            1: null
            2: null
            3: null
            4: null
            5: null
            6: null
            7: null
            8: 0
            9: 0
            ...

            Everthing what ist not "0" gets to "null"!?

            now i think maybe it has problems with the conversion (return of double) so i returned manually the correct values:

            return new Array(50, 20, 5.25, 3.37, 6637.0000, 6985.3857, 2.54, 2.64, 1.07)

            and this works!?

            i am also able to use the series object. when i use getValue(-1) on the 8th and 9th variable i get "0" back on BAR -3.

            but i do not understand why i can't return the real values. must i something convert? "make redy to return" or should i do something completely different to getting a series object out of an call funcion?

            Comment

            Working...
            X