pub struct Mt5Client { /* private fields */ }Implementations§
Source§impl Mt5Client
impl Mt5Client
pub fn new() -> Self
pub fn initialize(&mut self, pipe_name: Option<&str>) -> Result<()>
pub fn shutdown(&mut self)
pub fn login(&self, login: i64, password: &str, server: &str) -> Result<()>
pub fn account_info(&self) -> Result<AccountInfo>
pub fn terminal_info(&self) -> Result<TerminalInfo>
pub fn version(&self) -> Result<VersionInfo>
pub fn symbols_total(&self) -> Result<i64>
pub fn symbols_get(&self) -> Result<Vec<SymbolInfo>>
pub fn symbol_info(&self, symbol: &str) -> Result<Option<SymbolInfo>>
pub fn symbol_info_tick(&self, symbol: &str) -> Result<Option<Tick>>
pub fn symbol_select(&self, symbol: &str, enable: bool) -> Result<bool>
pub fn positions_total(&self) -> Result<i64>
pub fn orders_total(&self) -> Result<i64>
pub fn positions_get(&self, symbol: Option<&str>) -> Result<Vec<TradePosition>>
pub fn orders_get(&self, symbol: Option<&str>) -> Result<Vec<TradeOrder>>
pub fn send_raw_command(&self, cmd: u32, data: &[u8]) -> Result<Vec<u8>>
pub fn copy_rates_from_pos( &self, symbol: &str, timeframe: i32, start_pos: i64, count: i32, ) -> Result<Vec<Rate>>
pub fn copy_rates_from( &self, symbol: &str, timeframe: i32, date_from: i64, count: i32, ) -> Result<Vec<Rate>>
pub fn copy_rates_range( &self, symbol: &str, timeframe: i32, date_from: i64, date_to: i64, ) -> Result<Vec<Rate>>
pub fn copy_ticks_from( &self, symbol: &str, from: i64, count: i32, flags: i32, ) -> Result<Vec<Tick>>
pub fn copy_ticks_range( &self, symbol: &str, from: i64, to: i64, flags: i32, ) -> Result<Vec<Tick>>
pub fn history_deals_total(&self, from: i64, to: i64) -> Result<i64>
pub fn history_deals_get(&self, from: i64, to: i64) -> Result<Vec<TradeDeal>>
pub fn history_orders_total(&self, from: i64, to: i64) -> Result<i64>
pub fn history_orders_get(&self, from: i64, to: i64) -> Result<Vec<TradeOrder>>
pub fn market_book_add(&self, symbol: &str) -> Result<bool>
pub fn market_book_get(&self, symbol: &str) -> Result<Vec<BookInfo>>
pub fn market_book_release(&self, symbol: &str) -> Result<bool>
Sourcepub fn order_calc_margin(
&self,
_action: i32,
symbol: &str,
volume: f64,
price: f64,
) -> Result<f64>
pub fn order_calc_margin( &self, _action: i32, symbol: &str, volume: f64, price: f64, ) -> Result<f64>
计算订单所需保证金(本地计算,不使用IPC) 根据Python测试验证的公式:margin = volume × price × margin_initial / 4
Sourcepub fn order_calc_profit(
&self,
_action: i32,
symbol: &str,
volume: f64,
price_open: f64,
price_close: f64,
) -> Result<f64>
pub fn order_calc_profit( &self, _action: i32, symbol: &str, volume: f64, price_open: f64, price_close: f64, ) -> Result<f64>
计算订单预期利润(本地计算,不使用IPC) 公式:profit = volume × (price_close - price_open) × contract_size
pub fn last_error(&self) -> Result<(i32, String)>
Auto Trait Implementations§
impl Freeze for Mt5Client
impl RefUnwindSafe for Mt5Client
impl Send for Mt5Client
impl !Sync for Mt5Client
impl Unpin for Mt5Client
impl UnsafeUnpin for Mt5Client
impl UnwindSafe for Mt5Client
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