Note: for support questions, please join our Discord server
I'm submitting a ...
[x] bug report
[ ] feature request
[ ] question about the decisions made in the repository
Action taken (what you did)
Initiating the bot as a trade bot both on UI and CLI
Expected result (what you hoped would happen)
Start trading based on strategy given
Actual result (unexpected outcome)
Throws error at binance.js
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc)
Hi, I'm trying to start the bot in trading mode. My exchange is Binance and I made all configuration necessary in config.js but it throws the error below
C:\Users\Burak.Erdem\Desktop\gekko-stable\exchanges\binance.js:193
callback(err.message, ticker);
^
TypeError: Cannot read property 'message' of null
at Trader.setTicker (C:\Users\Burak.Erdem\Desktop\gekko-stable\exchanges\bin
ance.js:193:18)
at bound (C:\Users\Burak.Erdem\Desktop\gekko-stable\node_modules\lodash\dist
\lodash.js:729:21)
at Request.request [as _callback] (C:\Users\Burak.Erdem\Desktop\gekko-stable
\node_modules\binance\lib\rest.js:61:21)
at Request.self.callback (C:\Users\Burak.Erdem\Desktop\gekko-stable\node_mod
ules\request\request.js:188:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.<anonymous> (C:\Users\Burak.Erdem\Desktop\gekko-stable\node_modul
es\request\request.js:1171:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage.<anonymous> (C:\Users\Burak.Erdem\Desktop\gekko-stable\no
de_modules\request\request.js:1091:12)
This should've been fixed in #1401
Are you sure you're running the latest version (if not even develop branch)?
Getting the same error, I tried on latest stable and develop branches.
@greenbigfrog I'm running the latest stable version. I haven't tried develop branch though. Going to check it out.
I stumbled upon this post while searching for solutions for the same problem, it seems. I tried using the gekko-develop.zip as well. I've tried different strategies to no avail. Also tried on Windows and Debian. Here is the error:
/home/money/gekko/exchanges/binance.js:193
callback(err.message, ticker);
^
TypeError: Cannot read property 'message' of null
at Trader.setTicker (/home/money/gekko/exchanges/binance.js:193:18)
at bound (/home/money/gekko/node_modules/lodash/dist/lodash.js:729:21)
at Request.request [as _callback] (/home/money/gekko/node_modules/binance/lib/rest.js:61:21)
at Request.self.callback (/home/money/gekko/node_modules/request/request.js:188:22)
at Request.emit (events.js:159:13)
at Request.
at Request.emit (events.js:159:13)
at IncomingMessage.
at Object.onceWrapper (events.js:254:19)
at IncomingMessage.emit (events.js:164:20)
RECEIVED ERROR IN GEKKO 994932244152292
Child process has died.
The error only happens when attempting to use tradebot. I'm offering 0.1 BCH (or whatever equivalent you want) to the guy who can get this fixed quickly! Thanks!
having same error
TypeError: Cannot read property 'message' of null
I am sure @cmroche will be able to fix it. have you tried just setting err.message to err (in the 3 areas)?
I changed err.message to err only. Now I'm getting this error.
`2017-12-16 16:11:21 (DEBUG): [binance.js] entering "setBalance" callback afte
r api call, err: { code: -1021,
msg: 'Timestamp for this request is outside of the recvWindow.' } data: { cod
e: -1021,
msg: 'Timestamp for this request is outside of the recvWindow.' }
2017-12-16 16:11:21 (ERROR): [binance.js] { code: -1021,
msg: 'Timestamp for this request is outside of the recvWindow.' }
C:\Users\Burak.Erdem\Desktop\gekko-stable\exchanges\binance.js:35
if (!error || !error.message.match(recoverableErrors)) {
^
TypeError: Cannot read property 'match' of undefined
at Trader.retry (C:\Users\Burak.Erdem\Desktop\gekko-stable\exchanges\binance
.js:35:32)
at Trader.bound [as retry] (C:\Users\Burak.Erdem\Desktop\gekko-stable\node_m
odules\lodash\dist\lodash.js:729:21)
at Trader.setBalance (C:\Users\Burak.Erdem\Desktop\gekko-stable\exchanges\bi
nance.js:122:19)
at bound (C:\Users\Burak.Erdem\Desktop\gekko-stable\node_modules\lodash\dist
\lodash.js:729:21)
at Request.request [as _callback] (C:\Users\Burak.Erdem\Desktop\gekko-stable
\node_modules\binance\lib\rest.js:52:21)
at Request.self.callback (C:\Users\Burak.Erdem\Desktop\gekko-stable\node_mod
ules\request\request.js:188:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.
es\request\request.js:1171:10)
at emitOne (events.js:116:13)
`
@repentant @leejh970 @ms121 I am aware of this issue, with the parsing of bad results causing a crash and am planning on rewriting the binance API layer to implement all the error/retry handling improvements I've made with the kraken exchange recently. This should make the exchange much more robust against retryable errors.
I anticipate that this will be done by Monday or Tuesday.
@jessrbird As a temporary fix, change line 193 of binance.js from callback(err.message, ticker); to callback(undefined, ticker); the error field is unnecessary in this location, since it should already have been handled.
@cmroche
Thanks for the quick response. I downloaded the latest dev branch (Perhaps changes haven't been integrated yet?) and also changed line 193 in binance.js for good measure. Now i get the same error as @repentant:
/home/money/gekko.bak/exchanges/binance.js:35
if (!error || !error.message.match(recoverableErrors)) {
^
TypeError: Cannot read property 'match' of undefined
at Trader.retry (/home/money/gekko.bak/exchanges/binance.js:35:32)
at Trader.bound [as retry] (/home/money/gekko.bak/node_modules/lodash/dist/lodash.js:729:21)
at Trader.setBalance (/home/money/gekko.bak/exchanges/binance.js:122:19)
at bound (/home/money/gekko.bak/node_modules/lodash/dist/lodash.js:729:21)
at Request.request [as _callback] (/home/money/gekko.bak/node_modules/binance/lib/rest.js:52:21)
at Request.self.callback (/home/money/gekko.bak/node_modules/request/request.js:188:22)
at Request.emit (events.js:159:13)
at Request.
at Request.emit (events.js:159:13)
at IncomingMessage.
RECEIVED ERROR IN GEKKO 002934542141076
Child process has died.
I guess I'll need to wait for the new binance.js to be merged so it can be downloaded? Looking forward to getting started. Thanks!
Thanks @cmroche for changes. Until it would've been committed I checked the whole code and removed any message property. This time I'm getting this error. Don't know if it's related to my settings, my balance or something else.
2017-12-18 12:23:31 (DEBUG): [binance.js] entering "setBalance" callback afte
r api call, err: { code: -1021,
msg: 'Timestamp for this request is outside of the recvWindow.' } data: { cod
e: -1021,
msg: 'Timestamp for this request is outside of the recvWindow.' }
@repentant you can increase the recvWindow and try that, located near the top of binance.js. It's at 1 minute right now though... so I am a bit surprised. This would indicate that requests you are sending are being re-ordered or delays by more than that much time. Let me know if making it larger works for you.
@cmroche I've tried up to 600000 (10 min) but no luck. I also decreased the value down to 10000 to see if I'm getting something else, but still the same error. Then I googled little bit, and from this thread I'm thinking that it has something to do with my timezone. I'm on UTC+3. Could it be the causing issue?
@jessrbird Ok, in that case you will be better off if you grab pull request #1508 which is a re-implementation of the error and retry handling. It checks for bad errors formats (and issue with the binance node module) and handles it better.
This does indicate you were getting an error though, I think there was another change that caused the ticker URL to be different, also updated in the Pull Request. I am able to live trade now without issues.
Good news! Trying it right away and let you know.
Something's still not right. I'm having 404 from an endpoint.
`undefined:1
SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (
at Request.request [as _callback] (C:\Users\Burak.Erdem\Desktop\gekko\gekko\node_modules\binance\lib\rest.js:50:36)
at Request.self.callback (C:\Users\Burak.Erdem\Desktop\gekko\gekko\node_modules\request\request.js:188:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage.
at Object.onceWrapper (events.js:313:30)
`
My request is like this. I'm still suspicious about timezone
{
"url": "https://www.binance.com/api/v1/aggTrades?symbol=NEOBTC&startTime=1513617960000&endTime=1513618198324",
"timeout": 15000
}
@repentant All times are passed as unix time stamps to the API, timezones shouldn't be a factor here. Please enable debug logging and paste the output. Further, I am fully able to use the API without this error right now, so I am not sure why you have a broken end point. Try the following:
Make sure you are using the 'develop' branch
git reset --hard to reset all tracked files
npm i to update modules
Re-integrate the PR and try again please.
@cmroche Sorry for the newb question, but what is the git command for the develop branch? Heretofore I've been downloading the develop.zip file.
This one is for the stable branch, yes? The develop one might look similar?
git clone git://github.com/askmike/gekko.git
You suggested that I grab pull request #1508. I can see the discussion, but not sure how to grab the new js file. Can you help me out? I really appreciate the help. Thanks!
@jessrbird
I see, ok I was assuming that you were using git, downloading is fine but in this case you will have to go to the branch I used in my fork and download that, it's here https://github.com/cmroche/gekko/tree/binance_retry
@cmroche Maybe I'm getting closer. Downloaded the zip at https://github.com/cmroche/gekko/tree/binance_retry and tried to start trading bot. This is the error:
--> POST /api/startGekko 200 12ms 457b
undefined:1
SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (
at Request.request [as _callback] (/home/money/gekko/node_modules/binance/lib/rest.js:50:36)
at Request.self.callback (/home/money/gekko/node_modules/request/request.js:188:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage.
at Object.onceWrapper (events.js:313:30)
RECEIVED ERROR IN GEKKO 40853085547409185
Child process has died.
Let me know what you think. Thanks!
@repentant Were you able to get past the 404 error?
@repentant @jessrbird I just checked the source code on the binance module, you are probably using a version of the module before 1.1.0, from command line run npm install [email protected] will probably fix the issue.
Previous dependency was 1.0.2 which is now incompatible with the refactor. I'll push an update for the packages shortly.
@cmroche It works! Thanks! Send me a crypto address so I can send you a tip.
@jessrbird Thanks! BCH 15nuUCxGTJ4A3ZUdicvLgnw7LBgq629vP8
@cmroche So I started a new trading bot, one that I expected to start trading in only an hour or two. After about 3 hours and no trades, it threw this error:
/home/money/gekko/exchanges/binance.js:295
util.retryCustom(retryForever, _.bind(handler, this), _.bind(check, this));
^
ReferenceError: check is not defined
at Trader.cancelOrder (/home/money/gekko/exchanges/binance.js:295:64)
at Trader.bound [as cancelOrder] (/home/money/gekko/node_modules/lodash/dist/lodash.js:729:21)
at Manager.handleCheckResult (/home/money/gekko/plugins/trader/portfolioManager.js:278:21)
at bound (/home/money/gekko/node_modules/lodash/dist/lodash.js:729:21)
at Trader.check (/home/money/gekko/exchanges/binance.js:269:5)
at bound (/home/money/gekko/node_modules/lodash/dist/lodash.js:729:21)
at /home/money/gekko/core/util.js:28:7
at /home/money/gekko/exchanges/binance.js:66:12
at Request.request [as _callback] (/home/money/gekko/node_modules/binance/lib/rest.js:75:21)
at Request.self.callback (/home/money/gekko/node_modules/request/request.js:188:22)
RECEIVED ERROR IN GEKKO 988233933385293
Child process has died.
I just sent you a little BCH. I surely appreciate your help!
It worked for me too when I updated binance module. But it's now keep analyzing and processing trades but doesn't place any. It's like that for 1 hour I think
2017-12-19 12:31:17 (DEBUG): Processing 10 new trades. From 2017-12-19 09:31:07 UTC to 2017-12-19 09:31:25 UTC. (a few seconds)
2017-12-19 12:31:31 (DEBUG): Requested NEO/BTC trade data from Binance ...
2017-12-19 12:31:33 (DEBUG): Processing 12 new trades. From 2017-12-19 09:31:30 UTC to 2017-12-19 09:31:44 UTC. (a few seconds)
2017-12-19 12:31:51 (DEBUG): Requested NEO/BTC trade data from Binance ...
2017-12-19 12:31:53 (DEBUG): Processing 31 new trades. From 2017-12-19 09:31:50 UTC to 2017-12-19 09:32:06 UTC. (a few seconds)
2017-12-19 12:31:53 (DEBUG): calculated MACD properties for candle:
2017-12-19 12:31:53 (DEBUG): short: 0.00428503
2017-12-19 12:31:53 (DEBUG): long: 0.00427223
2017-12-19 12:31:53 (DEBUG): macd: 0.00001280
2017-12-19 12:31:53 (DEBUG): signal: 0.00001400
2017-12-19 12:31:53 (DEBUG): macdiff: -0.00000121
2017-12-19 12:31:53 (DEBUG): In no trend
2017-12-19 12:32:11 (DEBUG): Requested NEO/BTC trade data from Binance ...
2017-12-19 12:32:13 (DEBUG): Processing 25 new trades. From 2017-12-19 09:32:07 UTC to 2017-12-19 09:32:23 UTC. (a few seconds)
2017-12-19 12:32:31 (DEBUG): Requested NEO/BTC trade data from Binance ...
2017-12-19 12:32:34 (DEBUG): Processing 16 new trades. From 2017-12-19 09:32:26 UTC to 2017-12-19 09:32:37 UTC. (a few seconds)
It made a real trade when I changed strategy from MACD to RSI. Thanks for your efforts @cmroche
Got the same error as @jessrbird
` util.retryCustom(retryForever, _.bind(handler, this), _.bind(check, this));
^
ReferenceError: check is not defined
at Trader.cancelOrder (C:\Users\Burak.Erdem\Desktop\gekko\gekko\exchanges\binance.js:295:64)
at Trader.bound [as cancelOrder] (C:\Users\Burak.Erdem\Desktop\gekko\gekko\node_modules\lodash\dist\lodash.js:729:21)
at Manager.handleCheckResult (C:\Users\Burak.Erdem\Desktop\gekko\gekko\plugins\trader\portfolioManager.js:278:21)
at bound (C:\Users\Burak.Erdem\Desktop\gekko\gekko\node_modules\lodash\dist\lodash.js:729:21)
at Trader.check (C:\Users\Burak.Erdem\Desktop\gekko\gekko\exchanges\binance.js:269:5)
at bound (C:\Users\Burak.Erdem\Desktop\gekko\gekko\node_modules\lodash\dist\lodash.js:729:21)
at C:\Users\Burak.Erdem\Desktop\gekko\gekko\core\util.js:28:7
at C:\Users\Burak.Erdem\Desktop\gekko\gekko\exchanges\binance.js:66:12
at Request.request [as _callback] (C:\Users\Burak.Erdem\Desktop\gekko\gekko\node_modules\binance\lib\rest.js:75:21)
at Request.self.callback (C:\Users\Burak.Erdem\Desktop\gekko\gekko\node_modules\request\request.js:188:22)`
@cmroche @repentant After trying again, I see that it is placing a single trade before crashing. Same error as before. Using UO strategy.
/home/money/gekko/exchanges/binance.js:295
util.retryCustom(retryForever, _.bind(handler, this), _.bind(check, this));
^
ReferenceError: check is not defined
at Trader.cancelOrder (/home/money/gekko/exchanges/binance.js:295:64)
at Trader.bound [as cancelOrder] (/home/money/gekko/node_modules/lodash/dist/lodash.js:729:21)
at Manager.handleCheckResult (/home/money/gekko/plugins/trader/portfolioManager.js:278:21)
at bound (/home/money/gekko/node_modules/lodash/dist/lodash.js:729:21)
at Trader.check (/home/money/gekko/exchanges/binance.js:269:5)
at bound (/home/money/gekko/node_modules/lodash/dist/lodash.js:729:21)
at /home/money/gekko/core/util.js:28:7
at /home/money/gekko/exchanges/binance.js:66:12
at Request.request [as _callback] (/home/money/gekko/node_modules/binance/lib/rest.js:75:21)
at Request.self.callback (/home/money/gekko/node_modules/request/request.js:188:22)
RECEIVED ERROR IN GEKKO 635669244264454
Child process has died.
@jessrbird Have you ever been able to trade using MACD or DEMA?
@repentant Haven't even tried because I haven't found a MACD or DEMA strategy that works well. But my OU strategy looks promising. I admit I've only been trading cryptocurrency for 2 months, and just found the possibility of using trading bots last week. Are you up and running on MACD or DEMA without the process failing?
Looks like a copy and paste error, I'll check it out.
@repentant @jessrbird Copy and paste error confirmed. I pushed a fix now in the pull request. You can also quick fix locally, on line 295 of binance.js change
util.retryCustom(retryForever, _.bind(handler, this), _.bind(check, this));
to
util.retryCustom(retryForever, _.bind(handler, this), _.bind(cancel, this));
@cmroche @repentant Trying now. Should know in 2-3 hours.
The good news is that all other functions have to work to get as far as this error.
Thanks as usual @cmroche . I'm trying it now too. Btw, can you tell me how I can add new pair to trade? I'd like to trade in XRP/BTC and currently it seems that it's not supporting.So I looked into binance.js and found assets and markets arrays in Trader.getCapabilities function. Should it be enough to make it work if I add there?
@repentant Yup, that should do it. I simply have not added all the pairs yet, it's a large number that always changes.
Ok it worked with NEO/BTC pair. No problem on buying, selling and cancelling order. However it doesn't work correctly. It buys on highest bid and sells on lowest whereas it should be the opposite
@cmroche Been up and running for 2 hours, and made multiple buys and sells. Losing money, though, and I feel like it's because the bot is not "flexible" enough when buying and selling. For example, if the mark price of BNB is $5.50 and the order book has some available at 5.52, 5.53, and so on, it won't buy those. It bides it's time and hopes that some become available at $5.50. Then cancels and re-orders at 5.51 and the price can slip even further from there. Is there any way to increase the success of buys and sells (allowing for slippage)? Looking at binance.js, two areas look interesting to me.
Line 223: "type: 'LIMIT', - Could this be changed to 'MARKET'?
Lines 318-477: is precision a variable that could be changed to help buy/sell success with fewer orders, at the cost of slippage?
Perhaps there are other options that can be changed.
Let me know what you think? Great work so far!!
@jessrbird Going with market purchases is probably the best way, but you have to be careful with slippage. The 0.05 modelled in backtesting is probably too conservative, I would increase to as much as 1% if you are going with taker orders. You can go ahead and change that property to 'MARKET' and it will do that.
According to the Binance API document price is a mandatory field, but I suspect this is an error. Their web interface does not require price when doing market orders. You should try removing this field as well if you try MARKET purchases. Please let me know if this works as I will tackle a more robust implementation for these types of changes in the future.
Precision isn't a variable. It is used to do proper lot sizing, varies from one asset to another, but is constant for a given asset.
You could also do markup and markdown percentages on the price, to give a bit of a window for orders.
price += (orderType === 'buy') ? (price * markup_pct) : -(price * markdown_pct);
As a note, there isn't a robust way to configure this in Gekko yet, it always assumes maker orders, so you will have to modify the exchange file directly.
@cmroche Just to clarify:
0.1 is 1%?
0.05 is 1/2%?
@cmroche Also, can you help me with the string you sent:
price += (orderType === 'buy') ? (price * markup_pct) : -(price * markdown_pct);
I assume I put the values where the * are. 0.1 would be 1%? 0.5 would be 1/2%? Or is my decimal in the wrong place?
Also, where would that string go? I'm assuming in binance.js somewhere around line 226?
@jessrbird Divide by 100 to get the correct result. (So 1% is 0.01, 1/2% is 0.005)
line 226
price: price + (tradeType === 'buy') ? (price * markup_pct) : -(price * markdown_pct),
@cmroche I changed line 266 to:
price: price + (tradeType === 'buy') ? (price * 0.035) : -(price * 0.035),
I must have done it wrong, it seems to have caused it to crash on the first trade attempt.
Mine still don't go past ticker. I tried different pairs.
2017-12-20 09:40:29 (DEBUG): [binance.js] entering "getTicker" callback after api call, err: fcuk data: fcak
I replaced the "err" and "data" because it is getting a PNG image in "err" or something.
Any ideas?
Looks something like:
2017-12-20 10:01:10 (ERROR): [binance.js] unable to get ticker "锟絇NG\r\n\u001a\n\u0000\u0000\u0000\rIHDR\u0000\u0000\u0003锟絓u0000\u0000\u0002锟絓b\u0002\u0000\u0000\u0000\u001f锟絢C\u0000\u0000\u0000\u0019tEXtSoftware\u0000Adobe ImageReadyq锟絜<\u0000\u0000\u0003锟絠TXtXML:com.adobe.xmp\u0000\u0000\u0000\u0000\u0000<?xpacket begin=\"\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?> <x:xmpmeta xmlns:x=\"adobe:ns:meta/\" x:xmptk=\"Adobe XMP Core 5.6-c067 79.157747, 2015/03/30-23:40:42 \"> <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"> <rdf:Description rdf:about=\"\" xmlns:xmpMM=\"http://ns.adobe.com/xap/1.0/mm/\" xmlns:stRef=\"http://ns.adobe.com/xap/1.0/sType/ResourceRef#\" xmlns:xmp=\"http://ns.adobe.com/xap/1.0/\" xmpMM:OriginalDocumentID=\"xmp.did:9d5f4a63-cd62-e144-91b8-36a8a016e581\" xmpMM:DocumentID=\"xmp.did:881995665A2C11E7BACF926ABD7BD0C6\" xmpMM:InstanceID=\"xmp.iid:881995655A2C11E7BACF926ABD7BD0C6\" xmp:CreatorTool=\"Adobe Photoshop CC 2015 (Windows)\"> <xmpMM:DerivedFrom stRef:instanceID=\"xmp.iid:00cea75d-2b3c-f44e-9bd5-9002b6315b01\" stRef:documentID=\"adobe:docid:photoshop:8e1bfdf9-58bb-11e7-a450-b9eb10eeb625\"/> </rdf:Description> </rdf:RDF> </x:xmpmeta> <?xpacket end=\"r\"?>锟紿o锟絓u0000\u0001^锟絀D
@tomzuu Get this pull req. #1508 and it will work
@repentant thanks!
@jessrbird Paste the error please? And just for clarity, you made this change on line 226, not 266 right?
I got the latest pull, now i am getting this when i try a live gekko on binance using rsi
RECEIVED ERROR IN GEKKO 6596468503677366
Gekko encountered an error and can't continue
Gekko encountered an error and can't continue
Error:
[binance.js] undefined
Meta debug info:
Gekko version: v0.5.11
Nodejs version: v8.9.3
@wsholcomb87 you also need to grab the latest binance module
npm install [email protected]
@repentant I did that, same error
@cmroche Yes, 226. Sorry for the typo. Here is the error:
2017-12-19 19:35:20 (DEBUG): [binance.js] entering "setBalance" callback after api call, err: null, data: [object Object]
2017-12-19 19:35:20 (INFO): Attempting to BUY 208.023868321104 BNB at binance price: 4.95
2017-12-19 19:35:20 (DEBUG): [binance.js] (addOrder) BUY 208.02 BNB @4.95 USDT
2017-12-19 19:35:21 (ERROR): [binance.js] (addOrder) returned an irrecoverable error: undefined
2017-12-19 19:35:21 (DEBUG): [binance.js] entering "setOrder" callback after api call, err: [binance.js] undefined data: {"code":-1111,"msg":"Precision is over the maximum defined for this asset."}
Increase precision?
pair: ['USDT', 'BNB'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.01,
To .0001?
@jessrbird Oh shoot... right. The line I you changed is bypassing the rounding to set the right lot size. Undo line 226, and instead insert the follow at line 233:
price += (tradeType === 'buy') ? (price * markup_pct) : -(price * markdown_pct);
price = Math.max(this.roundAmount(price, market.precision), market.precision);
Again once you've tested this, please let me know if it solved your liquidity problem.
@cmroche I must have edited wrong. When adding the lines at 233 and after launching Gekko, binance disappears from my list of available exchanges. Here are lines 231-236.
util.retryCustom(retryCritical, _.bind(handler, this), _.bind(setOrder, this));
};
price += (tradeType === 'buy') ? (price * .035) : -(price * .035);
price = Math.max(this.roundAmount(price, market.precision), market.precision);
Trader.prototype.getOrder = function(order, callback) {
I'm assuming I made a syntax error?
@jessrbird it probably should be inside the addOrder function block like this
util.retryCustom(retryCritical, _.bind(handler, this), _.bind(setOrder, this));
price += (tradeType === 'buy') ? (price * .035) : -(price * .035);
price = Math.max(this.roundAmount(price, market.precision), market.precision);
};
@jessrbird @repentant Not sure if you guys would use it but I have added every Currency / Asset Pair (needs some cleaning up A-Z) hence why I haven't placed a pull request;
name: 'Binance',
slug: 'binance',
currencies: ['BTC', 'BNB', 'ETH', 'USDT'],
assets: [
'ADA',
'ADX',
'AMB',
'ARK',
'ARN',
'AST',
'BAT',
'BCC',
'BCD',
'BCPT',
'BNB',
'BNT',
'BQX',
'BTG',
'BTS',
'CDT',
'CMT',
'CND',
'CTR',
'DASH',
'DGD',
'DLT',
'DNT',
'ELF',
'ENG',
'ENJ',
'EOS',
'ETC',
'ETH',
'EVX',
'FUEL',
'FUN',
'GAS',
'GTO',
'GVT',
'GXS',
'HSR',
'ICN',
'ICX',
'IOTA',
'KMD',
'KNC',
'LEND',
'LINK',
'LRC',
'LSK',
'LTC',
'MANA',
'MCO',
'MDA',
'MOD',
'MTH',
'MTL',
'NEO',
'NULS',
'OAX',
'OMG',
'OST',
'POE',
'POWR',
'PPT',
'QSP',
'QTUM',
'RCN',
'RDN',
'REQ',
'SALT',
'SNGLS',
'SNM',
'SNT',
'STORJ',
'STRAT',
'SUB',
'TNB',
'TNT',
'TRX',
'VEN',
'VIB',
'WABI',
'WAVES',
'WTC',
'XLM',
'XMR',
'XRP',
'XVG',
'XZC',
'YOYO',
'ZEC',
'ZRX',
],
markets: [
// https://www.binance.com/exchange/public/product
//Tradeable againt BTC
{
pair: ['BTC', 'ETH'],
minimalOrder: { amount: 0.001, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'LTC'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'BNB'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'NEO'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'GAS'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'BCC'],
minimalOrder: { amount: 0.001, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'MCO'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'WTC'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'QTUM'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'OMG'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'ZRX'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'STRAT'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'SNGLS'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'BQX'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'KNC'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'FUN'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'SNM'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'LINK'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'XVG'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'CTR'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'SALT'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'IOTA'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'MDA'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'MTL'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'SUB'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'EOS'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'SNT'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'ETC'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'MTH'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'ENG'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'DNT'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'BNT'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'AST'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'DASH'],
minimalOrder: { amount: 0.001, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'ICN'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'OAX'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'BTG'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'EVX'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'REQ'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'LRC'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'VIB'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'HSR'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'TRX'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'POWR'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'ARK'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['BTC', 'YOYO'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'XRP'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'MOD'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['BTC', 'ENJ'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'STORJ'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'VEN'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'KMD'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['BTC', 'RCN'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'NULS'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'RDN'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'XMR'],
minimalOrder: { amount: 0.001, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'DLT'],
minimalOrder: { amount: 0.001, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'AMB'],
minimalOrder: { amount: 0.001, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'BAT'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'ZEC'],
minimalOrder: { amount: 0.001, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'BCPT'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'ARN'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'GVT'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['BTC', 'CDT'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'GXS'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['BTC', 'POE'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'QSP'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'BTS'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'XZC'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'LSK'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['BTC', 'TNT'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'FUEL'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'MANA'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'BCD'],
minimalOrder: { amount: 0.001, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'DGD'],
minimalOrder: { amount: 0.001, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'ADX'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'ADA'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'PPT'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['BTC', 'CMT'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'XLM'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'CND'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'LEND'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'WABI'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'TNB'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'WAVES'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['BTC', 'ICX'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['BTC', 'GTO'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'OST'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BTC', 'ELF'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'BNB'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'QTUM'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'SNT'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'BNT'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'EOS'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'OAX'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['ETH', 'DNT'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'MCO'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'ICN'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['ETH', 'WTC'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'OMG'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'ZRX'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'STRAT'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'SNGLS'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'BQX'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['ETH', 'KNC'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['ETH', 'FUN'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'SNM'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'NEO'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'LINK'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'XVG'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'CTR'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['ETH', 'SALT'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'IOTA'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'MDA'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['ETH', 'MTL'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'SUB'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'ETC'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'MTH'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'ENG'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['ETH', 'AST'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['ETH', 'DASH'],
minimalOrder: { amount: 0.001, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['ETH', 'BTG'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'EVX'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['ETH', 'REQ'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'LRC'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'VIB'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'HSR'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'TRX'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'POWR'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'ARK'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'YOYO'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'XRP'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'MOD'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'ENJ'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'STORJ'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['ETH', 'VEN'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'KMD'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'RCN'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'NULS'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'RDN'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['ETH', 'XMR'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['ETH', 'DLT'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'AMB'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'BCC'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['ETH', 'BAT'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'ZEC'],
minimalOrder: { amount: 0.001, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['ETH', 'BCPT'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'ARN'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'GVT'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'CDT'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'GXS'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'POE'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'QSP'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'BTS'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'XZC'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'LSK'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'TNT'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'FUEL'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'MANA'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'BCD'],
minimalOrder: { amount: 0.001, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['ETH', 'DGD'],
minimalOrder: { amount: 0.001, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['ETH', 'ADX'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.0000001,
},
{
pair: ['ETH', 'ADA'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'PPT'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'CMT'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'XLM'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'CND'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'LEND'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'WABI'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'LTC'],
minimalOrder: { amount: 0.001, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['ETH', 'TNB'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'WAVES'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'ICX'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.000001,
},
{
pair: ['ETH', 'GTO'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'OST'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['ETH', 'ELF'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00000001,
},
{
pair: ['BNB', 'VEN'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.0001,
},
{
pair: ['BNB', 'YOYO'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'POWR'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.0001,
},
{
pair: ['BNB', 'NULS'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'RCN'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'RDN'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'DLT'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'WTC'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'AMB'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'BCC'],
minimalOrder: { amount: 0.00001, unit: 'asset' },
precision: 0.01,
},
{
pair: ['BNB', 'BAT'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'BCPT'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'NEO'],
minimalOrder: { amount: 0.001, unit: 'asset' },
precision: 0.001,
},
{
pair: ['BNB', 'QSP'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'BTS'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'XZC'],
minimalOrder: { amount: 0.001, unit: 'asset' },
precision: 0.001,
},
{
pair: ['BNB', 'LSK'],
minimalOrder: { amount: 0.001, unit: 'asset' },
precision: 0.0001,
},
{
pair: ['BNB', 'IOTA'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'ADX'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'CMT'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'XLM'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'CND'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'WABI'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'LTC'],
minimalOrder: { amount: 0.00001, unit: 'asset' },
precision: 0.01,
},
{
pair: ['BNB', 'WAVES'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.0001,
},
{
pair: ['BNB', 'ICX'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'GTO'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['BNB', 'OST'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
{
pair: ['USDT', 'BTC'],
minimalOrder: { amount: 0.000001, unit: 'asset' },
precision: 0.01,
},
{
pair: ['USDT', 'ETH'],
minimalOrder: { amount: 0.00001, unit: 'asset' },
precision: 0.01,
},
{
pair: ['USDT', 'BNB'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.0001,
},
{
pair: ['USDT', 'BCC'],
minimalOrder: { amount: 0.00001, unit: 'asset' },
precision: 0.01,
},
{
pair: ['USDT', 'NEO'],
minimalOrder: { amount: 0.001, unit: 'asset' },
precision: 0.001,
},
{
pair: ['USDT', 'LTC'],
minimalOrder: { amount: 0.00001, unit: 'asset' },
precision: 0.01,
},
@ms121 This removed a huge burden from me. Thanks a lot! Btw, how did you set the precision values. I'm still struggling to understand what the precision values are and whether they affect the backtest results.
@repentant
I have also been playing around with precision I have been using this :https://support.binance.com/hc/en-us/articles/115000594711-Trading-Rule
I have also been playing around with the rounding. I am currently trying the following not sure if it will improve or change anything just testing atm: (has made two successful trades so far so seems to be working)
var P = this.getPrecision(market.precision);
amount = Math.floor(amount / market.minimalOrder.amount) * market.minimalOrder.amount;
price = parseFloat(price).toFixed(P);
fixed
@ms121 Thanks, I added the rest of the market data to the current PR.
@cmroche awesome!
@repentant Thanks for the suggestion. That fixed it.
@ms121 Thanks for all the pairs, it's nice to have all the bases covered.
@cmroche 15 trades in no errors so far! Looking good. (Although there are no buy/sell dots being placed on the UI market Graph with the newest develop branch).
@ms121 are you using a single strategy or a combination multiple strategies? I'd like to have an effective method for short term trading. So far, I tried every preset strat with different thresholds and although some of them looked promising in backtests (even up to %40 profit) , they didn't go well on live trading. How did you manage your strategy?
for your info:
The minimal order amount for OST to BNB is 1 and not 0.01
Please be aware to change near line 1415 from:
{
pair: ['BNB', 'OST'],
minimalOrder: { amount: 0.01, unit: 'asset' },
precision: 0.00001,
},
to
{
pair: ['BNB', 'OST'],
minimalOrder: { amount: 1, unit: 'asset' },
precision: 0.00001,
},
The values for OST to BTC and OST to ETH are correct.
if not changed gekko will return something like this in tradebot.log:
2017-12-29 16:46:17 (INFO): Attempting to SELL 0.81 OST at binance price: 0.03213
2017-12-29 16:46:17 (DEBUG): [binance.js] (addOrder) SELL 0.81 OST @0.03213 BNB
2017-12-29 16:46:18 (ERROR): [binance.js] (addOrder) returned an irrecoverable error: undefined
2017-12-29 16:46:18 (DEBUG): [binance.js] entering "setOrder" callback after api call, err: [binance.js] undefined data: {"code":-1013,"msg":"Filter failure: MIN_NOTIONAL"}
Maybe it would be helpfull if you could chatch this error in some way to prevent gekko from failing.
btw: Good work.. :)
@mboremski PR #1550 will generate the market data from the results of querying the Binance API, which will remove this type of human error in the future.
I'll have a look on this. TY
@cmroche Regarding your post https://github.com/askmike/gekko/issues/1481#issuecomment-353153842
I tested your method. It improves our situation a bit but a more advanced solution would be useful. I do not know JS and the Gekko scheme, but I have an idea, example when I buy:
-first retry price = price * 0.003
-second retry price = price from first retry * .003
-third retry price = price from second retry * .003
etc etc.
This would make it cheaper to arrive at a price that will be filled in a short space of time, at the same time being the lowest possible price.
Price on market type order at Binance is too different than last price. Not worth to try it ourself.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you feel this is very a important issue please reach out the maintainer of this project directly via e-mail: gekko at mvr dot me.
Most helpful comment
@repentant @leejh970 @ms121 I am aware of this issue, with the parsing of bad results causing a crash and am planning on rewriting the binance API layer to implement all the error/retry handling improvements I've made with the kraken exchange recently. This should make the exchange much more robust against retryable errors.
I anticipate that this will be done by Monday or Tuesday.