Code Monkey home page Code Monkey logo

binance-traderbot's People

Contributors

ignaciop000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

binance-traderbot's Issues

buy/cancel

The bot seems to set a buy order and then immediately cancels it:


TNBBTC : Buy order created id:11264187, quantity:215.00000000, buyPrice:0.00000510, Take profit aprox :0.00000530
Profit loss, called order, 11264187
Buy order fail (Not filled) Cancel order...
TNBBTC : Buy order created id:11264189, quantity:215.00000000, buyPrice:0.00000510, Take profit aprox :0.00000530
Profit loss, called order, 11264189
Buy order fail (Not filled) Cancel order...
TNBBTC : Buy order created id:11264190, quantity:215.00000000, buyPrice:0.00000510, Take profit aprox :0.00000530
Profit loss, called order, 11264190
Buy order fail (Not filled) Cancel order...
TNBBTC : Buy order created id:11264191, quantity:215.00000000, buyPrice:0.00000510, Take profit aprox :0.00000530
Profit loss, called order, 11264191
Buy order fail (Not filled) Cancel order...


It completely ignores the wait_time:
symbol:'TNBBTC',
quantity:0,
stop_loss:0,
mode:'profit',
profit:1.0,
increasing:0.00000001,
decreasing:0.00000001,
loop:0,
wait_time:180.0,
prints: 1,

Profit ?

After one day the bot create multiple orders :
Binance :
capture
Log :

BCNBTC : Buy order created id:6766403, quantity:1279.00000000, buyPrice:0.00000087, Take profit aprox :0.00000087
Profit: %0.00000206. Buy price: 0.00000087 Sell price: 0.00000087

coin.js :

{
    symbol:'BNBBTC',
    quantity:0,
    stop_loss:0,
    mode:'profit',
    profit:1.3,
    increasing:0.00000001,
    decreasing:0.00000001,
    loop:0,
    wait_time:0.7,
    prints: 1,
	//debug: true
},

but don't make profit -> i'm lost 0.0000080

is the profit mode working?

checkbox in webgui

Hello,
what is the check box under "Market" in the web interface for?
it is active per default.
thanks.

Filter failure: PRICE_FILTER

Hello,
I'm using the coins.js file:

const coins = [
{
symbol: 'TRXTUSD',
quantity: 450,
stop_loss: 0,
mode: 'profit',
profit: 0.4,
Increasing: 0.0000001,
decreasing: 0.0000001,
loop: 0,
wait_time: 5
}
]

module.exports = coins;
after the successful buy, the error appears to me in the sell phase:

data: {code: -1013, msg: 'Filter failure: PRICE_FILTER'}}}
Error Message: Filter failure: PRICE_FILTER
Error action Error: Request failed with status code 400

Insufficient balance

Hello, I have a small issue here and hope somebody can help me to figure out what am I doing wrong.
The thing is that I am trying to trade the coin with such settings:

{
symbol:'HOTBTC',
quantity:0,
stop_loss:0,
mode:'profit',
profit:1,
increasing:0.00000001,
decreasing:0.00000001,
loop:0,
wait_time:0.7
}

However, I am getting an error with the insufficient balance:

Error Message: Account has insufficient balance for requested action.
Error action Error: Request failed with status code 400
Buy order filled... Try sell...

Even though, the bot have placed only ONE bid for the coin that totally costs 0.0010998 and I am still having some balance left of the market, it cannot sell it due to the insufficient balance.

What can you possibly recommend me?

Error 400

when i open my browser on http://localhost:3001:

openOrders Exception: Error: Request failed with status code 400
[]

npm test:


> cross-env NODE_ENV=test ./node_modules/.bin/mocha

  Binance REST
    checkKey
      √ Call without param - should return null
      √ Call with wrong params - should throw an exception
      √ Call with good params - should be ok
    checkParams
      √ Call without param - should throw an exception
      √ Call with wrong type param - should throw an exception
      √ Call with good param but an required param is missing - should throw an exception
      √ Call with good param - should be ok
    Constructor
      √ Call without api key - no api and secret key, no default header
      √ Call api key - api and secret key, default header

 signedMethod
      √ Call method without secret key - should throw an exception

 makeQuery
      √ Call method without api key - should throw an exception
      √ Call method without secret key - should throw an exception
      √ Call method without url - should throw an exception
      √ Call method with bad type for data param - should throw an exception
      √ Call method with good param - should be ok

  Binance Websocket
    √ Call without param - should throw an exception
    √ Call without callback - should throw an exception
    √ Call with path and callback - should be ok

  Orders
    get_ticker
      √ get_ticker - should be ok
    get_order_book
      √ get_order_book - should be ok
    get_info
      √ get_info - should be ok

  binanceRequest
    √ Call without param - should be ok
    √ Call with api param - should be ok
    √ Call with api and timeout param - should be ok

  getSignature
    √ Call without param - should throw an exception
    √ Call with bad query format - should throw an exception
    √ Call without key param - should throw an exception
    √ Call with bad key format - should throw an exception
    √ Call with good params - should be ok

  trading
    action
