diegomanuel / binance-to-google-sheets

Google Spreadsheets add-on to get data directly from Binance API without any intermediaries! :rocket:
GNU General Public License v3.0
427 stars 76 forks source link

"orders/done" and "orders/table" to handle multiple tickers #10

Closed CyberPsyLen closed 3 years ago

CyberPsyLen commented 3 years ago

I want to be able to list every Done Order across all currency pairs in a single table.

For example, To return orders in the pair "NANOETH" I can use: =BINANCER("orders/done", "NANO", "ticker: ETH")

Or, to return orders in the pair "NANOUSDT" I can use: =BINANCER("orders/done", "NANO", "ticker: USDT")

But I want to a single function call to return both.

Describe the solution you'd like I want default ticker of "orders/done" and "orders/table" to include results from all tickers (all pairs).

Additional context Ultimately, I just want to be able to list all my trading history in Sheets via Binance API. I love this tool and I think it should be able to handle this! (possibly I've just misunderstood and there's an easy solution!?) Many thanks for sharing this.

diegomanuel commented 3 years ago

Hey @CyberPsyLen thank you! :bow:

I want default ticker of "orders/done" and "orders/table" to include results from all tickers (all pairs).

It's not possible to default to "all tickers" because I can't do requests to each possible symbol+ticker combination (Binance will ban us and the process of requesting thousands of possible pairs combinations could take forever). I can't know beforehand in which pairs are pending orders to be fetched (Binance doesn't has an API endpoint for it), so I must try everyone of them and that's not viable!

BUT, I've released v0.4.0 and the best solution for your case is:

  1. Update your add-on code in your spreadsheet to v0.4.0.
  2. Add 2 new sheets in your spreadsheet with the "orders/table" operation at A1 in them:
    • =BINANCE("orders/table", "NANO", "USDT") (USDT is the default, but it's never bad to be specific =)
    • =BINANCE("orders/table", "NANO", "ETH")
  3. Change your current "orders/done" operation to just: =BINANCE("orders/done")

It will now display the summary (last 100 rows by default) from both "orders/table" sheets, ordered by date DESC (new ones at the top). You can have multiple sheets being "order tables" for different pair sets and they will all be "merged together" with the new "orders/done" operation! I recommend you to have a read to the readme section for further details: https://github.com/diegomanuel/binance-to-google-sheets#operation-orderstable-private

Hope this newly added functionallity helps you to archieve what you need, good luck and cheers! :beers:

CyberPsyLen commented 3 years ago

Thanks for the reply Diego. I will give it a try.