risk

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL