Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Binance Exchange support #513

Closed
silentrob opened this issue Sep 1, 2017 · 5 comments
Closed

Binance Exchange support #513

silentrob opened this issue Sep 1, 2017 · 5 comments

Comments

@silentrob
Copy link

silentrob commented Sep 1, 2017

They have the lowest fees in the market right now.
https://binance.zendesk.com/hc/en-us/articles/115000429332
Trading: .1%

@cirrusdex
Copy link

agree binance is a great up and coming exchange and pro tip, buy $50 worth of BNB and select use BNB for trading fees, you get a 50% discount

@milaas
Copy link

milaas commented Oct 1, 2017

hi there somebody working on binance support?_

@ramene
Copy link

ramene commented Dec 28, 2017

This was discussed in discord #development channel and confirmed working by atleast one other

docker-compose exec server zenbot backfill binance.XRP-ETH start="20171228110000" end="201712281110000"

docker-compose exec server zenbot trade --paper --days=1 --asset_capital=1000.000000 --currency_capital=0.1000000 binance.XRP-BTC

Error

An error occurred { Error: binance {"code":-1127,"msg":"More than 1 hours between startTime and endTime."}
    at binance.handleErrors (/app/node_modules/ccxt/js/binance.js:751:23)
    at response.text.then.text (/app/node_modules/ccxt/js/base/Exchange.js:433:18)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7) constructor: [Function: ExchangeError] }

Please note the ambiguity between --startTime=, --start= and start= and the error as it currently reads

Fix

Change the getTrades function in: extensions/exchanges/binance/exchange.js to add/subtract 1 hour versus 12

getTrades: function (opts, cb) {
      var func_args = [].slice.call(arguments)

      var args = {};
      if (opts.from) {
        args.startTime = opts.from
      }
      if (opts.to) {
        args.endTime = opts.to
      }
      if (args.startTime && !args.endTime) {
        // add 1 hour instead of 12
        args.endTime = args.startTime + 3600000
      }
      else if (args.endTime && !args.startTime) {
        // subtract only 1 hour instead of 12
        args.startTime = args.endTime - 3600000
      }
      ....

@wilderuncat
Copy link

Just wanted to note that this worked for me.

@DeviaVir
Copy link
Owner

DeviaVir commented Jan 2, 2018

#1027

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants