Announcement

Collapse
No announcement yet.

Advance/Decline ratio

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

  • Advance/Decline ratio

    I am looking for a study for the ratio of advances:declines for the NYSE and NASDAQ. As I assumed that this would be a well used formula, I was surprised to discover my site search revealed nothing.

    I would be grateful for any pointers.

    Regards,

    AB

  • #2
    AB
    If you are looking for the simple ratio between the two you can do that directly in an Advanced Chart without an efs. As the symbol use $ADV /$DECL or $ADVQ /$DECLQ
    If you prefer to have the same as a study use the enclosed script
    Alex

    PHP Code:
    function preMain() {
        
    setCursorLabelName("Ratio");
        
    setStudyTitle("Ratio");
        
    //checkVersion(1,);
        
        
    var fp1 = new FunctionParameter("Sym1"FunctionParameter.STRING);
        
    fp1.setName("Symbol1");
        
    fp1.setDefault("$ADV");
        
        var 
    fp2 = new FunctionParameter("Sym2"FunctionParameter.STRING);
        
    fp2.setName("Symbol2");
        
    fp2.setDefault("$DECL");
            
        }

    function 
    main(Sym1Sym2) {
        
        var 
    vSymbol1 close(0,-1,Sym1);
        var 
    vSymbol2 close(0,-1,Sym2);

        var 
    vRatio vSymbol1 vSymbol2;

    return 
    vRatio;


    Comment


    • #3
      Thanx Alexis

      Thanks again Alexis, the formula is spot on

      AB

      Comment

      Working...
      X