rates

package
v0.0.0-...-9e6d8ee Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 4 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetCandleRequest

type AssetCandleRequest struct {
	ID       string `json:"id"`
	Candle   []int  `json:"candle"`
	Provider string `json:"provider"`
}

AssetCandleRequest -

type CandleRequest

type CandleRequest struct {
	AssetID         string                    `json:"assetID"`
	Ticks           bool                      `json:"ticks"`
	FullMaps        bool                      `json:"fullMaps"`
	Times           []int64                   `json:"times"`
	Start           time.Time                 `json:"start"`
	End             time.Time                 `json:"end"`
	Candle          []int                     `json:"candle"`
	ForceEnable     bool                      `json:"forceEnable"`
	RequestTime     time.Time                 `json:"requestTime"`
	SaveResult      bool                      `json:"saveResult"`
	WaitToFinish    bool                      `json:"-"`
	OnReceiveCandle func(int64, Points)       `json:"-"`
	Done            func()                    `json:"-"`
	OnStatus        func(CandleRequestStatus) `json:"-"`
}

CandleRequest -

type CandleRequestStatus

type CandleRequestStatus struct {
	RemainingCandle int       `json:"remainingCandle"`
	CurrentSize     int       `json:"currentSize"`
	LastTime        time.Time `json:"lastTime"`
	Count           int       `json:"count"`
}

CandleRequestStatus -

type Comissions

type Comissions struct {
	ActiveID int     `json:"active_id"`
	Value    float64 `json:"value"`
}

Comissions -

type Error

type Error struct {
}

Error -

type Expiration

type Expiration struct {
	Time     int64 `json:"time"`
	Period   int   `json:"period"`
	DeadTime int   `json:"dead_time"`
	Others   map[string]interface{}
}

Expiration -

type PointStore

type PointStore struct {
	Candle sync.Map
}

PointStore -

func NewPointStore

func NewPointStore(candle []int) *PointStore

NewPointStore -

func (*PointStore) Count

func (cc *PointStore) Count(candle int) (c int)

Count -

func (*PointStore) CountTicks

func (cc *PointStore) CountTicks() (c int)

CountTicks -

func (*PointStore) Delete

func (cc *PointStore) Delete(candle int, key int64)

Delete -

func (*PointStore) DeleteMultiple

func (cc *PointStore) DeleteMultiple(candle int, key []int64)

DeleteMultiple -

func (*PointStore) GetFirst

func (cc *PointStore) GetFirst(candle int) (result Points, ok bool)

GetFirst -

func (*PointStore) GetFirstKeyN

func (cc *PointStore) GetFirstKeyN(candle, num int) (result []int64)

GetFirstKeyN -

func (*PointStore) GetLast

func (cc *PointStore) GetLast(candle int) (result Points, ok bool)

GetLast -

func (*PointStore) Load

func (cc *PointStore) Load(candle int, key int64) (value Points, ok bool)

Load -

func (*PointStore) LoadAll

func (cc *PointStore) LoadAll(candle int) (c []Points)

LoadAll -

func (*PointStore) LoadTicks

func (cc *PointStore) LoadTicks(key int64) (value Points, ok bool)

LoadTicks -

func (*PointStore) MakeMap

func (cc *PointStore) MakeMap() (c map[int][]Points)

MakeMap -

func (*PointStore) MakeMapOption

func (cc *PointStore) MakeMapOption(from, to int64, limit int) (c map[int][]Points)

MakeMapOption -

func (*PointStore) Store

func (cc *PointStore) Store(candle int, key int64, data Points)

Store -

type Points

type Points struct {
	Close float64 `json:"close"`
	Open  float64 `json:"open"`
	High  float64 `json:"high"`
	Low   float64 `json:"low"`
	Ask   float64 `json:"ask"`
	Bid   float64 `json:"bid"`
	To    int64   `json:"to"`
	From  int64   `json:"from"`
	At    int64   `json:"at"`
	Size  int     `json:"size"`
}

Points -

type Schedule

