Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ex ¶
type Ex interface { // Exchange custom properties. Property() *ExProperty // Get all supported pairs, min trade amount... GetMarketInfo(ignorePairsNotFound bool) (*MarketInfo, error) // Get max open order books. GetDepth(market Market, target Pair) (*Depth, error) // Get kline. // If since is valid, since should appear in the results. GetCandleSticks(market Market, target Pair, period Period, since *time.Time) (*CandleSticks, error) // Get all ticks. GetTicks(ignorePairsNotFound bool) (map[PairM]Tick, error) // Get account info includes all currency balances. GetAccount() (*Account, error) // Margin account borrowable. GetBorrowable(margin Margin, asset string) (gdecimal.Decimal, error) // Margin account borrow. Borrow(margin Margin, asset string, amount gdecimal.Decimal) error // Margin account repay. Repay(margin Margin, asset string, amount gdecimal.Decimal) error // Transfer between different sub accounts. Transfer(asset string, amount gdecimal.Decimal, from, to SubAcc) error // amount: always unit amount, not quote amount, whether buy or sell. // price: when market-buy/market-sell, price will be ignored. Trade(market Market, margin Margin, leverage int, target Pair, side OrderSide, orderType OrderType, unitAmount, price, stopPrice gdecimal.Decimal) (*OrderId, error) // Get all my unfinished orders' info. GetOpenOrders(market *Market, margin *Margin, target *Pair) ([]Order, error) // Get all my non-open orders' info. GetClosedOrders(market Market, target Pair, beginTime time.Time, endTime time.Time) ([]Order, error) // Get order info by id. GetOrder(id OrderId) (*Order, error) // Cancel unfinished order by id. CancelOrder(id OrderId) error }
Exchange interface
Click to show internal directories.
Click to hide internal directories.