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

Binance live trading doesn't work #2358

Closed
francoberton opened this issue Jul 23, 2018 · 7 comments
Closed

Binance live trading doesn't work #2358

francoberton opened this issue Jul 23, 2018 · 7 comments

Comments

@francoberton
Copy link

Note: this is the technical bug tracker, please use other platforms for getting support and starting a (non technical) discussion. See the getting help page for details.

I'm submitting a ...
[x] bug report
[ ] question about the decisions made in the repository

Action taken (what you did)
The function this.getFee(_.noop) inside binance.js doesn't start live trading with binance

Expected result (what you hoped would happen)
Start binance trading

Actual result (unexpected outcome)
Binance trading fails

Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc)

@askmike
Copy link
Owner

askmike commented Jul 24, 2018

That function is not supposed to start live trading.

Is there an error or a reason why you think live trading is not starting?

@askmike
Copy link
Owner

askmike commented Jul 24, 2018

I did now see that this function throws an error when running a paper trader (which is not trading, but simulating). You can get the latest develop version that includes a fix, see here. Let me know if that was the problem you were trying to describe.

@alexandershalin
Copy link

alexandershalin commented Jul 24, 2018

Also have an error at Binance with tradebot. It buys some coins and crashes with the following error:

Jul 24 08:05:21 ip-172-31-31-32 gekko[9465]:   --> POST /api/getCandles 200 274ms 3.45kb
Jul 24 08:15:19 ip-172-31-31-32 gekko[9465]: RECEIVED ERROR IN GEKKO INSTANCE 2018-07-24-06-53-tradebot-59108201058719
Jul 24 08:15:19 ip-172-31-31-32 gekko[9465]: { __augmented: true }
Jul 24 08:18:26 ip-172-31-31-32 gekko[9465]:   <-- POST /api/getCandles
Jul 24 08:18:26 ip-172-31-31-32 gekko[9465]:   --> POST /api/getCandles 200 275ms 3.86kb

I'm running 0.6.3 UI

@alexandershalin
Copy link

Switched to develop version, error is different now:

Jul 24 09:17:00 ip-172-31-31-32 gekko[11935]: 2018-07-24 09:17 Gekko 2018-07-24-09-17-watcher-512706268282978 started.
Jul 24 09:17:00 ip-172-31-31-32 gekko[11935]:   --> POST /api/startGekko 200 17ms 1.23kb
Jul 24 09:17:01 ip-172-31-31-32 gekko[11935]:   <-- POST /api/startGekko
Jul 24 09:17:01 ip-172-31-31-32 gekko[11935]: 2018-07-24 09:17 Gekko 2018-07-24-09-17-papertrader-3099666194555426 started.
Jul 24 09:17:01 ip-172-31-31-32 gekko[11935]:   --> POST /api/startGekko 200 6ms 1.82kb
Jul 24 09:17:01 ip-172-31-31-32 gekko[11935]: RECEIVED ERROR IN GEKKO INSTANCE 2018-07-24-09-17-papertrader-3099666194555426
Jul 24 09:17:01 ip-172-31-31-32 gekko[11935]: { code: 'MODULE_NOT_FOUND' }

@askmike
Copy link
Owner

askmike commented Jul 24, 2018

@alexandershalin that second error appears to be related to missing dependencies, please run npm install again.

As to your initial issue, for me binance trading works fine:

2018-07-24 18:18:11 (INFO):     Trader Received advice to go short. Selling  BTC
2018-07-24 18:18:11 (DEBUG):    Creating order to sell 0.0134152445 BTC
2018-07-24 18:18:18 (DEBUG):    [ORDER] statusChange: SUBMITTED
2018-07-24 18:18:18 (DEBUG):    [ORDER] statusChange: OPEN
2018-07-24 18:18:20 (DEBUG):    [ORDER] statusChange: FILLED
2018-07-24 18:18:20 (INFO):     [ORDER] summary: { price: 8182.011043607901,
  amount: 0.013415000000000002,
  date: moment("2018-07-24T18:18:19.058"),
  side: 'sell',
  orders: 1,
  fees: { USDT: 0.10976168 },
  feePercent: 0.1 }
2018-07-24 18:18:20 (DEBUG):    syncing private data
2018-07-24 18:18:31 (DEBUG):    Requested BTC/USDT trade data from Binance ...
2018-07-24 18:18:32 (DEBUG):    Processing 29 new trades. From 2018-07-24 16:18:11 UTC to 2018-07-24 16:18:31 UTC. (a few seconds)
2018-07-24 18:18:51 (DEBUG):    Requested BTC/USDT trade data from Binance ...
2018-07-24 18:18:51 (DEBUG):    Processing 25 new trades. From 2018-07-24 16:18:33 UTC to 2018-07-24 16:18:50 UTC. (a few seconds)
2018-07-24 18:19:11 (DEBUG):    Requested BTC/USDT trade data from Binance ...
2018-07-24 18:19:12 (DEBUG):    Processing 35 new trades. From 2018-07-24 16:18:52 UTC to 2018-07-24 16:19:10 UTC. (a few seconds)
2018-07-24 18:19:12 (DEBUG):    TRADE RECEIVED BY processTrade: { id: 'trade-3',
  adviceId: 'advice-3',
  action: 'sell',
  cost: 0.10976167815,
  amount: 0.013415000000000002,
  price: 8182.011043607901,
  portfolio: { currency: 115.44740416, asset: 0.00070631 },
  balance: 121.3440952567,
  date: moment("2018-07-24T18:18:19.058"),
  feePercent: 0.1,
  effectivePrice: 8173.829032564293 }
