pub struct TradingClient { /* private fields */ }Implementations§
Source§impl TradingClient
impl TradingClient
pub fn new( base_url: String, api_key: SensitiveString, api_secret: SensitiveString, ) -> Self
Source§impl TradingClient
impl TradingClient
Sourcepub async fn new_order(
&self,
params: NewOrderParams,
) -> Result<Response<NewOrderResponse>, Error>
pub async fn new_order( &self, params: NewOrderParams, ) -> Result<Response<NewOrderResponse>, Error>
Send in a new order. This adds 1 order to the EXCHANGE_MAX_ORDERS filter and the MAX_NUM_ORDERS filter.
Other info: Any LIMIT or LIMIT_MAKER type order can be made an iceberg order by sending an icebergQty. Any order with an icebergQty MUST have timeInForce set to GTC. For STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT_LIMIT and TAKE_PROFIT orders, trailingDelta can be combined with stopPrice. MARKET orders using quoteOrderQty will not break LOT_SIZE filter rules; the order will execute a quantity that will have the notional value as close as possible to quoteOrderQty. Trigger order price rules against market price for both MARKET and LIMIT versions: Price above market price: STOP_LOSS BUY, TAKE_PROFIT SELL Price below market price: STOP_LOSS SELL, TAKE_PROFIT BUY
Sourcepub async fn test_new_order(
&self,
params: NewOrderParams,
compute_commission_rates: bool,
) -> Result<Response<TestCommissionRates>, Error>
pub async fn test_new_order( &self, params: NewOrderParams, compute_commission_rates: bool, ) -> Result<Response<TestCommissionRates>, Error>
Test new order creation and signature/recvWindow long. Creates and validates a new order but does not send it into the matching engine.