mirror of
https://github.com/RomySaputraSihananda/ares.git
synced 2026-08-26 00:58:08 +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:
co-authored by
Claude Sonnet 4.6
parent
7d094591b8
commit
0583b6d0fb
@@ -68,13 +68,14 @@ impl TradeRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn cancel(symbol: impl Into<String>, ticket: u64) -> Self {
|
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 {
|
Self {
|
||||||
action: 8,
|
action: 8,
|
||||||
symbol: symbol.into(),
|
symbol: symbol.into(),
|
||||||
volume: None,
|
volume: Some(0.01),
|
||||||
order_type: None,
|
order_type: Some(0),
|
||||||
price: None,
|
price: Some(0.0),
|
||||||
sl: None,
|
sl: None,
|
||||||
tp: None,
|
tp: None,
|
||||||
magic: None,
|
magic: None,
|
||||||
|
|||||||
Reference in New Issue
Block a user