-
Notifications
You must be signed in to change notification settings - Fork 4k
Conversation
Finally 👍 I've been looking for a bot that can use ccxt for so long |
Well this worked fine for me :) Just having some issues replicating the fork on my VPS. Something with deasync but it works fine locally. |
@Yoyae this looks really interesting |
@Filoz Follow Gekko docs. I just added ccxt exchanges as if it is an additionnal exchange. Configuration and uses isn't changing from another (non ccxt) exchange. |
@Yoyae This is awesome! One thing I am noticing Specifically for Binance is constantly throwing the "Insufficient funds" error. This seems to be because of the Rounding of assets and currencies. I am not sure about the best way to go about fixing it though I understand within ccxt's exchange.js you can calculate the lot size and price precision using the following;
I would implement it but unfortunately I have the JS skills of a 5 year old. |
@mattS00 The issue with Binance rounding should be fixed in the binance implementation not don through CCXT. Just to confirm, your issue is with using Binance through CCXT and not using Binance directly, is that correct? |
@mattS00 I've add rounding on amount before sending the order (buying or selling), if the precision exists. I don't have time to test this change. There shouldn't be any problem but be carefull as it hasn't been tested out yet. |
@Yoyae When I started the bot in gave me an error after updating: |
@mattS00 I fixed the coding issue but that doesn't solve "Insufficient funds" error. From my understanding, there is a price or amount issue. Here's an example : 2017-12-11 16:22:21 (INFO): USDT: 42.977811000000 2017-12-11 16:22:21 (INFO): Trader Received advice to go long. Buying BTC The issue came from BUY 0.0026577023493850735 BTC x price: 16188.92 = 43.0253307 USDT (too much). So either the price or the amount is not calculate/fetch in the correct way. |
@Yoyae My understanding it we also have to set the PriceToPrecision playing around with it, seems to work if I place parseFloat (price).toFixed (4); for ADX for example.
|
@Yoyae I have been playing around with it and the following seems to fix the insufficient fund issues Obviously we need to do the same for buy.
|
@mattS00 Thanks for your testing. I've made the change and it works well (on binance at least. I didn't try it on other exchanges). |
@Yoyae@mattS00 Please con you share the tested working code, I can try it here. Thanks. |
@Shootle I usually use a test strategy like this //====================================================================
// Initialization
//====================================================================
// Prepare everything our method needs
strat.init = function() {
log.debug("init");
this.test = 0;
}
//====================================================================
// Handle Routine
//====================================================================
strat.update = function(candle) {
if(this.test == 0){
this.advice('long');
this.test = 1;
}
} It buy one time the selected pair. (just long by short to sell). |
Hmm @Yoyae after trying it with a couple of different assets QSP/BNB throws the -2010 error although it seems to be something to do with the Amount not the price the max amount should in fact be 700 not 727.98 gonna look into it now.
Looking at it seems to calculate the lot at the previous price... |
@mattS00 Thanks for looking at it. I will add some trace to know what price and amount is taken and when/why. I don't have time these day to look deeply into it :/ |
@mattS00 It seems the ask/bid price was not inverted as I previously thought. I fixed it. It should be good now. |
@Yoyae Trading is working although after buying the following happens |
Signed-off-by: Wilhelm Erasmus <wilhelm.erasmus@burtronix.com>
Added minimum order for luno.
Lots of fixes and error handling improvement.
@mattS00 I fixed the error. |
Solving conflict
@askmike Any idea when this will be merged? |
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. |
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature
What is the new behavior (if this is a feature change)?
Added ccxt wrapper that add all exchanges supported by ccxt (https://github.com/ccxt/ccxt)
Other information:
I've not been able to add the wrapper without modifying some core files but I kept the number of changes as low as possible.
As discussed in #1171 , ccxt is working in a different way. This a wrapper to make it work wit Gekko.