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

STDEV Periods #86

Closed beegmon closed 7 years ago

beegmon commented 7 years ago

I am still learning the dynamics of STDEV. I am wondering if any one can provide a quick explanation between a small amount of STDEV periods and a larger amount.

I assume a small amount of periods is more reactive to recent swings in price, while a longer amount of periods is less sensitive to short/quick price movements and therefore more of a "longer term" trend measurement?

For example:

What if I set stdev periods to 30 seconds in a market that is fairly volatile or fairly flat?

What if i set stdev periods to 1200 seconds in a market that is fairly volitile or fairly flat?

How does stdev change Tribeca's behavior in terms of the price being quoted. A quick "explain it like I am 5" response would be much appreciated so I can check the assumptions I am making about how stdev works.

Finally, once the multiplier is added to OnTops, how will that effect things overall.

My apologies for the trouble. I seem to "get" how stdev is working, and then I get confused and think I must have it wrong as I watch Tribeca work.

Thanks for any input, hopefully with some help I can get it through my thick skull 😄

Camille92 commented 7 years ago

Hello,

I think you get most of it the shorter the time period is the more reactive you are to small price movements. I'm answering considering you're using STDEV TOPS mostly :).

STDEV gives you how much the price diverged on average during the period selected.

So by taking 30 you have the average of the last 30 seconds, by taking 1200, the last 20mn.

The difference is in the momentum you want to give to your width adjustment. By choosing a long one and if the market becomes suddenly volatile, you'll still offer a small width that will be slowly augmented until 'period' is over. Inversely, if the market becomes all of a sudden less volatile, you'll be stuck with large width until it slowly decreases.

By choosing a small value you're adapting quickly to the new situation. But you might be "tricked" by the market. If in a volatile market during 30 seg two big orders block the price at a 0.01 width, your STDEV will be 0.01.

So I recommend you do to some tests but it seems that the best option is between 60 and 300 seconds for me.

The multiplier goal is to define a strategy that can be more aggressive or "relaxed". With STDEV you have the average of how much the price is diverging from the mean. (In Tribeca we assume that FV is a close enough proxy of the mean to work). But maybe you want to accept trades with a lower divergence than the mean so you can have more trades (Multiplier < 1) . Or in the contrary wait for exceptional moves so you never make a mistake. (Multiplier > 1).

For instance, I'm experimenting to use it with a multiplier of 0.8.

Ps: I'm sorry if it's not very clear I'm out of town for the weekend. If it's not clear I'll try to explain better when I come back!

beegmon commented 7 years ago

That is perfect and thank you for taking the time and sharing.

This confirms with how I thought STDEV works but I wanted another opinion just to be safe.

The multiplier will be awesome once it is added as well.

One follow up question. Have you found BBO of weighted BBO better overall for fail value. I have played with both and don't see much of a difference, but figured I would ask.

ctubio commented 7 years ago

i always wanted to remove wBBO xD (but i didnt in case somebody uses it), in Coinbase may do a difference because is very usual to see in the book super big quantities as top bid/ask.

Camille92 commented 7 years ago

The problem with wBBo is that it takes into account only the top data of the market.

I think to function correctly it probably needs to take into account 5 or 10 orders deep! :)

ctubio commented 7 years ago

no moar work here, closiiing :dancer: