{"modulePath":"github.com/phonegapX/QuantBot","version":"v0.0.0-20181103064614-d060b71a9acb","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package models\n\n## Types\n\n```go\ntype AccountsData struct {\n\tID     int64  `json:\"id\"`      // Account ID\n\tType   string `json:\"type\"`    // 账户类型, spot: 现货账户\n\tState  string `json:\"state\"`   // 账户状态, working: 正常, lock: 账户被锁定\n\tUserID int64  `json:\"user-id\"` // 用户ID\n}\n```\n\n```go\ntype AccountsReturn struct {\n\tStatus  string         `json:\"status\"` // 请求状态\n\tData    []AccountsData `json:\"data\"`   // 用户数据\n\tErrCode string         `json:\"err-code\"`\n\tErrMsg  string         `json:\"err-msg\"`\n}\n```\n\n```go\ntype Balance struct {\n\tID     int64        `json:\"id\"`    // 账户ID\n\tState  string       `json:\"state\"` // 账户状态, working: 正常, lock: 账户被锁定\n\tType   string       `json:\"type\"`  // 账户类型, spot: 现货账户\n\tList   []SubAccount `json:\"list\"`  // 子账户数组\n\tUserID int64        `json:\"user-id\"`\n}\n```\n\n```go\ntype BalanceReturn struct {\n\tStatus  string  `json:\"status\"` // 请求状态\n\tData    Balance `json:\"data\"`   // 账户余额\n\tErrCode string  `json:\"err-code\"`\n\tErrMsg  string  `json:\"err-msg\"`\n}\n```\n\n```go\ntype CurrencysReturn struct {\n\tStatus  string   `json:\"status\"` // 请求状态\n\tData    []string `json:\"data\"`   // 系统支持的所有币种\n\tErrCode string   `json:\"err-code\"`\n\tErrMsg  string   `json:\"err-msg\"`\n}\n```\n\n```go\ntype KLineData struct {\n\tID     int64   `json:\"id\"`     // K线ID\n\tAmount float64 `json:\"amount\"` // 成交量\n\tCount  int64   `json:\"count\"`  // 成交笔数\n\tOpen   float64 `json:\"open\"`   // 开盘价\n\tClose  float64 `json:\"close\"`  // 收盘价, 当K线为最晚的一根时, 时最新成交价\n\tLow    float64 `json:\"low\"`    // 最低价\n\tHigh   float64 `json:\"high\"`   // 最高价\n\tVol    float64 `json:\"vol\"`    // 成交额, 即SUM(每一笔成交价 * 该笔的成交数量)\n}\n```\n\n```go\ntype KLineReturn struct {\n\tStatus  string      `json:\"status\"`   // 请求处理结果, \"ok\"、\"error\"\n\tTs      int64       `json:\"ts\"`       // 响应生成时间点, 单位毫秒\n\tData    []KLineData `json:\"data\"`     // KLine数据\n\tCh      string      `json:\"ch\"`       // 数据所属的Channel, 格式: market.$symbol.kline.$period\n\tErrCode string      `json:\"err-code\"` // 错误代码\n\tErrMsg  string      `json:\"err-msg\"`  // 错误提示\n}\n```\n\n```go\ntype MarketDepth struct {\n\tID   int64       `json:\"id\"`   // 消息ID\n\tTs   int64       `json:\"ts\"`   // 消息声称事件, 单位: 毫秒\n\tBids [][]float64 `json:\"bids\"` // 买盘, [price(成交价), amount(成交量)], 按price降序排列\n\tAsks [][]float64 `json:\"asks\"` // 卖盘, [price(成交价), amount(成交量)], 按price升序排列\n}\n```\n\n```go\ntype MarketDepthReturn struct {\n\tStatus  string      `json:\"status\"` // 请求状态, ok或者error\n\tTs      int64       `json:\"ts\"`     // 响应生成时间点, 单位: 毫秒\n\tTick    MarketDepth `json:\"tick\"`   // Depth数据\n\tCh      string      `json:\"ch\"`     //  数据所属的Channel, 格式: market.$symbol.depth.$type\n\tErrCode string      `json:\"err-code\"`\n\tErrMsg  string      `json:\"err-msg\"`\n}\n```\n\n```go\ntype MarketDetail struct {\n\tID     int64   `json:\"id\"`     // 消息ID\n\tTs     int64   `json:\"ts\"`     // 24小时统计时间\n\tAmount float64 `json:\"amount\"` // 24小时成交量\n\tOpen   float64 `json:\"open\"`   // 前24小时成交价\n\tClose  float64 `json:\"close\"`  // 当前成交价\n\tHigh   float64 `json:\"high\"`   // 近24小时最高价\n\tLow    float64 `json:\"low\"`    // 近24小时最低价\n\tCount  int64   `json:\"count\"`  // 近24小时累计成交数\n\tVol    float64 `json:\"vol\"`    // 近24小时累计成交额, 即SUM(每一笔成交价 * 该笔的成交量)\n}\n```\n\n```go\ntype MarketDetailReturn struct {\n\tStatus  string       `json:\"status\"` // 请求状态\n\tTs      int64        `json:\"ts\"`     // 响应生成时间点\n\tTick    MarketDetail `json:\"tick\"`   // Market Detail 24小时成交量数据\n\tCh      string       `json:\"ch\"`     // 数据所属的Channel, 格式: market.$symbol.depth.$type\n\tErrCode string       `json:\"err-code\"`\n\tErrMsg  string       `json:\"err-msg\"`\n}\n```\n\n```go\ntype OrderDetail struct {\n\tID         int64  `json:\"id\"`           //订单ID\n\tPrice      string `json:\"price\"`        //价格\n\tAmount     string `json:\"amount\"`       //总量\n\tDealAmount string `json:\"field-amount\"` //成交量\n\tTradeType  string `json:\"type\"`         //交易类型\n\tStockType  string `json:\"symbol\"`       //货币类型\n}\n```\n\n```go\ntype OrderDetailReturn struct {\n\tStatus  string      `json:\"status\"` // 请求状态\n\tData    OrderDetail `json:\"data\"`   // 订单详情\n\tErrCode string      `json:\"err-code\"`\n\tErrMsg  string      `json:\"err-msg\"`\n}\n```\n\n```go\ntype OrdersReturn struct {\n\tStatus  string        `json:\"status\"` // 请求状态\n\tData    []OrderDetail `json:\"data\"`   // 订单列表\n\tErrCode string        `json:\"err-code\"`\n\tErrMsg  string        `json:\"err-msg\"`\n}\n```\n\n```go\ntype PlaceRequestParams struct {\n\tAccountID string `json:\"account-id\"` // 账户ID\n\tAmount    string `json:\"amount\"`     // 限价表示下单数量, 市价买单时表示买多少钱, 市价卖单时表示卖多少币\n\tPrice     string `json:\"price\"`      // 下单价格, 市价单不传该参数\n\tSource    string `json:\"source\"`     // 订单来源, api: API调用, margin-api: 借贷资产交易\n\tSymbol    string `json:\"symbol\"`     // 交易对, btcusdt, bccbtc......\n\tType      string `json:\"type\"`       // 订单类型, buy-market: 市价买, sell-market: 市价卖, buy-limit: 限价买, sell-limit: 限价卖\n}\n```\n\n```go\ntype PlaceReturn struct {\n\tStatus  string `json:\"status\"`\n\tData    string `json:\"data\"`\n\tErrCode string `json:\"err-code\"`\n\tErrMsg  string `json:\"err-msg\"`\n}\n```\n\n```go\ntype SubAccount struct {\n\tCurrency string `json:\"currency\"` // 币种\n\tBalance  string `json:\"balance\"`  // 结余\n\tType     string `json:\"type\"`     // 类型, trade: 交易余额, frozen: 冻结余额\n}\n```\n子账户结构\n\n```go\ntype SymbolsData struct {\n\tBaseCurrency    string `json:\"base-currency\"`    // 基础币种\n\tQuoteCurrency   string `json:\"quote-currency\"`   // 计价币种\n\tPricePrecision  int    `json:\"price-precision\"`  // 价格精度位数(0为个位)\n\tAmountPrecision int    `json:\"amount-precision\"` // 数量精度位数(0为个位)\n\tSymbolPartition string `json:\"symbol-partition\"` // 交易区, main: 主区, innovation: 创新区, bifurcation: 分叉区\n}\n```\n\n```go\ntype SymbolsReturn struct {\n\tStatus  string        `json:\"status\"` // 请求状态\n\tData    []SymbolsData `json:\"data\"`   // 交易及精度数据\n\tErrCode string        `json:\"err-code\"`\n\tErrMsg  string        `json:\"err-msg\"`\n}\n```\n\n```go\ntype Ticker struct {\n\tID     int64     `json:\"id\"`     // K线ID\n\tAmount float64   `json:\"amount\"` // 成交量\n\tCount  int64     `json:\"count\"`  // 成交笔数\n\tOpen   float64   `json:\"open\"`   // 开盘价\n\tClose  float64   `json:\"close\"`  // 收盘价\n\tLow    float64   `json:\"low\"`    // 最低价\n\tHigh   float64   `json:\"high\"`   // 最高价\n\tVol    float64   `json:\"vol\"`    // 成交额\n\tBid    []float64 `json:\"bid\"`    // [买1价, 买1量]\n\tAsk    []float64 `json:\"ask\"`    // [卖1价, 卖1量]\n}\n```\n\n```go\ntype TickerReturn struct {\n\tStatus  string `json:\"status\"` // 请求处理结果\n\tTs      int64  `json:\"ts\"`     // 响应生成时间点\n\tTick    Ticker `json:\"tick\"`   // K线聚合数据\n\tCh      string `json:\"ch\"`     // 数据所属的Channel, 格式: market.$symbol.detail.merged\n\tErrCode string `json:\"err-code\"`\n\tErrMsg  string `json:\"err-msg\"`\n}\n```\n\n```go\ntype TimestampReturn struct {\n\tStatus  string `json:\"status\"` // 请求状态\n\tData    int64  `json:\"data\"`   // 时间戳\n\tErrCode string `json:\"err-code\"`\n\tErrMsg  string `json:\"err-msg\"`\n}\n```\n\n```go\ntype TradeData struct {\n\tID        int64   `json:\"id\"`        //成交ID\n\tPrice     float64 `json:\"price\"`     // 成交价\n\tAmount    float64 `json:\"amount\"`    // 成交量\n\tDirection string  `json:\"direction\"` // 主动成交方向\n\tTs        int64   `json:\"ts\"`        // 成交时间\n}\n```\n\n```go\ntype TradeDetail struct {\n\tID   int64             `json:\"id\"`   // 消息ID\n\tTs   int64             `json:\"ts\"`   // 最新成交时间\n\tData []TradeDetailData `json:\"data\"` // 交易细节数据\n}\n```\n\n```go\ntype TradeDetailData struct {\n\tID        int64   `json:\"id\"`        // 成交ID\n\tPrice     float64 `json:\"price\"`     // 成交价\n\tAmount    float64 `json:\"amount\"`    // 成交量\n\tDirection string  `json:\"direction\"` // 主动成交方向\n\tTs        int64   `json:\"ts\"`        // 成交时间\n}\n```\n\n```go\ntype TradeDetailReturn struct {\n\tStatus  string      `json:\"status\"`   // 请求处理结果, \"ok\"、\"error\"\n\tTs      int64       `json:\"ts\"`       // 响应生成时间点, 单位毫秒\n\tTick    TradeDetail `json:\"tick\"`     // TradeDetail数据\n\tCh      string      `json:\"ch\"`       // 数据所属的Channel, 格式: market.$symbol.trade.detail\n\tErrCode string      `json:\"err-code\"` // 错误代码\n\tErrMsg  string      `json:\"err-msg\"`  // 错误提示\n}\n```\n\n```go\ntype TradeReturn struct {\n\tStatus  string      `json:\"status\"` // 请求状态, ok或者error\n\tCh      string      `json:\"ch\"`     // 数据所属的Channel, 格式: market.$symbol.trade.detail\n\tTs      int64       `json:\"ts\"`     // 发送时间\n\tData    []TradeTick `json:\"data\"`   // 成交记录\n\tErrCode string      `json:\"err-code\"`\n\tErrMsg  string      `json:\"err-msg\"`\n}\n```\n\n```go\ntype TradeTick struct {\n\tID   int64       `json:\"id\"`   // 消息ID\n\tTs   int64       `json:\"ts\"`   // 最新成交时间\n\tData []TradeData `json:\"data\"` // Trade数据\n}\n```\n\n","path":"github.com/phonegapX/QuantBot/api/HuobiProAPI/models","name":"models","synopsis":"","isRedistributable":true}
