Documentation
¶
Index ¶
- Constants
- func AddSpread(price, spreadBps float64, direction SpreadDirection) float64
- func GetAbsoluteDistanceBps(mid, price1, price2 float64) float64
- func GetAbsoluteSpreadBps(mid, price float64) float64
- func GetDistanceBps(mid, price1, price2 float64) float64
- func GetSpreadBps(mid, price float64) float64
- func IsEmptyTwoWay[T instr.Instrument](price TwoWay[T]) bool
- func Skew(price, skewFactorBps float64) float64
- type SpreadDirection
- type TwoWay
Constants ¶
View Source
const ( Up = SpreadDirection(iota + 1) Down )
Variables ¶
This section is empty.
Functions ¶
func AddSpread ¶
func AddSpread(price, spreadBps float64, direction SpreadDirection) float64
func GetAbsoluteDistanceBps ¶
func GetAbsoluteSpreadBps ¶
func GetDistanceBps ¶
func GetSpreadBps ¶
func IsEmptyTwoWay ¶
func IsEmptyTwoWay[T instr.Instrument](price TwoWay[T]) bool
Types ¶
type SpreadDirection ¶
type SpreadDirection int
type TwoWay ¶
type TwoWay[T instr.Instrument] struct { Instrument T Bid float64 Offer float64 BidQty float64 OfferQty float64 TransactTime time.Time }
func EmptyTwoWay ¶
func EmptyTwoWay[T instr.Instrument]() TwoWay[T]
func TwoWayFromTicker ¶
func TwoWayFromTicker[T instr.Instrument](ticker ticker.Ticker[T]) *TwoWay[T]
Click to show internal directories.
Click to hide internal directories.