Announcement

Collapse
No announcement yet.

%A/D breadth indicator

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

  • %A/D breadth indicator

    Looking for an efs formula that would give me:
    ($adv-$decl)/($adv+$decl)*100
    Any help would be appreciated

  • #2
    artfarr
    I think the enclosed does what you asked
    Alex

    PHP Code:
    function preMain() {
        
    setCursorLabelName("AdvDecl");
        
    setStudyTitle("AdvDecl")
        }
            
    function 
    main() {

            
        var 
    vAdv getValue("Close"0, -1"$ADV");
        var 
    vDecl getValue("Close",0,-1,"$DECL");


    return (
    vAdv-vDecl)/(vAdv+vDecl)*100;

    Comment


    • #3
      Hi Alex, thanks for the quick reply. When I copy and paste the formula i get this Syntax error;
      PHP Code:
      function preMain() {
          
      setCursorLabelName("AdvDecl");
          
      setStudyTitle("AdvDecl")
          }
              
      function 
      main() {

              
          var 
      vAdv getValue("Close"0, -1"$ADV");
          var 
      vDecl getValue("Close",0,-1,"$DECL");


      return (
      vAdv-vDecl)/(vAdv+vDecl)*100;

      [/quote]

      Comment


      • #4
        artfarr
        I just copied and loaded the efs and I am not getting any errors (see image).



        What procedure did you follow to load the efs on the chart? If you copied the contents of the efs into a new Formula Editor window what exactly did you copy?
        Anyhow attached you will find the efs. Download it and save to any of the subfolders of the Formulas folder
        Alex
        Attached Files

        Comment


        • #5
          trying again

          sorry , I'll try this again

          Line 16
          unterminated regular expression literal:
          [/php]

          line 1 reference error: php is not defined

          line 17
          unterminated regular expression literal
          [/quote

          Comment


          • #6
            artfarr
            You must copy only what is inside the php box.
            Anyhow in my prior message I also posted the efs ready to be used.
            Alex

            Comment


            • #7
              Take out the PHP line, it isn't part of the formula, but a tag used in this message board.

              Garth
              Garth

              Comment


              • #8
                got it now

                thanks for the download. it's working now.
                I appreciate your help

                Comment

                Working...
                X