How to import shares data from external source

I got a list of symbols and circulating supply (like shares) from the coinmarketcap API list of cryptocurrencies:

Here´s the updated list after matching the symbols to the yahoo database:

I´m trying to get a market cap filter (shares x daily close) of the top 10 coins in AFL code for backtests.
The txt file is stored locally in c:/data/crypto 100 - shares 4 mcap.txt

Can someone please help?

Hello Nick

Is the file you upload has Shares outstanding or Shares Float?

You can use this to import shares data from external source
for Shares outstanding

# Import SHARES_OUT from a Ascii File  comma separated.   (Shares outstanding)


NOTE: for the new users above code is NOT an afl but is an xxx.format

More info in the manual
Import from ASCII file - AmiBroker
Using Fundamental data - AmiBroker


This article explains all the required steps.
How to create custom import definition for ASCII importer

1 Like

Hi PanoS and thank you very much for your reply.

I´ve tested it but something is not working. I´m getting tickers mixed with the shares outstanding:


Any ideas?

1 Like

yes . that is true as i think your file has a TAB and not comma

i did wrote above << Import SHARES_OUT from a Ascii File comma separated. >>


If you drag and drop your file in EXCEL is automatic made two columns, then save it As csv comma separated.
or just open it with a notepad and replace tab with comma ","

1 Like

Ahh, sorry. Is working now:


Now, how can we add the mentioned mcap filter (to use only the top 10 symbols)?

I´m trying to define it first, but I don´t know how to call the SHARES_OUT variable.


1 Like

Have you read my second link in the first post? :sweat_smile:
Using Fundamental data - AmiBroker

printf( "\n"+Name()+": market Cap \t"+ Close * GetFnData( "SharesOut" ) +"\n\n");

1 Like

Ahh, Perfect..

Knowing these things takes my noob coding to the next level.

Thank you very much. I appreciate it.

I predicted the 6.000 mark. i can see this movement happening, what do you guys think?


Is bouncing from the .618 fib right now. Also bouncing from the trendline. That´s my opinion.

I got one last question about this issue. I´ve only used rankings in explorations.
How to do the rank filter (top 10) properly? Here´s the current mcap variable:

MarketCap = Close * GetFnData( "SharesOut" );

Ops Nick sorry i didnt need to do any rank before, but i think is easy.
also this forum must have examples.
and here

1 Like