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:
romysaputrasihananda
2026-06-10 18:25:27 +07:00
parent 7d094591b8
commit 0583b6d0fb
+5 -4
View File
@@ -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,