Display Data in Indicator Window

Hi - I calculate and plot the Cumulative Advance/Decline for the Dow 30 by using the AddToComposite function in an Amibroker indicator. What I would like to do is to display the value of the day's Advances and Declines in the Indicator pane rather than having to go to the symbol list to display the tickers for ~Advances and ~Declines to see what the value is of the day's Advances and Declines.

Is this possible to do - it seems like it must be but I can't figure it out and I would appreciate some pointers.

Thanks Trevor

FYI, Adv Dec data can be created via menu bar's Symbol - Calculate Composites... tool.
9


10

Then in order to display data go to Charts - Indicators and double click
"AD Ratio - Advance Decline Ratio" and/or "ADLine - Advance Decline Line" indicators.

12

11


If for some reason you want to chart your custom data (created by AddToComposite) and if symbols of the list are selected for chart display then use e.g. PlotForeign() function or Foreign() and Plot().

E.g.

PlotForeign( "~Advances", "Advances", colorRed, styleLine);

or e.g.

adv = Foreign("~Advances", "C");
Plot(adv, "Advances", colorRed, styleLine);

or e.g.

adv = Foreign("~Advances", "C");
dec = Foreign("~Declines", "C");
Plot(adv/dec, "Adv/Dec", colorRed, styleLine);

etc.

1 Like

Thanks so much - you have raised a number of alternatives that I will look into.

Beware - there's some serious survivorship bias in this approach.

Would you mind expanding on this Richard?

I thought survivorship bias was a factor when using the constituents of an index without having a mechanism for flagging when a stock is in/out of an index. Wouldn't using "all traded stocks" be the correct way to calculate Advance/Decline?

I know you're busy (esp. at the moment)... whenever you have time to reply.
thanks,
Chris.

@Chris25 you are correct. There is a problem only with symbols that are completely unlisted. Depending on from where you get your database from, you may not have unlisted issues in your database and PAST advance/decline (I mean like 10 years ago) would be inaccurate because it won't include those unlisted stocks. But since you are using this to PLOT charts, so you (apparently) care about recent values, and if that's the case it has virtually zero impact on you.

1 Like

The original poster asked about Dow 30 constituents. There have been 16 changes in the last 10 years (8 additions, 8 removals) so constructing an accurate A/D line would be impossible without index constituent information.

Similarly, with regards to a "market" - stocks don't always remain on one exchange. In the US, stocks can be listed on one of many venues - NYSE, NYSE American, NYSE Arca, Cboe BZX, IEX. They may also lose a major exchange listing and trade on OTC for a while too. Some return from OTC to be relisted. Other stocks go to OTC and eventually die off. Unless you know the exact periods a stock was listed on a particular exchange, your calculations using "today's value of exchange" will be biased and incorrect.

Lastly, there are certain instruments traded on an exchange you probably don't want to include in your A/D calculations. For example, do you really want to include debt securities in your advance/decline data. About 30% of NYSE listings are debt securities and hybrid debt/equities.

There might not be any impact to your trading... or there might be a dramatic impact. Worth testing!

Cheers,
Richard.

3 Likes

Thank you Richard,
your comprehensive reply is very much appreciated.