mirror of
https://github.com/RomySaputraSihananda/ares.git
synced 2026-08-09 08:57:47 +00:00
fix(client): send required dummy fields in cancel() for bridge compat
Bridge schema requires volume/type/price even for TRADE_ACTION_REMOVE. MT5 ignores these fields when action=8; send minimal valid values. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -68,13 +68,14 @@ impl TradeRequest {
|
||||
}
|
||||
|
||||
pub fn cancel(symbol: impl Into<String>, ticket: u64) -> Self {
|
||||
// TRADE_ACTION_REMOVE = 8
|
||||
// TRADE_ACTION_REMOVE = 8 — bridge requires volume/type/price even though
|
||||
// MT5 ignores them for remove actions; send minimal valid values.
|
||||
Self {
|
||||
action: 8,
|
||||
symbol: symbol.into(),
|
||||
volume: None,
|
||||
order_type: None,
|
||||
price: None,
|
||||
volume: Some(0.01),
|
||||
order_type: Some(0),
|
||||
price: Some(0.0),
|
||||
sl: None,
|
||||
tp: None,
|
||||
magic: None,
|
||||
|
||||
Reference in New Issue
Block a user