Skip to main content

sell

掛一筆賣出訂單,每個週期最多可掛 500 筆。

Input#

exchange: string;
pair: string;
amount: number;
type: OrderType;
price: number;

查看 OrderType

範例#

掛一筆數量為賣出 0.999 的訂單市價單,市價單可不用設定 price。

exchange, pair, target, base = CA.get_exchange_pair()
CA.sell(exchange, pair, 0.999, CA.OrderType.MARKET)

掛一筆數量為賣出 0.999 的訂單限價單,價格為 close_price。

exchange, pair, target, base = CA.get_exchange_pair()
close_price = candles[exchange][pair][0]['close']
CA.sell(exchange, pair, 0.999, CA.OrderType.LIMIT, close_price)