mt5-rs 0.1.1

A pure Rust library for MetaTrader 5 IPC communication (no Python dependency)
Documentation
#[derive(Debug, Clone)]
pub struct AccountInfo {
    pub login: i64,
    pub trade_mode: i64,
    pub leverage: i64,
    pub limit_orders: i64,
    pub margin_so_mode: i64,
    pub trade_allowed: bool,
    pub trade_expert: bool,
    pub margin_mode: i64,
    pub currency_digits: i64,
    pub fifo_close: bool,
    pub balance: f64,
    pub credit: f64,
    pub profit: f64,
    pub equity: f64,
    pub margin: f64,
    pub free_margin: f64,
    pub margin_level: f64,
    pub margin_so_call: f64,
    pub margin_so_so: f64,
    pub margin_initial: f64,
    pub margin_maintenance: f64,
    pub assets: f64,
    pub liabilities: f64,
    pub commission_blocked: f64,
    pub name: String,
    pub server: String,
    pub currency: String,
    pub company: String,
}

#[derive(Debug, Clone)]
pub struct TerminalInfo {
    pub community_account: bool,
    pub community_connection: bool,
    pub connected: bool,
    pub dlls_allowed: bool,
    pub trade_allowed: bool,
    pub trade_api_disabled: bool,
    pub email_enabled: bool,
    pub ftp_enabled: bool,
    pub notifications_enabled: bool,
    pub mqid: bool,
    pub build: i64,
    pub max_bars: i64,
    pub code_page: i64,
    pub ping_last: i64,
    pub community_balance: f64,
    pub retransmission: f64,
    pub company: String,
    pub name: String,
    pub language: String,
    pub path: String,
    pub data_path: String,
    pub common_data_path: String,
}

#[derive(Debug, Clone)]
pub struct VersionInfo {
    pub version: i32,
    pub build: i32,
    pub build_date: String,
}

#[derive(Debug, Clone)]
pub struct SymbolInfo {
    pub custom: bool,
    pub chart_mode: i64,
    pub select: bool,
    pub visible: bool,
    pub session_deals: i64,
    pub session_buy_orders: i64,
    pub session_sell_orders: i64,
    pub volume: i64,
    pub volume_high: i64,
    pub volume_low: i64,
    pub time: i64,
    pub digits: i64,
    pub spread: i64,
    pub spread_float: bool,
    pub ticks_book_depth: i64,
    pub trade_calc_mode: i64,
    pub trade_mode: i64,
    pub start_time: i64,
    pub expiration_time: i64,
    pub trade_stops_level: i64,
    pub trade_freeze_level: i64,
    pub trade_exe_mode: i64,
    pub swap_mode: i64,
    pub swap_rollover3days: i64,
    pub margin_hedged_use_leg: bool,
    pub expiration_mode: i64,
    pub filling_mode: i64,
    pub order_mode: i64,
    pub order_gtc_mode: i64,
    pub option_mode: i64,
    pub option_right: i64,
    pub bid: f64,
    pub bidhigh: f64,
    pub bidlow: f64,
    pub ask: f64,
    pub askhigh: f64,
    pub asklow: f64,
    pub last: f64,
    pub lasthigh: f64,
    pub lastlow: f64,
    pub volume_real: f64,
    pub volumehigh_real: f64,
    pub volumelow_real: f64,
    pub option_strike: f64,
    pub point: f64,
    pub trade_tick_value: f64,
    pub trade_tick_value_profit: f64,
    pub trade_tick_value_loss: f64,
    pub trade_tick_size: f64,
    pub trade_contract_size: f64,
    pub trade_accrued_interest: f64,
    pub trade_face_value: f64,
    pub trade_liquidity_rate: f64,
    pub volume_min: f64,
    pub volume_max: f64,
    pub volume_step: f64,
    pub volume_limit: f64,
    pub swap_long: f64,
    pub swap_short: f64,
    pub margin_initial: f64,
    pub margin_maintenance: f64,
    pub session_volume: f64,
    pub session_turnover: f64,
    pub session_interest: f64,
    pub session_buy_orders_volume: f64,
    pub session_sell_orders_volume: f64,
    pub session_open: f64,
    pub session_close: f64,
    pub session_aw: f64,
    pub session_price_settlement: f64,
    pub session_price_limit_min: f64,
    pub session_price_limit_max: f64,
    pub margin_hedged: f64,
    pub price_change: f64,
    pub price_volatility: f64,
    pub price_theoretical: f64,
    pub price_greeks_delta: f64,
    pub price_greeks_theta: f64,
    pub price_greeks_gamma: f64,
    pub price_greeks_vega: f64,
    pub price_greeks_rho: f64,
    pub price_greeks_omega: f64,
    pub price_sensitivity: f64,
    pub basis: String,
    pub category: String,
    pub currency_base: String,
    pub currency_profit: String,
    pub currency_margin: String,
    pub bank: String,
    pub description: String,
    pub exchange: String,
    pub formula: String,
    pub isin: String,
    pub name: String,
    pub page: String,
    pub path: String,
}

#[derive(Debug, Clone)]
pub struct Tick {
    pub time: i64,
    pub bid: f64,
    pub ask: f64,
    pub last: f64,
    pub volume: u64,
    pub time_msc: i64,
    pub flags: u32,
    pub volume_real: f64,
}

#[derive(Debug, Clone)]
pub struct Rate {
    pub time: i64,
    pub open: f64,
    pub high: f64,
    pub low: f64,
    pub close: f64,
    pub tick_volume: u64,
    pub spread: i32,
    pub real_volume: u64,
}

#[derive(Debug, Clone)]
pub struct TradePosition {
    pub ticket: i64,
    pub time: i64,
    pub time_msc: i64,
    pub time_update: i64,
    pub time_update_msc: i64,
    pub r#type: i32,
    pub magic: i64,
    pub identifier: i64,
    pub reason: i32,
    pub volume: f64,
    pub price_open: f64,
    pub price_current: f64,
    pub price_sl: f64,
    pub price_tp: f64,
    pub swap: f64,
    pub profit: f64,
    pub symbol: String,
    pub comment: String,
    pub external_id: String,
}

#[derive(Debug, Clone)]
pub struct TradeOrder {
    pub ticket: i64,
    pub time_setup: i64,
    pub time_setup_msc: i64,
    pub time_done: i64,
    pub time_done_msc: i64,
    pub time_expiration: i64,
    pub r#type: i32,
    pub type_time: i32,
    pub type_filling: i32,
    pub state: i32,
    pub magic: i64,
    pub position_id: i64,
    pub position_by_id: i64,
    pub reason: i32,
    pub volume_initial: f64,
    pub volume_current: f64,
    pub price_open: f64,
    pub price_current: f64,
    pub price_sl: f64,
    pub price_tp: f64,
    pub price_stoplimit: f64,
    pub symbol: String,
    pub comment: String,
    pub external_id: String,
}

#[derive(Debug, Clone)]
pub struct TradeDeal {
    pub ticket: i64,
    pub order: i64,
    pub time: i64,
    pub time_msc: i64,
    pub r#type: i32,
    pub entry: i32,
    pub magic: i64,
    pub position_id: i64,
    pub reason: i32,
    pub volume: f64,
    pub price: f64,
    pub commission: f64,
    pub swap: f64,
    pub profit: f64,
    pub fee: f64,
    pub symbol: String,
    pub comment: String,
    pub external_id: String,
}

#[derive(Debug, Clone)]
pub struct BookInfo {
    pub r#type: i64,
    pub price: f64,
    pub volume: i64,
    pub volume_real: f64,
}