Documentation ¶
Overview ¶
Package money provides money management and position sizing
Index ¶
Constants ¶
View Source
const DefaultStepSize = 0.01
DefaultStepSize is the default step size (rounding) for position sizes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FixedSizer ¶
FixedSizer is a fixed position sizing strategy. Size is fixed capital divided by price (rounded to StepSize).
func NewFixedSizer ¶
func NewFixedSizer(capital decimal.Decimal) *FixedSizer
NewFixedSizer returns a new FixedSizer with the given fixed capital and a default step size.
type SafeFSizer ¶
SafeFSizer is a Sizer that uses a fixed fraction method (e.g. Kelly / OptimalF) with a safety margin.
func NewSafeFSizer ¶
func NewSafeFSizer(initialCapital decimal.Decimal, f, scaleF float64) *SafeFSizer
NewSafeFSizer returns a new SafeFSizer with the given initial capital, fixed fraction, scale factor, and step size.
Click to show internal directories.
Click to hide internal directories.