trade

package
v0.0.0-...-da5ca09 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2016 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Fee       float64 `yaml:"fee"`
	Uid       string  `yaml:"uid"`
	Username  string  `yaml:"username"`
	Account1  string  `yaml:"account1"`
	Account2  string  `yaml:"account2"`
	Password1 string  `yaml:"password1"`
	Password2 string  `yaml:"password2"`
	Password3 string  `yaml:"password3"`
	// contains filtered or unexported fields
}

func (*Account) Balance

func (account *Account) Balance() (data Balance, err error)

获取账户资金

func (*Account) Buy

func (account *Account) Buy(stock string, price float64, amount int64) (id int64, err error)

异步挂单买

func (*Account) Cancel

func (account *Account) Cancel(id int64) (err error)

取消订单

func (*Account) Login

func (account *Account) Login() (err error)

登录

func (*Account) Pending

func (account *Account) Pending() (data []Order, err error)

获取未交易成功列表

func (*Account) Position

func (account *Account) Position() (data []StockPosition, err error)

获取持仓

func (*Account) RefreshUid

func (account *Account) RefreshUid()

定时刷新使UID不过期

func (*Account) Sell

func (account *Account) Sell(stock string, price float64, amount int64) (id int64, err error)

异步挂单卖

type Balance

type Balance struct {
	Balance          float64
	AvailableBalance float64
	FrozenBalance    float64
}

type Data

type Data struct {
	No string `json:"entrust_no"`
}

type Order

type Order struct {
	Code   string
	Name   string
	Amount int64
	Price  float64
	Id     int64
	Type   string
}

type Result

type Result struct {
	ErrorCode    string `json:"cssweb_code"`
	ErrorMessage string `json:"cssweb_msg"`
	Item         []Data `json:"item"`
}

type StockPosition

type StockPosition struct {
	Code            string `yaml:"-"`
	Name            string `yaml:"-"`
	Amount          int64  `yaml:"amount"`
	AvailableAmount int64  `yaml:"available_amount"`
	FrozenAmount    int64  `yaml:"frozen_amount"`
}

Jump to

Keyboard shortcuts

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