Announcement

Collapse
No announcement yet.

Integrating other symbols

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

  • Integrating other symbols

    Can I pull price data from another symbol and use it as a variable in inside a study or does that study have to be run specifically that symbol?

    Specifically I want to use my EFS script on symbol YM #F and then get the value for $TICK and if its over +1100 generate a short or under -1100 generate a long.

    ----Hey is there a limit to how many questions I can post in a day? hehe

    Thx

    I should probably watch the video tutorial on EFS.

  • #2
    Hello Geoff,

    Yes, you can do this. Any of the EFS functions that has the optional sym() | inv() parameter can be used to specify a symbol external to the chart symbol. You can access up to 7 external charts based on other symbols or intervals. Here's the syntax you would use to reference the data from $TICK.

    close(sym("$TICK"));
    high(sym("$TICK"));
    low(sym("$TICK"));
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      I'm working on this now. Can I use compairsons like this or do I have to make it a variable and then use variable.getValue(0); ?

      if ( close(sym("$TICK")) <= 1100 )
      function1()

      Comment


      • #4
        Geoff
        You can do it either way. Having said that you may find it somewhat more efficient to declare the variable globally, set it intially to null and then intialize it inside main (see example enclosed below).
        Alex

        PHP Code:
        var myVar null;//declare the variable
         
        function main(){
         
            if(
        myVar==nullmyVar close(sym("$tick"));//initialize the variable
            
        if(myVar.getValue(0)==null) return;//null check on value
         
            
        if(myVar.getValue(0) <= 1100){
                
        function1()
            }
            

        Comment

        Working...
        X