Announcement

Collapse
No announcement yet.

BandWidth

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

  • BandWidth

    Please, there is one error at line 51.
    Coul someone help me?

    //{{EFSWizard_Description
    //
    // This formula was generated by the Alert Wizard
    //
    //}}EFSWizard_Description 7532


    //{{EFSWizard_Declarations

    var vBollinger20 = new BollingerStudy(20, "Close", 2);
    var vLastAlert = -1;

    //}}EFSWizard_Declarations 9964


    function preMain() {
    /**
    * This function is called only once, before any of the bars are loaded.
    * Place any study or EFS configuration commands here.
    */
    //{{EFSWizard_PreMain
    setPriceStudy(true);
    setStudyTitle("BW#");
    //}}EFSWizard_PreMain 6180

    }

    function main() {
    /**
    * The main() function is called once per bar on all previous bars, once per
    * each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
    * in your preMain(), it is also called on every tick.
    */

    //{{EFSWizard_Expressions
    //{{EFSWizard_Expression_1
    if (
    vBollinger20.getValue(BollingerStudy.UPPER) - vBollinger20.getValue(BollingerStudy.UPPER)>30
    ) onAction1()
    //}}EFSWizard_Expression_1 16692

    //{{EFSWizard_Expression_2
    else if (
    vBollinger20.getValue(BollingerStudy.UPPER) - vBollinger20.getValue(BollingerStudy.LOWER)<30
    //}}EFSWizard_Expression_2 17993

    //}}EFSWizard_Expressions 51962


    //{{EFSWizard_Return
    return null;
    //}}EFSWizard_Return 2256

    }

    function postMain() {
    /**
    * The postMain() function is called only once, when the EFS is no longer used for
    * the current symbol (ie, symbol change, chart closing, or application shutdown).
    */
    }

    //{{EFSWizard_Actions
    //{{EFSWizard_Action_1
    function onAction1() {
    if (vLastAlert != 1) drawTextRelative(0, low(), "B+", Color.RGB(155,0,0), Color.RGB(255,255,255), Text.LEFT, "Arial", 10);
    if (vLastAlert != 1) drawShapeRelative(0, low(), Shape.CIRCLE, "", Color.RGB(192,220,192), Shape.RIGHT);
    vLastAlert = 1;
    }
    //}}EFSWizard_Action_1 34958

    //{{EFSWizard_Action_2
    function onAction2() {
    if (vLastAlert != 2) drawTextRelative(0, high(), "B-", Color.RGB(255,0,0), Color.RGB(255,255,255), Text.LEFT, "Arial", 10);
    if (vLastAlert != 2) drawShapeRelative(0, high(), Shape.SQUARE, "", Color.RGB(255,0,0), Shape.RIGHT);
    vLastAlert = 2;
    }
    //}}EFSWizard_Action_2 35637

    //}}EFSWizard_Actions 90754

  • #2
    Hello Barros,

    You are missing a close parentheses (i.e. ")" ) at the end of line 44.
    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
      There is other problem

      Please JasonK,
      Now, the error is not been showned, but the shperelatives and the textrelatives are not appearing on the charts.
      Could you help me.

      Comment


      • #4
        Hello Barros,

        Add onAction2(); after line 44.
        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
          Another error: missing ..... line 45

          Please JasonK, could you help?

          /{{EFSWizard_Description
          //
          // This formula was generated by the Alert Wizard
          //
          //}}EFSWizard_Description 7532


          //{{EFSWizard_Declarations

          var vBollinger20 = new BollingerStudy(20, "Close", 2);
          var vLastAlert = -1;

          //}}EFSWizard_Declarations 9964


          function preMain() {
          /**
          * This function is called only once, before any of the bars are loaded.
          * Place any study or EFS configuration commands here.
          */
          //{{EFSWizard_PreMain
          setPriceStudy(true);
          setStudyTitle("BW#");
          //}}EFSWizard_PreMain 6180

          }

          function main() {
          /**
          * The main() function is called once per bar on all previous bars, once per
          * each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
          * in your preMain(), it is also called on every tick.
          */

          //{{EFSWizard_Expressions
          //{{EFSWizard_Expression_1
          if (
          vBollinger20.getValue(BollingerStudy.UPPER) - vBollinger20.getValue(BollingerStudy.UPPER)>30
          ) onAction1()
          //}}EFSWizard_Expression_1 16692

          //{{EFSWizard_Expression_2
          else if (
          vBollinger20.getValue(BollingerStudy.UPPER) - vBollinger20.getValue(BollingerStudy.LOWER)<30
          ) on Action2()
          //}}EFSWizard_Expression_2 17993

          //}}EFSWizard_Expressions 51962


          //{{EFSWizard_Return
          return null;
          //}}EFSWizard_Return 2256

          }

          function postMain() {
          /**
          * The postMain() function is called only once, when the EFS is no longer used for
          * the current symbol (ie, symbol change, chart closing, or application shutdown).
          */
          }

          //{{EFSWizard_Actions
          //{{EFSWizard_Action_1
          function onAction1() {
          if (vLastAlert != 1) drawTextRelative(0, low(), "B+", Color.RGB(155,0,0), Color.RGB(255,255,255), Text.LEFT, "Arial", 10);
          if (vLastAlert != 1) drawShapeRelative(0, low(), Shape.CIRCLE, "", Color.RGB(192,220,192), Shape.RIGHT);
          vLastAlert = 1;
          }
          //}}EFSWizard_Action_1 34958

          //{{EFSWizard_Action_2
          function onAction2() {
          if (vLastAlert != 2) drawTextRelative(0, high(), "B-", Color.RGB(255,0,0), Color.RGB(255,255,255), Text.LEFT, "Arial", 10);
          if (vLastAlert != 2) drawShapeRelative(0, high(), Shape.SQUARE, "", Color.RGB(255,0,0), Shape.RIGHT);
          vLastAlert = 2;
          }
          //}}EFSWizard_Action_2 35637

          //}}EFSWizard_Actions 90754

          Comment


          • #6
            Hello Barros,

            After another look at your formula, it looks like the difference of 30 might be too restrictive. I cleaned up your formula a bit and added a formula parameter so you can adjust the value of the BB difference through Edit Studies. FYI, it's no longer a Formula Wizard formula, so you won't be able to modify it in the FW. Try out the version below and see if this works for you.

            Barros_BW#.efs

            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


            • #7
              EFS not appears

              Dear JasonK,
              I downloaded the Barros BW#.EFS, but when I opened it, there was only a blanc page . Nothing written.

              Comment


              • #8
                Hello Barros,

                File Share didn't like the "#" symbol. Duh. Here's a new link with the file renamed. Download and save this to your \eSignal\Formulas folder.


                Barros_BW.efs
                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


                • #9
                  Ok, JasonK, now it is working

                  Let me tell you:
                  The differences are +/-;
                  YM #F = 30
                  ES #F = 3
                  Do you beleive the changes that you made are ok with they?

                  Thank very much for your attention.

                  Comment


                  • #10
                    Better visualize the text and shaperelt.

                    Hi, JasonK,
                    You made a good work, but could you enhance the formula, changing the position of textrelative and shaperelative, to show them better?

                    Comment


                    • #11
                      Hello Barros,

                      Do you need both the text and shape to appear for each signal? Try removing one of the two and see if that will work for you.
                      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


                      • #12
                        Ok JasonK,
                        I can use only one of them. But is there a way to set the shaperelative or the text relative farther from the bars?

                        Comment


                        • #13
                          Hello Barros,

                          Absolutely. For the y-parameter input, add/subtract a fixed value to the high() or low(). Or add a value that is a %value of the high or low. It would look like this,

                          PHP Code:
                          drawTextRelative(0low() - 0.25, .... 
                          or,

                          PHP Code:
                          drawTextRelative(0low() - (0.001*low()),  ... 
                          You may need to change the 0.001 number to suite your needs depending on the symbol and interval of your chart.
                          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


                          • #14
                            Thank you very much

                            Thanks, JasonK,
                            Now it is working very well.

                            Last edited by Barros; 04-01-2004, 10:18 AM.

                            Comment

                            Working...
                            X