forked from nntaoli-project/goex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FutureRestAPI.go
103 lines (86 loc) · 2.95 KB
/
FutureRestAPI.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package goex
type FutureRestAPI interface {
/**
*获取交易所名字
*/
GetExchangeName() string
/**
*获取交割预估价
*/
GetFutureEstimatedPrice(currencyPair CurrencyPair) (float64, error)
/**
* 期货行情
* @param currency_pair btc_usd:比特币 ltc_usd :莱特币
* @param contractType 合约类型: this_week:当周 next_week:下周 month:当月 quarter:季度
*/
GetFutureTicker(currencyPair CurrencyPair, contractType string) (*Ticker, error)
/**
* 期货深度
* @param currencyPair btc_usd:比特币 ltc_usd :莱特币
* @param contractType 合约类型: this_week:当周 next_week:下周 month:当月 quarter:季度
* @param size 获取深度档数
* @return
*/
GetFutureDepth(currencyPair CurrencyPair, contractType string, size int) (*Depth, error)
/**
* 期货指数
* @param currencyPair btc_usd:比特币 ltc_usd :莱特币
*/
GetFutureIndex(currencyPair CurrencyPair) (float64, error)
/**
*全仓账户
*/
GetFutureUserinfo() (*FutureAccount, error)
/**
* 期货下单
* @param currencyPair btc_usd:比特币 ltc_usd :莱特币
* @param contractType 合约类型: this_week:当周 next_week:下周 month:当月 quarter:季度
* @param price 价格
* @param amount 委托数量
* @param openType 1:开多 2:开空 3:平多 4:平空
* @param matchPrice 是否为对手价 0:不是 1:是 ,当取值为1时,price无效
*/
PlaceFutureOrder(currencyPair CurrencyPair, contractType, price, amount string, openType, matchPrice, leverRate int) (string, error)
/**
* 取消订单
* @param symbol btc_usd:比特币 ltc_usd :莱特币
* @param contractType 合约类型: this_week:当周 next_week:下周 month:当月 quarter:季度
* @param orderId 订单ID
*/
FutureCancelOrder(currencyPair CurrencyPair, contractType, orderId string) (bool, error)
/**
* 用户持仓查询
* @param symbol btc_usd:比特币 ltc_usd :莱特币
* @param contractType 合约类型: this_week:当周 next_week:下周 month:当月 quarter:季度
* @return
*/
GetFuturePosition(currencyPair CurrencyPair, contractType string) ([]FuturePosition, error)
/**
*获取订单信息
*/
GetFutureOrders(orderIds []string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)
/**
*获取未完成订单信息
*/
GetUnfinishFutureOrders(currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)
/**
*获取交易费
*/
GetFee() (float64, error)
/**
*获取交易所的美元人民币汇率
*/
GetExchangeRate() (float64, error)
/**
*获取每张合约价值
*/
GetContractValue(currencyPair CurrencyPair) (float64, error)
/**
*获取交割时间 星期(0,1,2,3,4,5,6),小时,分,秒
*/
GetDeliveryTime() (int, int, int, int)
/**
* 获取K线数据
*/
GetKlineRecords(contract_type string, currency CurrencyPair, period string, size, since int) ([]FutureKline, error)
}