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.41k stars 825 forks source link

Show market width in percent #843

Open grhangelone opened 6 years ago

grhangelone commented 6 years ago

Hi there, I want to propose a small change/addition in the display of the market width.

Currently the width is displayed only in the base currency. Like: Market Width: 0.004455, Quote Width: 0.000000

If you use percentage quote widths this doesn't help. Tabtrader on my mobile shows me the spread in percent, but it would be nice if the bot would show it, too,

My proposal is to show the width in percent after the currently shown value in the GUI Like: Market Width: 0.004455 (1,50%), Quote Width: 0.000000 (x.xx%)

ctubio commented 6 years ago

morning''' just one question: in your example, 0.004455 is the 1,50% of what? of your order size? in what is based the percentage you wanna have displayed?

thanks for the suggestion'¡

grhangelone commented 6 years ago

1,5% is the market width in percent

if the top bid is 0.005 and the top ask is 0.008 i believe the bot says "market width 0.003" in addition it should also say 60%

then i can set my quotes to 65% for safety or 55% to undercut

i think there is no need for a precentage at the quote width since this should be the width i set in the config

ctubio commented 6 years ago

in your example, is 60% because the top bid (0.005) is the 60% of the top ask (0.008)?

grhangelone commented 6 years ago

uh, i think i miscalculated that.

basically i want to express the 0.003 spread in percent but to make that usable with the quote width this has to depend on the fair value since the quotes do that, too

the tabtrader orderbook display does something like that the bot gives us the "0.0079" and i want the "20%" :) screenshot_2018-11-19-15-21-29

i'll think about this again and come back to you :)

grhangelone commented 6 years ago

ok, i found the formula % Spread = 100×(Ask Price - Bid Price)/Ask Price In above example thats the 20,36

so at least if we use a BBO FV, that means if we add 10,18% to the FV we match the ask price

that tells me to set the pong with to something bigger than 10,18% or in case of no safety to use a width > 20,36%

donaldforest commented 6 years ago

% Spread = 100×(Ask Price - Bid Price)/Ask Price

same as % Spread = 100×(1 - Bid Price/Ask Price)

zmbbmz commented 3 years ago

this would be a very helpful feature. botconfig is always set with %-width! and you have to manually change the width-% because of spread changes.

another improvement could be a "auto-width" mode, in this case the bot himself change the width due to the actual spread - a min-width-% setting here would makes sense. many coins often changes the spread very quickly, mostly on heavy trading activity.