type Schedule struct {
	IsOpen      bool      `json:"isOpen"`
	IsEnable    bool      `json:"isEnable"`
	IsSuspended bool      `json:"isSuspended"`
	OpeningAt   time.Time `json:"openingAt"`
	ClosingAt   time.Time `json:"closingAt"`
	StartTime   time.Time `json:"startTime"`
}

Schedule -

type SendPoints

type SendPoints struct {
	AssetID    string    `json:"assetID"`
	ServerTime time.Time `json:"serverTime"`
	Provider   string    `json:"provider"`
	SendTime   time.Time `json:"sendTime"`
	IsTest     bool      `json:"isTest"`
	//Current    map[int]Points         `json:"current"`
	Candles               map[int][]Points                              `json:"candles"`
	Others                map[string]interface{}                        `json:"others"`
	RequestID             string                                        `json:"requestID"`
	Strategy              strategy.Strategy                             `json:"strategy"`
	OnSignal              func(strategy.SendingSignal)                  `json:"-"`
	OnCompleteCalculation func(strategy.CompleteCalculation)            `json:"-"`
	GetPoints             func(CandleRequest) (map[int][]Points, error) `json:"-"`
}

SendPoints -

type SendStatus

type SendStatus struct {
	AssetID             string         `json:"assetID"`
	Error               *Error         `json:"error"`
	ServerTime          time.Time      `json:"serverTime"`
	HistoryStartRequest time.Time      `json:"historyStartRequest"`
	Provider            string         `json:"provider"`
	Role                string         `json:"role"`
	SendTime            time.Time      `json:"sendTime"`
	IsReady             bool           `json:"isReady"`
	IsConnected         bool           `json:"isConnected"`
	Active              bool           `json:"active"`
	Schedule            Schedule       `json:"schedule"`
	Current             map[int]Points `json:"current"`
	NoOfAllData         int            `json:"noOfAllData"`
	RequestID           string         `json:"requestID"`
}

SendStatus -

type Spot

type Spot struct {
	Call  SpotItems `json:"call"`
	Put   SpotItems `json:"put"`
	Value int64     `json:"value"`
}

Spot -

type SpotItems

type SpotItems struct {
	ID     string  `json:"id"`
	Profit float64 `json:"profit"`
}

SpotItems -

type Stores

type Stores struct {
	ProviderAssets  sync.Map
	ProviderConfig  sync.Map
	Provider        sync.Map
	ProviderPlugins sync.Map
}

Stores -

type SyncMap

type SyncMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

SyncMap -

func NewSyncMap

func NewSyncMap() *SyncMap

NewSyncMap -

func (*SyncMap) Count

func (rm *SyncMap) Count() (value int)

Count -

func (*SyncMap) CountTicks

func (rm *SyncMap) CountTicks() (value int)

CountTicks -

func (*SyncMap) Delete

func (rm *SyncMap) Delete(key int64)

Delete -

func (*SyncMap) DeleteMultiple

func (rm *SyncMap) DeleteMultiple(key []int64)

DeleteMultiple -

func (*SyncMap) GetFirst

func (rm *SyncMap) GetFirst() (result Points, ok bool)

GetFirst -

func (*SyncMap) GetFirstKeyN

func (rm *SyncMap) GetFirstKeyN(num int) (result []int64)

GetFirstKeyN -

func (*SyncMap) GetLast

func (rm *SyncMap) GetLast() (result Points, ok bool)

GetLast -

func (*SyncMap) Load

func (rm *SyncMap) Load(key int64) (value Points, ok bool)

Load -

func (*SyncMap) LoadAll

func (rm *SyncMap) LoadAll() (value []Points)

LoadAll -

func (*SyncMap) LoadAllOptions

func (rm *SyncMap) LoadAllOptions(from, to int64, limit int) (value []Points)

LoadAllOptions -

func (*SyncMap) LoadTicks

func (rm *SyncMap) LoadTicks(key int64) (value Points, ok bool)

LoadTicks -

func (*SyncMap) Store

func (rm *SyncMap) Store(key int64, value Points)

Store -

func (*SyncMap) StoreTicks

func (rm *SyncMap) StoreTicks(key int64, value Points)

StoreTicks -

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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