Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/futures/account.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::collections::BTreeMap;
use std::fmt::Display;


use crate::util::{build_signed_request, uuid_futures};
use crate::errors::Result;
use crate::client::Client;
Expand Down Expand Up @@ -248,6 +247,7 @@ impl FuturesAccount {
pub fn limit_buy(
&self, symbol: impl Into<String>, qty: impl Into<f64>, price: f64,
time_in_force: TimeInForce,
reduce_only : Option<bool>,
) -> Result<Transaction> {
Comment thread
DevWonder01 marked this conversation as resolved.
Comment thread
DevWonder01 marked this conversation as resolved.
let buy = OrderRequest {
symbol: symbol.into(),
Expand All @@ -256,7 +256,7 @@ impl FuturesAccount {
order_type: OrderType::Limit,
time_in_force: Some(time_in_force),
qty: Some(qty.into()),
reduce_only: None,
reduce_only: reduce_only,
price: Some(price),
stop_price: None,
close_position: None,
Expand All @@ -278,6 +278,7 @@ impl FuturesAccount {
pub fn limit_sell(
&self, symbol: impl Into<String>, qty: impl Into<f64>, price: f64,
time_in_force: TimeInForce,
reduce_only : Option<bool>
) -> Result<Transaction> {
Comment thread
DevWonder01 marked this conversation as resolved.
let sell = OrderRequest {
symbol: symbol.into(),
Expand All @@ -286,7 +287,7 @@ impl FuturesAccount {
order_type: OrderType::Limit,
time_in_force: Some(time_in_force),
qty: Some(qty.into()),
reduce_only: None,
reduce_only: reduce_only,
price: Some(price),
stop_price: None,
close_position: None,
Expand Down Expand Up @@ -613,7 +614,7 @@ impl FuturesAccount {
if let Some(API::Futures(Futures::AlgoOrder)) = api_type {
parameters.insert("algoType".into(), "Conditional".into());
parameters.insert("clientAlgoId".into(), "Conditional".into());

if let Some(client_algo_id) = order.client_algo_id {
parameters.insert("clientAlgoId".into(), client_algo_id.to_string());
}
Expand Down
Loading