ctubio / tribeca

Self-hosted crypto trading bot (automated high frequency market making) in node.js, angular, typescript and c++
https://127.0.0.1:3000
Other
95 stars 26 forks source link

Change in AK-47 Bid Behavior? #70

Closed beegmon closed 7 years ago

beegmon commented 7 years ago

I notice that of the last pull, AK-47 doesn't appear to be opening the number of bullets specified on the bid side. I am currently running 5 bullets, and while I see 5 ask orders being opened, there is only ever one bid side bullet being opened, depsite there being enough funds to open a total of 5. Earlier today this appeared to be working with 5 and 5 being opened.

Did something change here, or am i missing something?

Thanks!

ctubio commented 7 years ago

oh, maybe yes changed something, cos rewrote the broker a in the latest modifications of michaelgrosner/tribeca; let me investigate if we lost any previous functionality; many thanks for the notice'¡

beegmon commented 7 years ago

It looks this affects ask side as well. I woke up this morning (AK-47 5 bullets), and it acting like standard ping/pong, or TOP (1 quote on each side of the book) but with the widthCalculation from AK-47 for each "ping". I moved over to TOP for now, since it will at least keep the quote width in check while things get sorted.

ctubio commented 7 years ago

changed the label cos is a new feature without negative impact

beegmon commented 7 years ago

Maybe I don't understand how AK-47 works, but this is what I am seeing.

AK-47 Bullets: 2 PingAtBothSides Pings/Pongs are cleared before active trading starts.

Start Active Trading:

Tribeca opens 2 Asks and 1 Bid order. The 2 Asks are filled and Trebca still only has 1 Bid order open. I would expect an additional Bid order to be opened as well on the start of active trading. However, a second bid order is not opened, nor is another opened when the 2 asks "pings" fill.

Tribeca then opens another 2 asks, these fill, but only 1 bid order is open still.

This continues till TBP +/- PDiv is breached, the ask side stops sending orders, and only 1 Bid order still remains. The Bid order is updated as the price changes, but no additional bid orders are opened, which doesn't make sense to me.

Those filled ask orders are "pings" so why wouldn't Tribeca open pongs on the bid side for these pings in AK-47 mode?

Also, why didn't it open 2 "pings" on the bid side when active trading started to begin with?

Does AK-47 wait to open additional Bid orders until after the first "ping" order on the bid side has been filled?

ctubio commented 7 years ago

Hello beegmon'¡ the exact situation is: tribeca does not place new orders if the new order to be palced is equal to the last order placed.

This condition for example is the reason of the waiting time without orders between you cancel an order and a new order is placed; since the order is palced, a new order will not be placed until it has a different price than the previous canceled one.

this also affects any other situations where tribeca is expected to place new orders but it doesnt, and misteriously waits for something (it waits for a new price xD); also i think it includes what you describe

im arround this problem for long time, because it will increase the new orders frequency, but still didnt dedicated time for it, and didnt found the solution randomly looking other things yet xD

will open a new issue to fix this waiting time, many thanks for report it'¡

ctubio commented 7 years ago

in the other hand what AK-47 does is: when placing a new order, instead of cancel the previous one, it places it with some margin over/below the previous leaving also the previous alive; it only cancels the previous if there are already the maximum limit of orders opened. also it cancels all previous orders if those are worst than the new.

but AK-47 as any other method is subjected by the new orders that the quote-engine decides to send, under all the conditions, including the one discussed above

but but now AK-47 is broken because is limitet to 1 order in each side, will fix soOn'¡

Camille92 commented 7 years ago

I think this is maybe the cause https://github.com/ctubio/tribeca/issues/72