BCNBTC : Buy order created id:5569742, quantity:958.00000000, buyPrice:0.00000105, Take profit aprox :0.00000105
Profit loss, called order, 5569742
Buy order fail (Not filled) Cancel order...
      √ BCNBTC - Real - Cancel Order (211ms)
BCNBTC : Buy order created id:5581947, quantity:967.00000000, buyPrice:0.00000104, Take profit aprox :0.00000104
Buy order filled... Try sell...
Sell order create id: 5581962
      √ BCNBTC - Real - Buy Order and wait (10035ms)

  utils
    checkEnum
      √ Call with wrong enum - should throw an exception
      √ Call with good enum - should return null


  33 passing (10s)

Winows Support?

Hi there, Quick question, does this work on windows?

Thanks

Error action Error: Invalid get_ticker

Hello,
i sometimes get error message "Error action Error: Invalid get_ticker"
is this an error from binance api or from the bot self?
i am using last binance-traderBot code with npm 5.6.0 and nodejs v8.11.2 on an debian 8.10
thx for support

Test Fails

Hi i try npm test and i have an error:

{ Error: Request failed with status code 404 at createAxiosError (/home/dario/binance-traderBot/node_modules/axios-mock-adapter/src/utils.js:147:15) at Object.settle (/home/dario/binance-traderBot/node_modules/axios-mock-adapter/src/utils.js:126:9) at handleRequest (/home/dario/binance-traderBot/node_modules/axios-mock-adapter/src/handle_request.js:67:13) at /home/dario/binance-traderBot/node_modules/axios-mock-adapter/src/index.js:26:9 at new Promise (<anonymous>) at MockAdapter.<anonymous> (/home/dario/binance-traderBot/node_modules/axios-mock-adapter/src/index.js:25:14) at dispatchRequest (/home/dario/binance-traderBot/node_modules/axios/lib/core/dispatchRequest.js:59:10) at <anonymous> isAxiosError: true, config: { transformRequest: { '0': [Function: transformRequest] }, transformResponse: { '0': [Function: transformResponse] }, timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, validateStatus: [Function: validateStatus], headers: { Accept: 'application/json, text/plain, */*', 'X-MBX-APIKEY': 'APIKEY' }, method: 'get', baseURL: 'https://www.binance.com/', params: { symbol: 'ETHBTC' }, url: 'https://www.binance.com/api/v1/ticker/24hr', data: undefined }, response: { status: 404, data: { msg: 'error 404' }, headers: undefined, config: { transformRequest: [Object], transformResponse: [Object], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, validateStatus: [Function: validateStatus], headers: [Object], method: 'get', baseURL: 'https://www.binance.com/', params: [Object], url: 'https://www.binance.com/api/v1/ticker/24hr', data: undefined }, request: { responseUrl: 'https://www.binance.com/api/v1/ticker/24hr' } } } Error Message: error 404

Can't start bot

Hi, im having issues starting the bot. Not sure what i have missed, is there any dependencies i've missed out?

Using a Raspberry Pi 3 model B

This is what i do when i start bot.

pi@Hercules:~/binance-traderBot $ sudo npm start

[email protected] start /home/pi/binance-traderBot
node ./trader

/home/pi/binance-traderBot/trader.js:14
const { BinanceWS } = require('./binanceapi');
^

SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:134:18)
at node.js:962:3

npm ERR! Linux 4.14.69-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.3.2
npm ERR! npm v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node ./trader
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node ./trader'.
npm ERR! This is most likely a problem with the binance-traderBot package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./trader
npm ERR! You can get their info via:
npm ERR! npm owner ls binance-traderBot
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/binance-traderBot/npm-debug.log
pi@Hercules:~/binance-traderBot $

npm-debug.log

Potentially figured out the "stalling" bug.

I ran a few tests with the profit: command.
It seems to handle these types of profit ranges just fine.
profit:0.3
profit:0.9
etc

but when you try to use:
profit:1.0
profit1.2
etc

it will stall at this screen:
Buy Quantity: 1250.00000000
Stop-Loss Amount: 0
Profit Mode Options:
Preferred Profit: 1.20%
Buy Price : (Bid+ --increasing 0.00000001)
Sell Price: (Ask- --decreasing 0.00000001)

it doesn't seem to handle what's supposed to be the 1 percent spot.


Just did another test, and yup, that's the problem.

How to setup mode: range?

I tried getting the bot to run in range mode, but it kept giving me errors:
IS this the correct setup?
{
symbol:'POEBTC',
quantity:0,
stop_loss:0,
mode:'range',
buyprice:0.00000375,
sellprice:0.00000390,
loop:0,
wait_time:0.7,
prints: 1,
},

Error: unexpected server response (504)

