Documentation
¶
Index ¶
- Constants
- Variables
- func Copy(dst, src string) (err error)
- func CopyWithMainPkg(dst, src string) (err error)
- func FloatAdd(a, b float64) float64
- func FloatDiv(a, b float64) float64
- func FloatMul(a, b float64) float64
- func FloatSub(a, b float64) float64
- func FormatFloat(n float64, precision int) float64
- func GetBinSizeDuration(str string) (duration time.Duration, err error)
- func GetExecDir() string
- func MergeKlineChan(klines chan []interface{}, srcDuration, dstDuration time.Duration) (rets chan []interface{})
- func OpenURL(strURL string) error
- func ParseBinSizes(str string) (durations []time.Duration, err error)
- func ParseBinStrs(str string) (strs []string)
- type CandleFn
- type Entry
- type KlineMerge
- func (km *KlineMerge) GetDst() int64
- func (km *KlineMerge) GetDstDuration() time.Duration
- func (km *KlineMerge) GetSrc() int64
- func (km *KlineMerge) GetSrcDuration() time.Duration
- func (km *KlineMerge) IsFirst() bool
- func (km *KlineMerge) NeedMerge() bool
- func (km *KlineMerge) Update(data interface{}) (ret interface{})
- type Param
- func BoolParam(name, label, info string, defValue bool, ptr *bool, enums ...Entry) Param
- func FloatParam(name, label, info string, defValue float64, ptr *float64, enums ...Entry) Param
- func IntParam(name, label, info string, defValue int, ptr *int, enums ...Entry) Param
- func StringParam(name, label, info, defValue string, ptr *string, enums ...Entry) Param
- type ParamData
- type VBalance
Constants ¶
View Source
const (
DefaultBinSizes = "1m, 5m, 15m, 30m, 1h, 4h, 1d"
)
Variables ¶
View Source
var ( Day = time.Hour * 24 Week = time.Hour * 24 * 7 )
View Source
var (
ErrNoBalance = errors.New("no balance")
)
Functions ¶
func CopyWithMainPkg ¶
func FormatFloat ¶
FormatFloat format float with precision
func GetBinSizeDuration ¶
GetBinSizeDuration get duration of the binsize
func MergeKlineChan ¶
func MergeKlineChan(klines chan []interface{}, srcDuration, dstDuration time.Duration) (rets chan []interface{})
MergeKlineChan merge kline data
func ParseBinSizes ¶
ParseBinSizes parse binsizes
func ParseBinStrs ¶
ParseBinStrs parse binsizes to strs
Types ¶
type CandleFn ¶
type CandleFn func(candle *trademodel.Candle)
type KlineMerge ¶
type KlineMerge struct {
// contains filtered or unexported fields
}
KlineMerge merge kline to new duration
func NewKlineMerge ¶
func NewKlineMerge(src, dst time.Duration) *KlineMerge
NewKlineMerge merge kline constructor
func NewKlineMergeStr ¶
func NewKlineMergeStr(src, dst string) *KlineMerge
NewKlineMergeStr new KlineMerge with string duration
func (*KlineMerge) GetDst ¶
func (km *KlineMerge) GetDst() int64
GetDst return kline dst duration secs
func (*KlineMerge) GetDstDuration ¶
func (km *KlineMerge) GetDstDuration() time.Duration
GetDstDuration get kline dst duration
func (*KlineMerge) GetSrc ¶
func (km *KlineMerge) GetSrc() int64
GetSrc return kline source duration secs
func (*KlineMerge) GetSrcDuration ¶
func (km *KlineMerge) GetSrcDuration() time.Duration
GetSrcDuration get kline source duration
func (*KlineMerge) Update ¶
func (km *KlineMerge) Update(data interface{}) (ret interface{})
Update update candle, and return new kline candle return nil if no new kline candle
type Param ¶
type Param struct {
Name string
Type string
Label string
Info string
DefValue interface{}
Enums []Entry
// contains filtered or unexported fields
}
func FloatParam ¶ added in v0.0.8
type VBalance ¶
type VBalance struct {
// contains filtered or unexported fields
}
func NewVBalance ¶
func NewVBalance() *VBalance
func (*VBalance) GetFeeTotal ¶
Click to show internal directories.
Click to hide internal directories.