-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small Improvement / bug correction: TBP on boot seems wrong #27
Comments
Hello Camille, I do believe also the app doesnt start (it literally waits for) trading if market data or safeties or tbp is still not loaded. can you please explain again what consequences are you experimenting? (cos i think i never experiencied that; and we can search for a soluton once we understand the problem :P) |
you meaaaan that the first "tbp recalculated" is wrong? (as seen in the logs on boot?) |
Yes I give you an example (I thought I wrote it before but apparently not). So let's say the market is down, to TBP = 0, then for a reason X or Y K stops and forever restarts it again. Then during minute 1 tbp will be equal to half the BTC I can buy, so during this minute APR will be on and K will try to buy as much as possible. Then after the minute is gone, it goes back in place but I already bought in a market going down and chances are the market went even more down so I'm at a lose. |
iSee, i think i noticed too; i will investigate for a fix'¡ 💃 |
we are talking only about the first second, no? later after 1 second all is OK right? |
Nope first minute last time I checked (until tpb is updated) I would run a test normally but as the market is moving so fast I prefer to wait haha |
aaand this was in GDAX? or Bitfinex? or both? :P |
Bitfinex! but both in my memories :) |
I'm actually not sure if K keeps correctly TBP after a restart on Bitfi! |
Hello Carles, I can confirm you after some tests that TBP is not saved after restart on Bitfinex (even after 1mn). So when it crashes it goes back to calculating TBP from scratch! Mongo version 3.4.5 |
Hello Carles, I ran some tests this morning, so the problem persists with SqLite -> K doesn't keep track of ewma after a restart :S |
yea have nothing to do with the database, will investigate it soOn'' |
Yep I don't get why it's not working, I mean given the way ewma is calculated, we only need to save 1 value for each ewma and update it each minute. Then on boot, if there is values registered just use them and if not start from the beginning. But I guess it's the way it's made! |
yea your right, i modified many things but basically not only read the values from the database to make the ewmas sequences to survive a restart, but also the tbp value. before we only store fair values and market data, and revive the ewma sequence; but now we also revive tbp. i play a bit setting the tbp refresh to 1 second instead of 1 minutes; i think is nicer with 1 second, but since im not yet understanding all the implications, i leave it as it was with 1 minute tbp refresh. (but but but since market data and fair values are collected every second, i dont understand very well why should be 1 minute the tbp refresh; to me should be both the same, at 1 second) |
well the thing is that ewma value is updated every minute, so if you refresh tpb every second nothing going to change. We would easily make everything at the second level but then we need to multiply the ewma by 60 and actualize every second. But tbh I don't think it's necessary it will more be wasting resources and having inconveniently long ewma like ewma 100mn = ewma 6000seconds. I don't understand why we save FV and market data it looks unnecessary no? We could just save ewma( short, medium, long etc) latest and use them on the restart, from those we can get the TBP. And a minute '2' make the calculation again with updated values. :) |
Hey Carles, I ran some tests on the latest versions, and it turns out that TBP is not kept. Are you having the same thing? Test protocol: Letting a K running for a couple of hours so TBP has a clear position. Then run "npm restartall" to see if TBP is kept. |
Dear Carles, Would you be super nice and do the test on your machine so I can see if the problem comes from my side (maybe because of the root situation) or if it just that it is not 100% fixed for now! Thanks :) |
Hello Carles,
A very small issue (but that can sometimes have rather big consequences) is that on boot /reboot etc and before K checks mongod to see if ewma are recorded to determine TBP (t+1mn) , it will show medium TBP.
The problem is that if you have permissive trade /seg settings, you can end up selling or buying everything during that 1mn period.
So to fix the issue, would that be possible to check the database if there are EWMA recorded and use them as the starting point on boot instead of waiting 1mn ?
What do you think ?
Best Camille
The text was updated successfully, but these errors were encountered: