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:
ProbQueueModel
This model uses an identity function
x
to adjust the probability.
- class SquareProbQueueModel[source]
Bases:
ProbQueueModel
This model uses a square function
x ** 2
to adjust the probability.
- class PowerProbQueueModel(n)[source]
Bases:
ProbQueueModel
This model uses a power function
x ** n
to adjust the probability.
- class LogProbQueueModel[source]
Bases:
ProbQueueModel
This model uses a logarithmic function
log(1 + x)
to adjust the probability.
- class ProbQueueModel2[source]
Bases:
ProbQueueModel
This model is a variation of the
ProbQueueModel
that changes the probability calculation to f(back) / f(front + back) from f(back) / (f(front) + f(back)).
- class LogProbQueueModel2[source]
Bases:
ProbQueueModel2
This model uses a logarithmic function
log(1 + x)
to adjust the probability.
- class PowerProbQueueModel2(n)[source]
Bases:
ProbQueueModel2
This model uses a power function
x ** n
to adjust the probability.
- class ProbQueueModel3[source]
Bases:
ProbQueueModel
This model is a variation of the
ProbQueueModel
that changes the probability calculation to 1 - f(front / (front + back)) from f(back) / (f(front) + f(back)).
- class PowerProbQueueModel3(n)[source]
Bases:
ProbQueueModel3
This model uses a power function
x ** n
to adjust the probability.