2018-07-24 18:19:12 (INFO):     (PROFIT REPORT) original balance:        121.93808962 USDT  
2018-07-24 18:19:12 (INFO):     (PROFIT REPORT) current balance:         121.34409526 USDT  
2018-07-24 18:19:12 (INFO):     (PROFIT REPORT) profit:          -0.59399437 USDT (-0.48712783%)
2018-07-24 18:19:12 (INFO):     (ROUNDTRIP) entry date (UTC)    exit date (UTC)         exposed duration        P&L     profit
2018-07-24 18:19:12 (INFO):     (ROUNDTRIP) 2018-07-24 16:06    2018-07-24 16:18        12 minutes              -0.30   -0.25

I'll let this trader running for a few hours...

@alexandershalin please open a new issue (and include logs found in the logs folder) as I am not sure what problem @francoberton is having, but I doubt it's exactly the same.

@francoberton please explain what the exact issue is!

@francoberton
Copy link
Author

Now, the issue is fixed with the latest develop version.
Thanks

@askmike
Copy link
Owner

askmike commented Jul 25, 2018

👍

askmike added a commit that referenced this issue Aug 10, 2018
* [docs] install indicator libs without updating package.json

* add tulip example strat configs, see #2341

* uppercase default macd strat

* temp revert bfx dep to main repo (fixes importer)

* binance set default fee as percentage

* rename bitx to luno (#2352)

* v0.6 support for bitx (aka Luno)

* v0.6 support for bitx (aka Luno)

* remove log

* move dependency to gb

* rename bitx to luno

* rename bitx to luno

* make sure we pass amount as positive value

* make sure we overlap when importing trades

* rm 500 as retryable error, see #2354

* only try to set fee when live trading, see #2358

* make gekko pic path relative

* make select arrow path relative

* Fix method name for stratNotification event

* make sure we parse both TS (backtest) & moment strings (live)

* make sure GB throws errors

* only render warmup warning when there is required history

* v0.6.4

* fix plugin event wire warning

* check portfolio data before calculating report (#2369)

* Changed several log messages from debug to warn (#2374)

Changed "Not creating order" message and "exchange did not provide fee info" from debug to warn messages so users can see these issues even when debug is set to false.

* make sure we pass on exchange error (#2379)

* fix backtest result exporter in standalone mode (#2382)

* make sure to pass order id in cancel edge flow, fix #2386 (#2387)

* Emit trade and trade errors via Telegram (#2385)

* Emit trade and trade errors via Telegram

* Added semi-colons

Added missing semi-colons in processTradeCompleted and processTradeErrored methods.

* Register methods only if set to true in config

* catch undefined CPU cores on ARM (#2391)

* export portfolio values as part of stratCandles (#2402)

* rm space in backtest export file location

* [GB/Binance] retry on 403 (#2404)

* completely disable broken limit order for now, fix #2398

* rewire cancelfix cb, see #2386

* remove slack dependency that is triggering warnings (#2408)

* move slack plugin dep out of main repo

* remove twitter & pushbullet plugin dependencies from main repo (#2409)

* move slack dependency out of main repo

* rm slack dep from main repo

* also remove pushbullet & twitter deps from main repo

* use forked bittrex dep with updated dependencies (#2410)

* use bittrex fork with updated deps

* [GB] introduce optimizedConnection flag in binance

* [GB] catch strange networking error

* update binance market files, see #2406

* [GB] point to supported_exchanges doc

* [GB] add example usage, fix #2414

* assume CF maintainance to be recoverable, fix #2407

* use npm version of of forked bittrex dep

* catch gb init errors

* [sqlite] wait for 10 seconds on busy

* throw errors, not strings

* [GB] update bfx & cf markets

* Update Luno (#2417)

* v0.6 support for bitx (aka Luno)

* v0.6 support for bitx (aka Luno)

* remove log

* move dependency to gb

* rename bitx to luno

* rename bitx to luno

* temp fix simultaneous advice error

* - re-add logging
- Retry insufficient balance due to server update delay
- Enhanced getPorfolio
- getOrder now return fees

* update

* update

* update

* revert 4b5d09f

* v.0.6.5
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

3 participants