-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Error while creating summary: Error: Trades not found #2518
Comments
Same here:
I'm using 9cfb331 |
|
And again. @xbromy, did you find a solution? |
This is all on binance, it seems. The same error message is also effecting gdax users (happens to me there about once every 200 trades). This error comes from Gekko not being able to find the trade it just did. Some context: Gekko trades by doing limit orders, it tells Binance please buy 10 BTC at X and Binance replies we accept you order and you can refer to it by this ID. After Gekko figures out the order is completed and 10 bitcoin is bought Gekko needs to figure out things like execution price (since it might have done multiple limit orders) and fees. However the only way to get this is to ask for all trades you did and match them with the limit orders we requested previously. This error means that matching didn't work, there are 2 reasons for this:
I am in the process of creating one big debug branch that everyone who has any problems on binance, gdax or kraken should run. |
I pushed more logging around this situation: 2271428 please run the latest develop and post more logs. I am running this non stop as well to see if I can reproduce it.. |
I'm now on 2271428 |
And here is the error:
|
Thanks for those logs! This is a tough one to fix... The list in the log is cut off but it's clear that the order Gekko was searching for was not in that list. This most likely means that the order was never filled (even though Gekko thought it was). Just to make sure: Do you have any other trading things (or multiple gekkos) running on that binance account? This might be caused because someone cancelled an order that Gekko created and as such Gekko thought it was filled. I pushed another commit that should give us even more debug information: 22fca69 because I am still not sure what the problem is.. |
When Gekko says
the trade was however made and filled in my Binance account (and at the first attempt). Here is my Binance order log: https://i.imgur.com/fd5Pi8x.png The latest order (21:16:16) was made by me (because à saw Gekko failed to make it), all the others were made by Gekko. |
@PhunkyBob thanks a lot for all the details. Do please run the latest develop as it might show more debug output when the situation is happening. I'm not sure whether this is a problem with Gekko or binance, as such I asked in their API support chat: |
I'm now on 22fca69 |
Again, the order is however made in Binance. |
Hi Guys, I got the same issue last night too... caused me to miss out on a couple of good trades as all future trades get the "ignoring advice, already in process to Buy" which is kinda frustrating.. I'm going to launch my own investigation.. but below is my log output. Hopefully helpful to someone?
|
@askmike Perhaps this is a rounding issue? Creating order to buy 37999.21509270051 |
Ok been doing some further investigation... (it's probably not a rounding issue..) I'm not much of a Node.js developer but from what I can see we were trying to check the order exists in a list of order ids but the response from Binance didn't contain this orderID in the array of responses. My guess is that Binance was under load (trade volumes are quite high right now) and the response from binance was cached or hadn't updated yet. (Just a guess.. this is hard to prove!). Looking at exchange/wrappers/binance.js Lines 404-405
We have a retry function, but the checkFn "handler" we pass through doesn't have any checking that the order ID we are wanting actually exists? Can we somehow add this check into the handler? So if the order Id we are looking for doesn't return we retry the request to the exchange X number of times before we just fail? Also as this causes all future trades to fail. I think we need to email an alert in this situation so we can come and investigate / restart gekko. Gekko shouldn't just continue like nothing is wrong. |
@PhunkyBob @rkingy I know why the error is happening now:
However 2. is wrong in your cases! The extra logs show that the order wasn't filled at all when Gekko tripped. So while it might be that your binance account shows the order was filled, it wasn't when Gekko tried to get fill information yet!
So this is how Binance deals with your trading:
In other words: Gekko calls getOrder before the order is filled, while it should be after the order is filled. The most likely cause I can imagine is when Gekko asks for an order status, and Binance replies with "I dont know this order" - right now Gekko assumes that means the order was filled, but maybe it means something else. I just pushed a new commit, that instead of assuming the order was filled when binance says "I dont know this order" will re ask the same information later. Can you test that out? |
Thanks Mike.! I'll pull that update down and give it a whirl... |
It's weird. At 2018-09-22 22:39:13, the close was at 0.57303 and the strategy advised a long. I expected from 0.57303 to 0.57975 (+1%) I had 0.57604 to 0.57355 (-0.5%). Usually, when the strategy advised at a price, the order was created at this price. I don't say it's always filled, but at least it's created.
|
Since the update, I have another problem: |
@PhunkyBob i answered that new issue. Thanks for putting your questions there instead of here so we can keep this on topic. Regarding that, thanks for the logs. Would you be able to watch them and let me know once you either see the "No trades found" error or a message like |
No problem. |
@PhunkyBob @xbromy @rkingy is anyone still experiencing this on latest develop? |
On my side: 30 trades without any problem, since. |
Yes it's same on my end. Having two instances trading on binance different pairs. No problem so far.. |
@PhunkyBob @xbromy do you guys have logs by any chance? Would you mind searching for "Binance doesnt know this order, retrying up to 10 times.."? I am logging that around the biggest change. If you guys have that in the logs I am confident this is fixed! [unrelated] @PhunkyBob to come back on your earlier point:
You are right in that they are instant, but market orders in small markets are super dangerous. I just uploaded a youtube video with examples where I explain the rational: https://youtu.be/r0yc1sonYvo?t=8m20s |
|
I agree with your analysis. You say the strategy with Gekko should be to predict price movement and target 5/10% profit. |
If it's up to the strategy and you design the strategy to be run over bfx
USD/BTC that works great. But if you share that strat and someone else runs
it over MCO/BNB on binance he is probably going to lose all his money
within a week.
Since this is off topic in this issue I will start a forum thread about
this. I'll ping you the link when I do.
…On Sun, 30 Sep 2018, 20:25 PhunkyBob, ***@***.***> wrote:
I hope one day it would be possible to make market orders (they are filled
faster).
You are right in that they are instant, but market orders in small markets
are super dangerous. I just uploaded a youtube video with examples where I
explain the rational: https://youtu.be/r0yc1sonYvo?t=8m20s
I agree with your analysis.
I don't say "*it'ld be nice to replace limit orders by market orders*",
but "*it'ld be nice to have the choice between limit order and market
orders*". It would be a decision made by the owner of the strategy. It's
up to him to know the market he is dealing with.
You say the strategy with Gekko should be to predict price movement and
target 5/10% profit.
I'm using Gekko on 1 minute ticks and I'm targeting lots of trades with 1%
profit. Sometimes it works like a charm ;)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2518 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA7MD_ql_ZEfJyGfOxSrNE6Z3qgrN8Ayks5ugLhRgaJpZM4Wh4ev>
.
|
@PhunkyBob thanks a lot for those logs! It seems the commits have completely fixed this problem. the logs clearly show the new retry mechanism kicking in and catching the order, preventing the "trades not found error". If anyone still experiences this bug:
About the market orders: let's move the discussion to this thread: https://forum.gekko.wizb.it/thread-57699.html |
Yip no further issues from my end. Thanks for the fix! |
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 ...
[ ] bug report
[ ] question about the decisions made in the repository
Action taken (what you did)
Running live trader on development branch
Expected result (what you hoped would happen)
summary in log
Actual result (unexpected outcome)
2018-09-10 16:53:21 (DEBUG): [ORDER] statusChange: OPEN
2018-09-10 16:53:23 (INFO): [ORDER] partial buy fill, total filled: 39.7
2018-09-10 16:53:23 (DEBUG): [ORDER] statusChange: FILLED
2018-09-10 16:53:25 (ERROR): Error while creating summary: Error: Trades not found
at get (/home/username/gekko/exchange/wrappers/binance.js:366:23)
at checkFn (/home/username/gekko/exchange/exchangeUtils.js:23:16)
at /home/username/gekko/exchange/wrappers/binance.js:130:12
at Request.request [as _callback] (/home/username/gekko/exchange/node_modules/binance/lib/rest.js:100:21)
at Request.self.callback (/home/username/gekko/exchange/node_modules/request/request.js:185:22)
at Request.emit (events.js:182:13)
at Request. (/home/username/gekko/exchange/node_modules/request/request.js:1157:10)
at Request.emit (events.js:182:13)
at IncomingMessage. (/home/username/gekko/exchange/node_modules/request/request.js:1079:12)
at Object.onceWrapper (events.js:273:13)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1081:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
2018-09-10 16:54:56 (DEBUG): Buy - Predicted variation: 0.8433171137867231
2018-09-10 17:03:05 (DEBUG): syncing private data
2018-09-10 17:13:05 (DEBUG): syncing private data
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc)
The text was updated successfully, but these errors were encountered: