Announcement

Collapse
No announcement yet.

EFS for Multiple Symbols

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

  • EFS for Multiple Symbols

    Hi,

    I have heard that I can have up to 7 symbols be externally acessed by an EFS and be alerted on these 7, using the alert to list. I need some help with the code - Are there any examples of this that I could use as a starting point. I don't seem to be able to find any on the forums and the file sharing is almost impossible to find anything specific. Please Help.

    Many thanks

  • #2
    Hello mabtrader,

    To access the price or indicator data for symbols that are external to the chart symbol, you use the sym() function for the source. Any of the Series or Built-in study functions that have the optional ... [, Series | sym() | inv() ] ... or ... [, sym() | inv() ] ... parameter can accept sym(). You would pass the desired symbol to this function as a string.

    For example, to access the close series for IBM, you could do the following.

    PHP Code:

    var xClose null;

    function 
    main() {
        if (
    xClose == nullxClose closesym("IBM") );

        
    // get current bar's close value for IBM close series
        
    var nC_IBM xClose.getValue(0);
        if (
    nC_IBM == null) return; // validate data

        // use nC_IBM variable for conditional statements
        
    if ( /* enter your condition here */ ) {
            
    Alert.addToList("IBM""My Alert Text"Color.blackColor.white);
        }


        return;

    Also, please see the Alert Functions reference material for the alert methods syntax.
    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
      Many thanks Jason.

      It seems to work well for that one external symbol, but
      I have another basic question.
      How do I use more than 1 symbol in my code to get up to maximum of 7 external symbols ?

      Thanks..

      Comment


      • #4
        -

        Hello mabtrader,

        The example I gave you simply shows you how to access data for an external symbol using the sym() function. To incorporate additional symbols you just need to repeat the process using unique variables for the other symbols. Based on your reply, it appears that you are fairly new to programming. To help you get a jump start with EFS for your custom development needs, please visit the resources below my signature.
        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

        Working...
        X