`events.js:183
throw er; // Unhandled 'error' event
^

Error: unexpected server response (504)
at ClientRequest._req.on (/home/drekion/Documentos/new/binance-traderBot-master/node_modules/ws/lib/WebSocket.js:653:21)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:551:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:115:23)
at TLSSocket.socketOnData (_http_client.js:440:20)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
`

Can you control 504 error? Thanks

Getting Closer but new issue

The bot does what the other versions of yasinkuyu/binance-trader does, and stalls on this:

Express server listening on port 3001
Started...
Trading Symbol: XVGBTC
Buy Quantity: 205.00000000
Stop-Loss Amount: 0
Profit Mode Options:
Preferred Profit: 1.50%
Buy Price : (Bid+ --increasing 0.00000001)
Sell Price: (Ask- --decreasing 0.00000001)


And then it eventually seems to start working, but then starts to create errors:


XVGBTC : Buy order created id:38833374, quantity:205.00000000, buyPrice:0.00000534, Take profit aprox :0.00000550
Profit loss, called order, 38833374
Buy order fail (Not filled) Cancel order...
XVGBTC : Buy order created id:38833570, quantity:205.00000000, buyPrice:0.00000533, Take profit aprox :0.00000549
get_order Exception: Error: Request failed with status code 400
Profit loss, called order, 38833570
Buy order fail (Not filled) Cancel order...
XVGBTC : Buy order created id:38833579, quantity:205.00000000, buyPrice:0.00000534, Take profit aprox :0.00000550
get_order Exception: Error: Request failed with status code 400
get_order Exception: Error: Request failed with status code 400
(node:8932) UnhandledPromiseRejectionWarning: ReferenceError: None is not defined
at Trading.cancel (C:\binance-traderbot\trading.js:498:31)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:8932) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
(node:8932) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Too many requests

When running the bot for several hours i got this error:

        _header:
         'GET /api/v1/ticker/24hr?symbol=BNBBTC HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nX-MBX-APIKEY: xxx\r\nUser-Agent: axios/0.18.0\r\nHost: www.binance.com\r\nConnection: close\r\n\r\n',
        _onPendingData: [Function: noopPendingOutput],
        agent: [Agent],
        socketPath: undefined,
        timeout: undefined,
        method: 'GET',
        path: '/api/v1/ticker/24hr?symbol=BNBBTC',
        _ended: true,
        res: [IncomingMessage],
        aborted: undefined,
        timeoutCb: null,
        upgradeOrConnect: false,
        parser: null,
        maxHeadersCount: null,
        _redirectable: [Writable],
        [Symbol(isCorked)]: false,
        [Symbol(outHeadersKey)]: [Object] },
     data:
      { code: -1003,
        msg:
         'Way too many requests; IP banned until 1529256050872. Please use the websocket for live updates to avoid bans.' } } }
Error Message: Way too many requests; IP banned until 1529256050872. Please use the websocket for live updates to avoid bans.
Error action Error: Invalid get_ticker

lastest update causes this

Express server listening on port 3001
Started...
Trading Symbol: XVGBTC
Buy Quantity: 206.00000000
Stop-Loss Amount: 0
Profit Mode Options:
Preferred Profit: 1.50%
Buy Price : (Bid+ --increasing 0.00000001)
Sell Price: (Ask- --decreasing 0.00000001)

XVGBTC : Buy order created id:38824233, quantity:206.00000000, buyPrice:0.00000534, Take profit aprox :0.00000550
get_order Exception: Error: Request failed with status code 400
get_order Exception: Error: Request failed with status code 400
(node:2544) UnhandledPromiseRejectionWarning: ReferenceError: None is not defined
at Trading.cancel (C:\binance-traderbot\trading.js:498:31)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:2544) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:2544) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

i try run the "range mode" (HELP)

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]prestart: [email protected]
6 info lifecycle [email protected]
start: [email protected]
7 verbose lifecycle [email protected]start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/user/Desktop/binance-traderBot-master/node_modules/.bin:/home/user/.npm-packages/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle [email protected]start: CWD: /home/user/Desktop/binance-traderBot-master
10 silly lifecycle [email protected]
start: Args: [ '-c', 'node ./trader' ]
11 silly lifecycle [email protected]start: Returned: code: 1 signal: null
12 info lifecycle [email protected]
start: Failed to exec start script
13 verbose stack Error: [email protected] start: node ./trader
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/user/Desktop/binance-traderBot-master
16 verbose Linux 4.13.0-46-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v8.11.3
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: node ./trader
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

issue placing sell order

After successfully buying, I receive an error on the sell order. I have attached the logs. Below is the coin config:
{
symbol:'ETHUSDT',
quantity:0.05,
stop_loss:0,
mode:'profit',
profit:0.10,
increasing:0.00000001,
decreasing:0.00000001,
loop:0,
wait_time:1.0,
debug: true
},
{
symbol:'EOSUSDT',
quantity:2.05,
stop_loss:0,
mode:'profit',
profit:0.10,
increasing:0.00000001,
decreasing:0.00000001,
loop:0,
wait_time:1.0,
debug: true
}

Many thanks !

logs.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.