ctubio / Krypto-trading-bot

Self-hosted crypto trading bot (automated high frequency market making) written in C++
https://127.0.0.1:3000
Other
3.29k stars 815 forks source link

Improvement: Dynamically change settings depending on apMode results #129

Open Camille92 opened 6 years ago

Camille92 commented 6 years ago

Hello everyone,

I think this is a good improvement that everyone would enjoy. The idea here is to move from the "one size fits all" way of dealing with K to a one more elaborate to market condition.

The idea is to be able to pre-set as many as you want configs in K that will be used depending on the market conditions, ie: the result of ApMode.

I give you a few example of being more clear, I think for my personal use I would need 3 or 4 different configs.

This config would differ from my main config with smaller sell orders, bigger buys orders and smaller pdiv and probably activating APR.

In this case, I would set a pdiv to 0 and maybe no sell orders or very small ones to be sure I don't sell for no reason.

Well, you see how everyone could benefit from that :) and as everyone will be able to fix as much as they want types of config all provoked by the difference you get in your ewma (LS or LMS).

It would fix the need for #59 as you could just set that in the config (if Short > Long by more than 2.5%) (but if @spudstr already implemented it, better keeping it haha).

Also, it can be a good base for https://github.com/ctubio/tribeca/issues/32 as we can imagine setting a different type of config call "Safety up / Safety down" that would be activated under different condition (ie the evolution of SMA_3 over time) and have the priority over the main settings defined

Tell me what you think about it and if you have any question!

Happy summer to all!

Ps: the ewma are used from the database only at minute 2 after boot. Is there any way to use them as soon as we launch? Pps: It's my bday in a few days, I'll send you a tip for the occasion + the 1 year of using K :)

blackivory commented 6 years ago

happy birthday Camille ! appreciate for your idea & efforts

spudstr commented 6 years ago

my "Fix" isn't really complete i'm still testing it. some things i don't know how to pre-load so the bot takes.. 30 seconds to warm up and recalculate the tbp so it knows where to throw the ASP factors..

Camille92 commented 6 years ago

Thanks, @blackivory! and @spudstr yes that's a bit annoying.

I don't know how to do it but a solution to use the last ewma registered in the DB on boot as our ewma values for the first minute then correcting that with the normal formula for the next minute.

spudstr commented 6 years ago

my problem is loading the base ASP value. i thought i defined it by default but when i launch a new instance/db it comes up as undefined. i made a web input that defined ASP .. hitting save will then defie that value.. about like i said 30 seconds later it kicks in.

ctubio commented 6 years ago

this issue is about having multiple quoting parameters instead of only 1, and use them depending on some condition (market moving fast/slow), right?

currently users are supposed to reconfigure manually based on market moves; so this is supposed to avoid the manual adjustments?

Camille92 commented 6 years ago

Yes exactly I was thinking first and the most obvious conditions could be the difference in % of your different ewmas.

But in the long term it could be anything :)

Then no need to manually update if the market goes strong up / low or just sideways !

ctubio commented 6 years ago

understood, thanks for the idea'¡

spudstr commented 6 years ago

I'm going to try to work on this this weekend.

spudstr commented 6 years ago

and.. i've almost completed.. all of this..

CarlitoGrey commented 6 years ago

I like the idea of TBP being able to change 'profiles' between custom ranges.

Just a thought this morning Carles. Would it make sense to move the calculateTBP function outside to its own file? The function can then have all the market indicators (ewma short/long etc) and it's return is TBP (-1 to +1). This file is then easy to modify by the user to use any indicator they want to determine the TBP?

Camille92 commented 6 years ago

I agree with Carlito in the idea that TB should be somewhere else to easily use it.

And especially getting rid of this -1 / 1 limit when we don't need it :)

Le 14 août 2017 08:29, "CarlitoGrey" notifications@github.com a écrit :

I like the idea of TBP being able to change 'profiles' between custom ranges.

Just a thought this morning Carles. Would it make sense to move the calculateTBP function outside to its own file? The function can then have all the market indicators (ewma short/long etc) and it's return is TBP (-1 to +1). This file is then easy to modify by the user to use any indicator they want to determine the TBP?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ctubio/Krypto-trading-bot/issues/129#issuecomment-322109878, or mute the thread https://github.com/notifications/unsubscribe-auth/AGizFmO57mQQOOJSQDabySE84-QtZ1Wbks5sX-lTgaJpZM4O0izq .