Krypto-trading-bot: Negative width -> what are the consequences ?

Created on 10 Nov 2017  路  14Comments  路  Source: ctubio/Krypto-trading-bot

Hi Carles,

Just a question, I'm afraid of the consequences of the negative width that we see often occurring on trading.

Does it have an impact on the ewma / ewma trend / stdev / quoting?

Because it seems so (but I can't say for sure).

Please tell me more about it!

And if it has consequences, then it's necessary to find a fix :)
capture d ecran 2017-11-10 a 13 29 13

acknowledged bug

All 14 comments

in what exchange you see overlapping market sides? lately i didnt noticed this :S

if is a UI glitch is harmless, but if is a api bug then all fail

Hi Carles,
i麓ve seen it on Bitfinex with ETH/USD and BCH/BTC when the bots run more than an Hour.
(atm. i do a hourly restart because of that but i have seen it yesterday on both bots)
On GDAX i did not notice that problem.

Hey to answer your questions,

It's on Bitfinex and on any market as soon you have big volatility.

I think it's not a web UI glitch because I was comparing the ewma in Tradingview and the bot and it differed when the glitch happened. :/

I think you could see the bug by opening an instance in bitfi where when you have big volatility in a few minutes / 1h you should see some!

ima leave this here for laterz

bitfinex algorithm to create and keep a book instance updated:
1 subscribe to channel
2 receive the book snapshot and create your in-memory book structure
3 when count > 0 then you have to add or update the price level
3.1 if amount > 0 then add/update bids
3.2 if amount < 0 then add/update asks
4 when count = 0 then you have to delete the price level.
4.1 if amount = 1 then remove from bids
4.2 if amount = -1 then remove from asks

https://gist.github.com/prdn/b8c067c758aab7fa3bf715101086b47c

Works well!
Thank you for the time carles!

Hi Carles,

Sadly the problem has not been fixed with the latest update. After letting it run for the night, I've found it.

Do you think we could include a protection to drop the book or restart the bot if a negative width happens?

Best,
Camille

morning''
note that negative width means zombie market levels, that become negative when the market price moves above/below (that means we should try to avoid them from the root, not just when are clearly visible cos sides overlap).

will try to request a market snapshot every now and then instead of just only on boot.

That seems to be a good option to ask for the book again.

As it seems to be a problem happening with high volatility it could be that it's just too much information coming at the same time or created and canceled before the bot has the time to manage the information.

Why not request a snapshot each time width is negative + after a certain amount of time?

Is there is a way to ask for a certain order?

I find the options offered by Bitfinex a bit slim!

request a snapshot when the width is negative is bad because it solves the problem too late. the problem (zombie market levels) exists since long time before the sides clearly overlap. it should be fixed far before the sides clearly overlap; not sure yet how to detect this zombies, so will try to investigate before decide to simply request a snapshot every now and then :dancer:

before we were leaving undeleted the last level of the snapshot, so it become negative at some point :(
now i dont see any problem, but anyway will rerereview it

Yep, but I have no idea on how to see if an order is true or fake if it doesn't cross.

And it doesn't have a very negative consequence that there is a fake order somewhere in the book.

I agree it's not perfect, but I feel that it's better than the current state and If you have an idea for a better solution I'm obviously in for that :)

ok soo.. xD:
plan a rerereview
plan b snap every now and then
plan b snap on negative width

thanks for the opinionated replies'隆!

image

bnq1gi7iyaa9nzn

Fixed with some of the latest updates!

Well done :)

Was this page helpful?
0 / 5 - 0 ratings