pub struct GridContext(/* private fields */);Expand description
Grid trading management context.
Implementations§
Source§impl GridContext
impl GridContext
Sourcepub fn new(config: Arc<Config>) -> Self
pub fn new(config: Arc<Config>) -> Self
Create a GridContext
Sourcepub fn log_subscriber(&self) -> Arc<dyn Subscriber + Send + Sync>
pub fn log_subscriber(&self) -> Arc<dyn Subscriber + Send + Sync>
Returns the log subscriber
Sourcepub async fn submit(
&self,
options: SubmitGridOrderOptions,
) -> Result<SubmitGridOrderResponse>
pub async fn submit( &self, options: SubmitGridOrderOptions, ) -> Result<SubmitGridOrderResponse>
Submit a grid trading order
Sourcepub async fn replace(&self, options: ReplaceGridOrderOptions) -> Result<()>
pub async fn replace(&self, options: ReplaceGridOrderOptions) -> Result<()>
Replace (modify) a grid trading order
Sourcepub async fn list(
&self,
options: impl Into<Option<GetGridOrdersOptions>>,
) -> Result<GridOrdersResponse>
pub async fn list( &self, options: impl Into<Option<GetGridOrdersOptions>>, ) -> Result<GridOrdersResponse>
Get grid trading orders (paged list)
Sourcepub async fn list_by_ids(
&self,
options: GetGridOrdersByIdsOptions,
) -> Result<Vec<GridOrder>>
pub async fn list_by_ids( &self, options: GetGridOrdersByIdsOptions, ) -> Result<Vec<GridOrder>>
Query grid trading orders by IDs
Sourcepub async fn detail(
&self,
options: GetGridOrderDetailOptions,
) -> Result<GridOrderDetail>
pub async fn detail( &self, options: GetGridOrderDetailOptions, ) -> Result<GridOrderDetail>
Get grid trading order detail (and paged history)
Sourcepub async fn trigger_history(
&self,
options: GetGridTriggerHistoryOptions,
) -> Result<GridTriggerHistoryResponse>
pub async fn trigger_history( &self, options: GetGridTriggerHistoryOptions, ) -> Result<GridTriggerHistoryResponse>
Get grid trading trigger history
Sourcepub async fn cancel(&self, order_id: impl Into<String>) -> Result<()>
pub async fn cancel(&self, order_id: impl Into<String>) -> Result<()>
Cancel a grid trading order
Sourcepub async fn suspend(&self, order_id: impl Into<String>) -> Result<()>
pub async fn suspend(&self, order_id: impl Into<String>) -> Result<()>
Suspend a grid trading order
Sourcepub async fn restart(&self, order_id: impl Into<String>) -> Result<()>
pub async fn restart(&self, order_id: impl Into<String>) -> Result<()>
Restart a grid trading order
Sourcepub async fn symbol_info(
&self,
symbol: impl Into<String>,
) -> Result<GridSymbolInfo>
pub async fn symbol_info( &self, symbol: impl Into<String>, ) -> Result<GridSymbolInfo>
Get the security (symbol) info used to build a grid order (lot size, authorization flag, settlement currency, etc.).
Trait Implementations§
Source§impl Clone for GridContext
impl Clone for GridContext
Source§fn clone(&self) -> GridContext
fn clone(&self) -> GridContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for GridContext
impl !UnwindSafe for GridContext
impl Freeze for GridContext
impl Send for GridContext
impl Sync for GridContext
impl Unpin for GridContext
impl UnsafeUnpin for GridContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more