Files
mt5-quant/src/tools/definitions/experts.rs
T
Devid HW d41c51bae4 feat: add get_active_account and 8 new utility tools
High Priority Tools:
- check_symbol_data_status: validate symbol history data availability
- get_backtest_history: list all backtest results for EA/symbol
- compare_backtests: side-by-side comparison of multiple backtests

Medium Priority Tools:
- init_project: scaffold new MQL5 project with templates (scalper/swing/grid)
- validate_ea_syntax: pre-compile syntax checking
- check_mt5_status: check MT5 terminal readiness

Low Priority Tools:
- create_set_template: generate .set files from EA inputs
- export_report: export reports to CSV/JSON/Markdown

Other Changes:
- Consolidate config into src/models/config.rs, delete src/config.rs
- Add CurrentAccount with UTF-16LE parsing for common.ini
- Add BacktestPreflight struct for pre-flight checks
- Update backtest handler with active account context
- Update list_symbols to filter by active server

Total tools: 57
2026-04-19 08:11:17 +07:00

154 lines
5.0 KiB
Rust

use serde_json::{json, Value};
pub fn tool_compile_ea() -> Value {
json!({
"name": "compile_ea",
"description": "Compile an MQL5 Expert Advisor via MetaEditor. Provide either 'expert' (EA name, searches project and MT5 Experts dirs) or 'expert_path' (full path to .mq5 file).",
"inputSchema": {
"type": "object",
"properties": {
"expert": { "type": "string", "description": "EA name without extension (e.g. 'DPS21')" },
"expert_path": { "type": "string", "description": "Full path to the .mq5 source file" }
}
}
})
}
pub fn tool_list_experts() -> Value {
json!({
"name": "list_experts",
"description": "List all compiled Expert Advisors",
"inputSchema": {
"type": "object",
"properties": {
"filter": { "type": "string" }
}
}
})
}
pub fn tool_list_indicators() -> Value {
json!({
"name": "list_indicators",
"description": "List all custom indicators in MQL5/Indicators",
"inputSchema": {
"type": "object",
"properties": {
"filter": { "type": "string", "description": "Optional name filter pattern" },
"include_builtin": { "type": "boolean", "description": "Include built-in MT5 indicators", "default": false }
}
}
})
}
pub fn tool_list_scripts() -> Value {
json!({
"name": "list_scripts",
"description": "List all scripts in MQL5/Scripts",
"inputSchema": {
"type": "object",
"properties": {
"filter": { "type": "string", "description": "Optional name filter pattern" }
}
}
})
}
pub fn tool_search_experts() -> Value {
json!({
"name": "search_experts",
"description": "Search for Expert Advisors by name pattern across MT5 Experts directory and subdirectories",
"inputSchema": {
"type": "object",
"properties": {
"pattern": {
"type": "string",
"description": "Search pattern (case-insensitive substring match)"
}
},
"required": ["pattern"]
}
})
}
pub fn tool_search_indicators() -> Value {
json!({
"name": "search_indicators",
"description": "Search for indicators by name pattern across MT5 directories and subdirectories",
"inputSchema": {
"type": "object",
"properties": {
"pattern": {
"type": "string",
"description": "Search pattern (case-insensitive substring match)"
},
"include_builtin": {
"type": "boolean",
"description": "Include built-in MT5 indicators in search",
"default": false
}
},
"required": ["pattern"]
}
})
}
pub fn tool_search_scripts() -> Value {
json!({
"name": "search_scripts",
"description": "Search for scripts by name pattern across MT5 Scripts directory and subdirectories",
"inputSchema": {
"type": "object",
"properties": {
"pattern": {
"type": "string",
"description": "Search pattern (case-insensitive substring match)"
}
},
"required": ["pattern"]
}
})
}
pub fn tool_copy_indicator_to_project() -> Value {
json!({
"name": "copy_indicator_to_project",
"description": "Copy an indicator file from MT5 Indicators directory to the project directory",
"inputSchema": {
"type": "object",
"properties": {
"source_path": {
"type": "string",
"description": "Full source path to the indicator file (.mq5 or .ex5)"
},
"target_name": {
"type": "string",
"description": "Optional: Rename the file (without extension). If not provided, uses original name"
}
},
"required": ["source_path"]
}
})
}
pub fn tool_copy_script_to_project() -> Value {
json!({
"name": "copy_script_to_project",
"description": "Copy a script file from MT5 Scripts directory to the project directory",
"inputSchema": {
"type": "object",
"properties": {
"source_path": {
"type": "string",
"description": "Full source path to the script file (.mq5 or .ex5)"
},
"target_name": {
"type": "string",
"description": "Optional: Rename the file (without extension). If not provided, uses original name"
}
},
"required": ["source_path"]
}
})
}