Announcement

Collapse
No announcement yet.

Intraday Advance/Decline Line?

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

  • Intraday Advance/Decline Line?

    Hi guys,

    Is there a way to chart an intra-day advance decline line and put/ call ratio? I'd like to bring these up on an advanced chart if possible.

    Thanks,
    -pk

  • #2
    Re: Reply to post 'Intraday Advance/Decline Line?'

    pk
    For the Advance-Decline you may want to try the symbol $ADD.
    I don't believe there is a symbol for Put/Call Ratio.
    Alex

    Comment


    • #3
      Not quite the same

      Alexis,

      I know this is an old thread but an indicator constructed from this symbol ($ADD) won't quite do. I think the issue is one of needing a cummulative reading of this data in order to contruct a line that is useful.

      For a clearer explanation see Martin Pring. There is a good chapter on breadth that shows the difference between $ADD and an A/D line. Also Stockcharts.com has a good example as well of what it should look like (less like an oscialltor, more like a price line).

      This is a really basic indicator. Surprised not to see it in the arsenal. Ideally a weekly A/D line properly constructed can indicate important divergences with Price. That is it can signal major tops and bottoms in the indices.

      Comment


      • #4
        deepfoo
        FYI my suggestion to look at $ADD was in response to the request from the original poster for an intraday Adv/Decl symbol.
        Alex
        Last edited by ACM; 03-29-2003, 11:04 AM.

        Comment


        • #5
          If I remember correctly the A/D line is nothing more than the simple moving average (forget how many period) of advancers/decliners. It should be really easy to write an EFS that does that.

          G
          Garth

          Comment


          • #6
            Re: Intraday Advance/Decline Line?

            Is this what you need for A/D?? I run this and one for the inverse (D/A) stacked on top of it. I should combine them into one EFS with a two element array, but have not gotten to it.

            If there are supported symbols for the options statistics, a similar EFS should work.

            Originally posted by pkwood
            Hi guys,

            Is there a way to chart an intra-day advance decline line and put/ call ratio? I'd like to bring these up on an advanced chart if possible.

            Thanks,
            -pk
            Attached Files

            Comment


            • #7
              Cumulative A/D construction vs. ratio

              Thanks all,

              I believe that the solution is pretty simple and maybe the confusion here is between cumulative and ratio based a/d lines.

              ratio is dead simple, it really is adv/decl issues and is certainly a valuable indicator.

              cumulative is just that though, a cumulative running total (over n periods, usually 10 or 21 day, but could be any period) of $add (for NYSE) with the current day value added to the result.

              to build it one would do something like get the running cumulative total of $add over n periods prior to current close -- close(n,1,"$add") -- where n is iterated for whatever number of days chosen and then add the current day closing value to it.

              here is a link showing what the line is going to look like when plotted.

              http://www.crbindex.com/techtip/tipv5n03a.gif


              the indicator is generally used over periods of days, not intraday to get a sense of the longer term trend and help identify confirmations/ divergences in price/breadth. make sense?

              i'm afraid i'm just hopelessly bad with efs as Alexis can attest to and i'm sure this is not a big deal to do. just beyond my feeble abilities.

              Comment


              • #8
                Big "oops" here

                SORRY FOLKS,

                Messed up this explanation a bit. Here is the critical difference in how this indicator gets constructed.

                It requres picking a number at the beginning of the sequnce you are plotting and then keeping a running total from that time forward.

                So if you wanted to plot back several years, I guess you'd need to pick zero as the level before you start the plot and then keep the total running from that point on. I guess in theory if you had access to all the data for all the days you wanted to plot you could fetch them and plot them that way. Hmmm.

                I ran across this explanation in one of Mamis' books. There are serveral indicators like this that require selection of an arbitrary value and then maintaining the total from that point forward.

                So I guess this becomes a data maintenance issue doesn't it? Probably explains why few services offer it beyond several months.

                Here is a link at Stockcharts which shows this clearly (zero is start on left of chart).

                http://stockcharts.com/gallery?$NYAD

                Comment


                • #9
                  A possible Solution

                  Folks,

                  OK, I tried this out and certainly the shape of the line looks correct compared to that earlier example I gave at Stockcharts.com.

                  However it seems to only work on the daily chart and shorter intervals. It does not produced a viable result on a weekly basis.


                  I assume this is because one would have walk through to create a sum for a given week period and then add that result to a prior week value.


                  Can some kind soul out there have a look at this code bit? I can't think of another way to do it though I am sure there must be a better way.

                  -------------------------


                  function preMain() {
                  setStudyTitle("NYSE A/D Line");
                  setPriceStudy(false);
                  setGlobalValue("cumulativeValue",0);
                  setDefaultBarThickness(1);
                  }

                  function main() {

                  var nSymbol = "$ADD";
                  varTime = getInterval();
                  var vSym = nSymbol + "," + varTime;
                  var v = close(0, vSym);
                  myOldVar = getGlobalValue("cumulativeValue");
                  myNextVar = v;

                  var myReturnValue = (myOldVar+myNextVar);
                  setGlobalValue("cumulativeValue",myReturnValue);

                  return (myReturnValue);


                  }

                  Comment


                  • #10
                    deepfoo

                    The formula works fine, but like you say it does not produce viable results on weekly charts.
                    The weekly close in fact represents just the close of $ADD on Friday and not the cumulative sum of the week as illustrated by the side by side images below.



                    The weekly bar does, however, correctly reflect the high and low values for the week.
                    A quick and dirty workaround could be to calculate the high-low of the weekly bar instead of using the close.
                    Just an idea

                    Alex

                    Comment


                    • #11
                      Possible Solution

                      I guess one other work around, since capturing each sum of the day is important, would be to do some MOD operation if the interval is weekly and build the variable as a result of the sum of each of those MOD 5 operations. Make sense?

                      Kind of a pain, but likely necessary. I can see why people build the weekly charts by hand.

                      Also, totally different problem. It was mentioned earlier that MA construction of $ADD to use as a non-price study would be simple to do.

                      How would this be done? A bit of a mystery to me on how to build this. Would be very handy for folks to have as it is also another excellent confirmation/divergence indicator for anyone trading the major indices (SPX and INDU anyway).

                      Typically this is done on a tern period basis.

                      Comment


                      • #12
                        10 Period NYSE $ADD MA

                        I may set a record for posting and responding to my own questions. I cribbed the code in here from Garth Doverspike's MA.efs

                        Did I do this properly? One issue is the param for input does not for some reason show up in properties under "edit studies". I assume I messed up somewhere. Thanks in advance.

                        ---------------

                        function preMain() {
                        setStudyTitle("NYSE $ADD MA");
                        setPriceStudy(false);
                        setDefaultBarThickness(1);
                        }



                        function main(nInputLength) {
                        if(nInputLength == null)
                        nInputLength = 10;

                        var nLength = nInputLength;
                        var i;
                        var vSum = 0.0;
                        var nSymbol = "$ADD";
                        varTime = getInterval();
                        var vSym = nSymbol + "," + varTime;
                        var vValue= close(0,-nInputLength, vSym);


                        if(vValue == null) {
                        return;
                        }

                        for(i = 0; i < nLength; i++) {
                        vSum += vValue[i];
                        }

                        return (vSum / nLength);

                        }

                        Comment


                        • #13
                          deepfoo
                          If the parameter you are referring to is nInputLength it is showing up in Edit Studies and passing on the value to the formula.
                          If it is not showing up at your end AND you added the option of the variable after you had loaded the efs in the chart then you need to Remove the efs first and then load it again. A simple Reload will not change what appears in Edit Studies.
                          Alex

                          Comment


                          • #14
                            Hi Deepfoo,

                            While the code is technically correct, for good coding practice you should keep the variable names consistent between the getValue statement and the loop for suming of the data points.

                            ie:
                            var vValue= close(0,-nInputLength, vSym);
                            and
                            for(i = 0; i < nLength; i++) {

                            should both use nInputLength...and you can get rid of nLength from the efs.

                            If you cribbed from me and I had it that way...well then bad me.
                            Garth

                            Comment


                            • #15
                              A-Ha!

                              Well, thanks Garth. Hmmm, actually I was very tired when I did this last night. You can rest easy, it was Matt Gundersen's MA.efs in the TSS Support Area.

                              By the way changing this to eliminate the additional variable fixed the input problem described below.

                              Thanks to both you and Alexis.

                              Comment

                              Working...
                              X