Announcement

Collapse
No announcement yet.

Variable Symbol

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

  • Variable Symbol

    Good Afternoon,

    The following code is used to specify the symbol and time frame
    when using numerous timeframes within a single EFS.

    Symbol1 = "YM H7";
    Interval1 = "1";
    }

    function main() {

    if(getBarStateInterval("1")==BARSTATE_NEWBAR){

    var vSymbol1 = Symbol1+","+Interval1;
    xMA1 = offsetSeries(eval(sma)(3,eval(low)(sym(vSymbol1))) ,0);

    When the contract changes, this requires going into each EFS to change the symbol. Is there a way to make the EFS read the chart symbol and assign the symbol to the variable "Symbol1"? If not, is there a way to change the "xMA1" formula to read the chart sysmbol? If not, can I specify the sysmbol as a global variable and read it into the EFS? I have passed numbers before but how would you write out and read in a word?

    Best Regards,

    Alan

  • #2
    Hello Alan,

    You can retrieve the chart symbol with getSymbol().

    Symbol1 = getSymbol();
    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
      Thank you Jason. It works great !

      Best Regards,

      Alan

      Comment


      • #4
        You're most welcome.
        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


        • #5
          Re: Variable Symbol

          Originally posted by Alan2004
          Good Afternoon,

          The following code is used to specify the symbol and time frame
          when using numerous timeframes within a single EFS.

          Symbol1 = "YM H7";
          Interval1 = "1";
          }

          function main() {

          if(getBarStateInterval("1")==BARSTATE_NEWBAR){

          var vSymbol1 = Symbol1+","+Interval1;
          xMA1 = offsetSeries(eval(sma)(3,eval(low)(sym(vSymbol1))) ,0);

          When the contract changes, this requires going into each EFS to change the symbol. Is there a way to make the EFS read the chart symbol and assign the symbol to the variable "Symbol1"? If not, is there a way to change the "xMA1" formula to read the chart sysmbol? If not, can I specify the sysmbol as a global variable and read it into the EFS? I have passed numbers before but how would you write out and read in a word?

          Best Regards,

          Alan
          Did u found any solution to change the chart Symbol ?
          If so can u post it, please

          Comment


          • #6
            amir
            I believe Jason already provided a solution in his reply (see enclosed quote)
            Alex

            Originally posted by JasonK
            Hello Alan,

            You can retrieve the chart symbol with getSymbol().

            Symbol1 = getSymbol();

            Comment


            • #7
              Hi Alex & Jason,

              In my EFS I use the following:

              PHP Code:
              Symbol getSymbol();
                      
              Interval 1;
                      var 
              vSymbol Symbol+","+Interval 
              Instead, I would like to be able control the Symbol and Interval from the Study Properties window under Right clicking Edit Studies.

              Is there a simple soultion to have the Symbol = look for a Symbol in Studies Properties under the Formula Parametes section?

              I've be all over the Knowledge Base but I have come up with a simple soultion.

              Thank you very much!

              Best,
              Dave

              Comment


              • #8
                Dave
                All the studies included in the EFS2 Custom folder of Formulas are set up to allow changing the symbol and/or interval through Edit Studies. You can use any one of those as an example
                Alex

                Comment

                Working...
                X