Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateVWAP ¶
func CalculateVWAP(ctx context.Context, matchInfoIn <-chan MatchInfo, averagerMaxSize int, onVMAPInfo OnVWAPInfo) error
CalculateVWAP Consumes a matches channel and for each sample calculates the instantaneous VWAP for each ProductId that comes in the channel. For each received sample, the callback function onVMAPInfo will be called with the latest results in weighted average for the price, according to VWAP
Types ¶
type OnMatchInfo ¶
type OnMatchInfo func(MatchInfo)
type OnVWAPInfo ¶
type OnVWAPInfo func(VWAPInfo)
type StreamResponse ¶
type StreamResponse struct { // "type": "last_match", Type string `json:"type"` Message string `json:"message"` Reason string `json:"reason"` // "trade_id": 3168503, // "maker_order_id": "989df982-552b-47db-a247-2cb34386d25d", // "taker_order_id": "6c5e5552-130a-4460-9fb2-9084291814c7", // "side": "sell", // "size": "0.01", Size *big.Float `json:"size"` // "price": "0.06961", Price *big.Float `json:"price"` // "product_id": "ETH-BTC", ProductId string `json:"product_id"` }
Click to show internal directories.
Click to hide internal directories.