Documentation ¶ Index ¶ func ContractRisk(buy, stop decimal.Decimal, unit, number int) decimal.Decimal func SpotRisk(buy, stop, amount decimal.Decimal) decimal.Decimal type Spot func (s Spot) Quota(buy, stop, total decimal.Decimal) decimal.Decimal func (s Spot) QuotaAtr(atr float64, total decimal.Decimal) decimal.Decimal Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func ContractRisk ¶ func ContractRisk(buy, stop decimal.Decimal, unit, number int) decimal.Decimal func SpotRisk ¶ func SpotRisk(buy, stop, amount decimal.Decimal) decimal.Decimal Types ¶ type Spot ¶ type Spot struct { PricePrecision int32 AmountPrecision int32 } func (Spot) Quota ¶ func (s Spot) Quota(buy, stop, total decimal.Decimal) decimal.Decimal Quota is max amount when place order func (Spot) QuotaAtr ¶ func (s Spot) QuotaAtr(atr float64, total decimal.Decimal) decimal.Decimal QuotaAtr is Quota by atr Source Files ¶ View all Source files risk.go Click to show internal directories. Click to hide internal directories.