kronos

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 13 Imported by: 0

README

kronos

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account added in v1.0.3

type Account struct {
	AccountId   int64
	AccountType string
	TraderId    int64
	Balance     float64
	Currency    string
	Opentrades  sync.Map
	Equity      float64
	OfficeId    int64
	Scheduler   bool
	Level       bool
	Require     float64
	Coeff       float64
	DayCoeff    float64
}

type Message added in v1.0.5

type Message struct {
	D bool  `json:"d"`
	U []int `json:"u"`
	M struct {
		Event   string `json:"event"`
		Payload struct {
			A int     `json:"a"`
			B float64 `json:"b"`
			E float64 `json:"e"`
			N float64 `json:"n"`
			P float64 `json:"p"`
			U int     `json:"u"`
			C int     `json:"c"`
			O []struct {
				T int     `json:"t"`
				N float64 `json:"n"`
				P float64 `json:"p"`
			} `json:"o"`
		} `json:"payload"`
	} `json:"m"`
}

type Position

type Position struct {
	Id         int64
	Account    int64
	Pair       int64
	Amount     float64
	OpenPrice  float64
	Sellbuy    string
	Fee        float64
	Fee2       float64
	Swap       float64
	Swap2      float64
	Bonus      float64
	Pl         float64
	Opened     time.Time
	Commentary string
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(schema, dbConfig string, natsURL []string) (*Service, error)

func (*Service) GetPositions

func (s *Service) GetPositions(traderFilter int64) (out []*Position, err error)

type Symbol

type Symbol struct {
	ID           int64     `json:"-"`
	Symbol       string    `json:"Symbol"`
	Market       string    `json:"Market"`
	Quote        string    `json:"Quote"`
	Desc         string    `json:"Description"`
	Active       string    `json:"Active"`
	MinTradeSize float64   `json:"MinTradeSize"`
	Precision    float64   `json:"Precision"`
	ContractSize float64   `json:"ContractSize"`
	Group        string    `json:"Group"`
	Type         string    `json:"Type"`
	Bid          float64   `json:"Sell"`
	Ask          float64   `json:"Buy"`
	Date         time.Time `json:"PriceDate"`
}

Jump to

Keyboard shortcuts

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