Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch klines of multiple symbols #14

Open
hemulin opened this issue May 4, 2018 · 8 comments
Open

Fetch klines of multiple symbols #14

hemulin opened this issue May 4, 2018 · 8 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@hemulin
Copy link

hemulin commented May 4, 2018

Hi,
That is really a nice project. Well done.

Is it possible to add functionality of downloading klines for multiple symbols at once?
Either by passing an array of symbols or perhaps some criteria such as top-x symbols by marketcap.

How much do you think Binance servers won't like such requests?

@samuelhei
Copy link
Contributor

Thanks! Good Suggestion.

There is a rate limit of 1200 requests by minute (10000k rows by second), but the app is not requesting in parallel (for now) so it is much slower, so we are fine.

@samuelhei samuelhei added enhancement New feature or request help wanted Extra attention is needed labels May 7, 2018
@samuelhei
Copy link
Contributor

One possible implementation for this is the following:

Turn the --symbol SYMBOL, -s SYMBOL parameter optional and then create another parameter also optional --quantity QUANTITY, -q QUANTITY that gets the total number of coins (default 1) and then get the first QUANTITY symbols on this endpoint https://api.binance.com/api/v1/ticker/24hr

@samuelhei
Copy link
Contributor

This one is also a good issue @santoshyadav198613

Let me know if you are up for it ;)

@anderson89marques
Copy link
Contributor

Hi @samuelhei,
How about we specify what symbols we want instead of quantifying?
So we could use --symbols Symbol1 Symbol2 and the default would be the same.
Another question:
with multiple symbols, we will have multiple files, right?
or we should put all symbols in one single file?
for me, the first option is the right answer.
What do you think about?

@kenorb
Copy link

kenorb commented May 24, 2018

We can separate by a comma. Check the similar script.

parser.add_argument("-p", "--pairs",        action="store",       dest="pairs",     help="Pair(s) to download (separated by comma).", default="all")
...
pairs =  list(all_currencies.keys()) if args.pairs  == "all" else args.pairs.split(',')
...
    for pair in sorted(pairs):

@samuelhei
Copy link
Contributor

samuelhei commented May 24, 2018

with multiple symbols, we will have multiple files, right?

Yes, @anderson89marques different symbols we can save in different files.

We can separate by a comma. Check the similar script.

Good idea @kenorb, I will check out the script

@evanatyourservice
Copy link

I just used bash for now, save below as a .sh file (including the done on the bottom), then run
bash filename.sh
in command line.

#!/bin/bash
CoinList=("BTCUSDT ETHUSDT LTCUSDT BNBUSDT NEOUSDT ETHBTC LTCBTC BNBBTC EOSBTC")
Start="2018/01/01"
End="2018/01/02"
Output="./binance/train/timestamp_symbol_interval"
for coin in $CoinList
do kline-binance --start $Start --end $End $coin 1m
done

@ahmedhassanismail
Copy link

Hello,

at the first it's good utility. thanks for you effort to build.

I need help to add new columns into the csv files output by symbol and interval flag like the below example:

OpenTime,Open,High,Low,Close,Volume,CloseTime,qav,numTrades,tbbav,tbqav,ignore,++symbol,interval

Thank you in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants