Announcement

Collapse
No announcement yet.

Volume Reversal

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

  • Volume Reversal

    Can someone help me with this EFS?
    I get an error Volume not defined.
    THX..
    //{{EFSWizard_Description
    //
    // This formula was generated by the Alert Wizard
    //
    //}}EFSWizard_Description


    //{{EFSWizard_Declarations
    var vLastAlert = -1;
    //}}EFSWizard_Declarations


    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("Volume Reversal");
    //}}EFSWizard_PreMain

    }

    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 (
    Close() <= open() &&
    volume() >= volume(-1)
    ) onAction1()
    //}}EFSWizard_Expression_1

    //{{EFSWizard_Expression_2
    else if (
    close() >= open() &&
    Volume() >= volume(-1)
    ) onAction2();
    //}}EFSWizard_Expression_2

    //}}EFSWizard_Expressions


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

    }

    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() {
    drawTextRelative(0, high(), "Sell", Color.red, null, Text.BOTTOM|Text.CENTER|Text.BOLD, "dungeon", 14);
    vLastAlert = 1;
    }
    //}}EFSWizard_Action_1

    //{{EFSWizard_Action_2
    function onAction2() {
    drawTextRelative(0, low(), "Buy", Color.black, null, Text.TOP|Text.CENTER|Text.BOLD, "dungeon", 14);
    vLastAlert = 2;
    }
    //}}EFSWizard_Action_2

    //}}EFSWizard_Actions




  • #2
    Re: Volume Reversal

    Greg
    The error message I am getting is Close is not defined [and not Volume is not defined]
    If the error message you are seeing is different then perhaps it is generated by another script.
    Anyhow the reason for the error in the script you posted is in the following line of code
    Close() <= open() &&
    which should be
    close() <= open() &&
    Once you make this change the formula should work
    Alex


    Originally posted by gwika
    Can someone help me with this EFS?
    I get an error Volume not defined.
    THX..
    //{{EFSWizard_Description
    //
    // This formula was generated by the Alert Wizard
    //
    //}}EFSWizard_Description


    //{{EFSWizard_Declarations
    var vLastAlert = -1;
    //}}EFSWizard_Declarations


    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("Volume Reversal");
    //}}EFSWizard_PreMain

    }

    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 (
    Close() <= open() &&
    volume() >= volume(-1)
    ) onAction1()
    //}}EFSWizard_Expression_1

    //{{EFSWizard_Expression_2
    else if (
    close() >= open() &&
    Volume() >= volume(-1)
    ) onAction2();
    //}}EFSWizard_Expression_2

    //}}EFSWizard_Expressions


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

    }

    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() {
    drawTextRelative(0, high(), "Sell", Color.red, null, Text.BOTTOM|Text.CENTER|Text.BOLD, "dungeon", 14);
    vLastAlert = 1;
    }
    //}}EFSWizard_Action_1

    //{{EFSWizard_Action_2
    function onAction2() {
    drawTextRelative(0, low(), "Buy", Color.black, null, Text.TOP|Text.CENTER|Text.BOLD, "dungeon", 14);
    vLastAlert = 2;
    }
    //}}EFSWizard_Action_2

    //}}EFSWizard_Actions



    Comment


    • #3
      Volume Reversal

      Alex;
      WOW that response was fast. And your insight fixed my problem. Thanks you.
      Now how do I fix the Formula to not post a bunch of "BUYS" or SELLS" on a chart. I want it to show a BUY then Sell then Buy again.
      Is this possible?
      Thanks again..greg

      Comment


      • #4
        Re: Volume Reversal

        Greg
        To do what you want try placing the drawTextRelative commands in the
        ...while the following will happen only the first time
        instead of in the
        ...then the following will happen everytime
        as it is currently.
        Once you do that you should only see alternating Buy and Sell
        Alex


        Originally posted by gwika
        Alex;
        WOW that response was fast. And your insight fixed my problem. Thanks you.
        Now how do I fix the Formula to not post a bunch of "BUYS" or SELLS" on a chart. I want it to show a BUY then Sell then Buy again.
        Is this possible?
        Thanks again..greg

        Comment


        • #5
          Volume Reversal

          OK Alex, you have now lost me.
          Remember you are dealing with a Newby to EFS formulas.
          Could you give me the line number in the formula that you are saying to change?
          Thanks...

          Comment


          • #6
            Re: Volume Reversal

            Greg
            Use the Formula Wizard [which is what was used in the first place to write the formula] to make this change and not the EFS Editor
            Anyhow in the enclosed screenshot you can see what I indicated to do.
            If - as you indicate - you are still unfamiliar with programming in EFS then you may find it to your benefit to learn to do that as it will enable you to take full advantage of the resources offered by a programmable application such as eSignal. The best way is to start by reviewing the JavaScript for EFS video series and the Core JavaScript Reference Guide. Those will provide you with a thorough introduction to programming in JavaScript which is at the foundation of EFS. Then go through the EFS KnowledgeBase and study the Help Guides and Tutorials which will provide you with the specifics of EFS.
            Alex




            Originally posted by gwika
            OK Alex, you have now lost me.
            Remember you are dealing with a Newby to EFS formulas.
            Could you give me the line number in the formula that you are saying to change?
            Thanks...

            Comment


            • #7
              Volume Reversal

              Alex;
              Got it now!! Works great.
              Thanks for your time and patience. Have a great week, Greg

              Comment


              • #8
                Re: Volume Reversal

                Greg
                You are most welcome
                Alex


                Originally posted by gwika
                Alex;
                Got it now!! Works great.
                Thanks for your time and patience. Have a great week, Greg

                Comment

                Working...
                X