Queue Models
- class RiskAverseQueueModel[source]
Provides a conservative queue position model, where your order’s queue position advances only when trades occur at the same price level.
- class ProbQueueModel[source]
Provides a probability-based queue position model as described in https://quant.stackexchange.com/questions/3782/how-do-we-estimate-position-of-our-order-in-order-book.
Your order’s queue position advances when a trade occurs at the same price level or the quantity at the level decreases. The advancement in queue position depends on the probability based on the relative queue position. To avoid double counting the quantity decrease caused by trades, all trade quantities occurring at the level before the book quantity changes will be subtracted from the book quantity changes.
- class IdentityProbQueueModel[source]
Bases:
ProbQueueModelThis model uses an identity function
xto adjust the probability.
- class SquareProbQueueModel[source]
Bases:
ProbQueueModelThis model uses a square function
x ** 2to adjust the probability.
- class PowerProbQueueModel(n)[source]
Bases:
ProbQueueModelThis model uses a power function
x ** nto adjust the probability.
- class LogProbQueueModel[source]
Bases:
ProbQueueModelThis model uses a logarithmic function
log(1 + x)to adjust the probability.
- class ProbQueueModel2[source]
Bases:
ProbQueueModelThis model is a variation of the
ProbQueueModelthat changes the probability calculation to f(back) / f(front + back) from f(back) / (f(front) + f(back)).
- class LogProbQueueModel2[source]
Bases:
ProbQueueModel2This model uses a logarithmic function
log(1 + x)to adjust the probability.
- class ProbQueueModel3[source]
Bases:
ProbQueueModelThis model is a variation of the
ProbQueueModelthat changes the probability calculation to 1 - f(front / (front + back)) from f(back) / (f(front) + f(back)).
- class PowerProbQueueModel3(n)[source]
Bases:
ProbQueueModel3This model uses a power function
x ** nto adjust the probability.