Announcement

Collapse
No announcement yet.

getvalue

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

  • getvalue

    In an example efs i noticed the following sentence :

    var vMA1 = study1.getValue(MAstudy.MA).

    Where do i find more info why i have to use ....getvalue

    I noticed the function getvalue in the help section but this does not explain at all why i have to use it with study1 in front of it.

    Where can i find more info on this?

  • #2
    saruses
    The .getValue() method [not to be confused with the getValue() function described in this article in the EFS KnowledgeBase] is used to retrieve a specific value from either a series (created by the efs1 functions) or a series object (created by the efs2 functions).
    In the case of the code example you provided study1 refers to the variable used to store the series created by the MAStudy() function (which is an efs1 function). Following is a complete example
    PHP Code:
    var study1 = new MAStudy100"Close"MAStudy.SIMPLE);//this creates the object
     
    function main(){
        
        var 
    vMA1 study1.getValue(MAstudy.MA).//this retrieves the current value from the object and assigns 
                                                                             //the value to the variable vMA1
        
    var vMA1_1 study1.getValue(MAStudy.MA,-1);//as above but retrieves the value at the prior bar
        //etc 
    In the case of the efs2 studies the syntax is slightly different. Here is an example
    PHP Code:
    var study1 sma(10close());
     
    function 
    main(){
     
        var 
    vMA1 study1.getValue(0);
        var 
    vMA1_1 study1.getValue(-1);
        
    //etc 
    So whenever you have a series or series object and you need to retrieve one of its values you use the name of the series followed by the .getValue() method as shown in the examples above.
    Alex

    Comment


    • #3
      thx, but i am also interested in where i can find these explanations. I did not find this in the manuals that are available.....

      Comment


      • #4
        saruses
        You can find the description of the .getValue() method in this article in the EFS KnowledgeBase
        Alex

        Comment

        Working...
        X