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:
https://api.coinmarketcap.com/v1/ticker/?convert=USD&limit=100

Here´s the updated list after matching the symbols to the yahoo database:
www.mediafire.com/file/67bzo88rs14dsp2

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)
# https://api.coinmarketcap.com/v1/ticker/?convert=USD&limit=100
# https://api.coinmarketcap.com/v1/ticker/?convert=GBP&limit=100

$NOQUOTES 1
$AUTOADD 1
$OVERWRITE 1
$SEPARATOR ,
$FORMAT TICKER,SHARES_OUT

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

2 Likes

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:

mixed

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. >>

$SEPARATOR ,

Edit:
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:

btc%20shares%20outstanding%20working

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.

define%20mcap

https://www.amibroker.com/guide/afl/getfndata.html

1 Like

hi
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?

BTC010218

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
http://www.amibroker.com/kb/index.php?s=rank

1 Like