ADLine with Norgate NDU

Hi all,

I have just converted from Premium Data to Norgate NDU. I have everything fucntionng as before, except the ADLine.

For the past few years I have calculated the AD Line for the ASX each market day.
I have set Symbol>Categories>ASX - Base Indices = $XAO (it was previously XAO in Premium Data).

I go to Symbol>Composites Recalculation Tool, select the necessary Tick Boxes and Radio Buttons, but when I click 'Calculate' nothing happens.

I have searched this site, the Norgate NDU site and the internet generally, but all valid search results just point out the steps I have already been following for some years and am using now.

I deleted C:\Program Files (x86)\AmiBroker\NorgateData\broker.master, but no change.

Been struggling for a couple of days. Any ideas?

many thanks,

I use Norgate NDU for US Market data, and I see that there are a number of symbols like #SPXAD where the S&P 500 Advance/Decline line is already calculated. Are you sure your database doesn't include something similar for $XAO? In the AmiBroker Symbol Search box, just type in "Advance".

If that doesn't work, I would suggest asking the Norgate support team. They are generally very responsive.

Thanks Matt. Yes, there is #XAOADR Advance/Decline Ratio but no AD Line. I did think of tailoring my strategy using it instead, but I'm hoping it's just a small change I need to make to enable Calculate Composites. With a bit of luck Corey or one of the other excellent NDU support crew will chime in with a suggestion/fix in the next day or so.

Hi Chris,

For ASX Gold subscriptions and above, you should be able to see #XAOAD (S&P/ASX All Ordinaries Cumulative Advance-Decline Line). There are XFL (50), XTO (100), XJO (200), XKO (300) XSO (Small Ords) variants too.

Hi ND,

I use(d) a dual EMA of the ADLine as an initial filter in my strategy. The Cumulative AD Line doesn't seem to have the same functionality (I did have a play around with it).

I'm puzzled why I can't create the ADLine as I did previously. Does the DB structure for NDU preclude use of AB's 'Calculate Composites' tool?

Hi Chris,

Our A/D line is just a simple A/D line - nothing special about the methodology there. I don't know why you can't use EMAs on it.

Regarding calculating composites on a full exchange - I don't think this (in general) is a good idea anyway. You'd be double-counting stocks with multiple classes, including preferred stocks, inverse ETFs, derivatives such as warrants, rights etc. and various other security types that are unrelated to the overall market (such as debt securities). Since delisted securities are in a different "Market" in Amibroker, then you also incorporate survivorship bias. This is part of the reason we created the breadth indicators that track index constituents.

I don't think there's anything in our code that would prevent you from creating your own symbols/composites via Symbol->Composites Recalc.

I've also tried calculating the composites too and it doesn't seem to work for me either. I think Tomasz will have to let us know some more information here.


Thanks Richard.

I can use EMAs on the A/D Line, I just need to determine the periods that suit my strategy best (they "look" more reactive on the screen compared to previously). You're right about double-counting, I just figured the extras would balance each other out. Ideally an A/D line for all fully paid ordinaries (only) would give a pretty good picture of market depth. (I presume the current NDU A/D line is just for the top 500?).

I appreciate you having a crack at calculating the composite.

best wishes,

Yes - #XAOAD is calculated using the All Ordinaries constitutions (aka "top 500", but the actual number of constituents varies due to the methodology about rebalances and timing of replacing delisted stocks/adding new listings).

Of course there's nothing stopping you from creating your own composite securities using AFL and selecting the security type(s) you're interested in using the AddToComposite function, or using Static Vars. You can use our Watchlist Library to create one (or more) Dynamic Watchlists that meet your criteria and use that to generate your own Composites/Static Vars.

Thanks Richard.
Have just created the watchlist (1950 securities - how easy's that!?); about to embark on a AddToComposite voyage of discovery.
Appreciate your input.

@Chris25 you may want to investigate using StaticVarAdd to build your composite.

I think I've posted this code before. For a Watch List this might help,

// Building a composite Advance Decline line reading for a WL
// Using StaticVarAdd run EXPLORE

// pick watchlist in AA window
wlnum = GetOption( "FilterIncludeWatchlist" );
List = CategoryGetSymbols( categoryWatchlist, wlnum );

if( Status( "stocknum" ) == 0 )
    // cleanup variables created in previous runs
    StaticVarRemove( "~Advances*" );
    StaticVarRemove( "~Declines*" );
    StaticVarRemove( "~TotalCount*" );

    for( n = 0; ( Symbol = StrExtract( List, n ) )  != "";  n++ )

        SetForeign( symbol );

        AdvIss = C > Ref( C, -1 );
        DecIss = C < Ref( C, -1 );

        StaticVarAdd( "~Advances", AdvIss );
        StaticVarAdd( "~Declines", DecIss );
        StaticVarAdd( "~TotalCount", 1 );  // I have not yet included Unchanged Issues




svAdvances = StaticVarGet( "~Advances" );
svDeclines = StaticVarGet( "~Declines" );
AdvDecToday = ( svAdvances - svDeclines );
AdvanceDeclineLine = sum( AdvDecToday, barssince( Status( "firstbarinrange" ) ) );

TotalSymbols = StaticVarGet( "~TotalCount" );

// Explore
Filter = Status( "stocknum" ) == 0;
SetOption( "NoDefaultColumns", True );
AddColumn( DateTime(), "Date", formatDateTime );

AddColumn( svAdvances , "Advances", 1.0 );
AddColumn( svDeclines, "Declines", 1.0 );
AddColumn( AdvDecToday, "AdvDecToday", 1.0 );
AddColumn( AdvanceDeclineLine, "Advance Decline Line", 1.0 );
AddColumn( TotalSymbols, "Total Symbols", 1.0, colorDefault, colorLightYellow );

// Chart
Plot( AdvanceDeclineLine, "AdvanceDeclineLine", colorAqua, styleThick );

If you want to run against a "Market" instead of a WL, perhaps change the lines that select the WL in the AA window with something like this,

wlnum = GetOption( "FilterIncludeMarket" ); //FilterIncludeMarket instead of FilterIncludeWatchlist
List = CategoryGetSymbols( categoryMarket, wlnum ); // categoryMarket instead of categoryWatchlist

Hope that helps. Good luck!


Thank you Larry - awesome stuff mate!

Chris, don't forget to include delisted securities too to avoid survivorship bias.

1 Like