1

i would like to build a momentum ranked portfolio and need the top 100 or even top 200 crypto coins in my script. just like here:

https://www.tradingview.com/markets/cryptocurrencies/prices-all/

as they the top 100 is dynamic i would like to put the names in an array and then work with it. i legit cant find a way to to get the top 100 list. i am not a coder, can python just a bit and am coding for 1 month in pine, so excuse my noobish question

thanks buddies!

2 Answers2

0

You can request data from different assets by using the security() function.

For example, below code gets the close price of ETH/USDT and ADA/USDT:

close_eth = security("BINANCE:ETHUSDT", timeframe.period, close)
close_ada = security("BINANCE:ADAUSDT", timeframe.period, close)

However, the number of security calls you can have in your script is limited to 40.

So, you cannot really scan 100 coins with one script. You either need to narrow down your coin list, or add the same script multiple times.

vitruvius
  • 15,740
  • 3
  • 16
  • 26
  • 1
    Thanks for the reply. I am well aware of the function but the top 100 is dynamic and I want the top 100 ordered by market cap in a script on a continuous basis. And then I rank them basesed on their momentum. Would not mind doing only the top 40 but it's changing order and the security function is static. I want a set and forget script – Manuel Hruby Sep 26 '22 at 21:17
  • Is there maybe a function where I can get the top coin data from the exchanges? – Manuel Hruby Sep 26 '22 at 21:18
  • 1
    Oh, I see. No, that's not possible. – vitruvius Sep 27 '22 at 07:49
0

Good question and a feature that would be useful!

I don't have an answer to your question directly but I put together a script earlier where you visually can compare momentum of ETH and BTC against other categories such as DeFi and L1's. And also to see if "Is it all beta, anon" :)

Check it out here: https://www.tradingview.com/script/YGade0Nx-Dusty-Cluster/

Dusty
  • 3
  • 5