qbtrade/pkg/risk/riskcontrol/positionriskcontrol_callbacks.go

19 lines
556 B
Go
Raw Permalink Normal View History

2024-06-27 14:42:38 +00:00
// Code generated by "callbackgen -type PositionRiskControl"; DO NOT EDIT.
package riskcontrol
import (
"git.qtrade.icu/lychiyu/qbtrade/pkg/fixedpoint"
"git.qtrade.icu/lychiyu/qbtrade/pkg/types"
)
func (p *PositionRiskControl) OnReleasePosition(cb func(quantity fixedpoint.Value, side types.SideType)) {
p.releasePositionCallbacks = append(p.releasePositionCallbacks, cb)
}
func (p *PositionRiskControl) EmitReleasePosition(quantity fixedpoint.Value, side types.SideType) {
for _, cb := range p.releasePositionCallbacks {
cb(quantity, side)
}
}