optimization
Skill17 starsChanged 7 months agoMITView on GitHub
Run MetaTrader 5 parameter optimizations in this workspace and summarize real results from exported optimization reports. Use when Codex needs to optimize EA inputs such as SL, TP, RSI values, or other inputs for experts under MQL5\Experts, by generating a tester .ini with [TesterInputs], launching MT5 from the terminal, and reading the resulting XML ranking.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- phatnguyen03022001/agent-skillstheir own version, first seen Aug 24, 2026
- ffsshhttiikk/opencode-agents-skillstheir own version, first seen Feb 28, 2026
- DonggangChen/antigravity-agentic-skillstheir own version, first seen Jan 7, 2026
- vuralserhat86/antigravity-agentic-skillstheir own version, first seen Jan 3, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- vuralserhat86/antigravity-agentic-skills★ 42same name
- DonggangChen/antigravity-agentic-skills★ 2same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- phatnguyen03022001/agent-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- analyzeSkill
- candles-and-seriesSkill
- captions-davinciSkill
- compile-mql5Skill
- edit-davinciSkill
- expert-advisorsSkill
- forgeSkill
- gitSkill
- interfaceSkill
- orquestateSkill
- paint-objectsSkill
- run-backtestsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. 0 are common, 13 are distinctive, and 10 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
13
Distinctive
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill for MT5 strategy optimizations in this workspace.
- Distinctive: line 17
Ask for these fields in this order unless the user has already specified them clearly:
- Distinctive: line 28
Ask which input parameters will be optimized and the exact ranges.
- Very specific: line 29
Create or update a tester .ini under MQL5\config\.
- Very specific: line 30
Put the optimization ranges inside a [TesterInputs] section in that .ini.
- Very specific: line 31
Create MQL5\backtest\reports\ if missing.
- Distinctive: line 32
If MT5 is already running, close it before launch.
- Distinctive: line 34
Read terminal and tester logs to confirm the optimization really started and finished.
- Distinctive: line 35
Read the exported optimization XML and summarize the best passes.
- Very specific: line 41
Do not rely on ExpertParameters=...set for optimization ranges here.
- Distinctive: line 85
Use MT5 optimization format:
- Very specific: line 92
Use Y only for parameters being optimized.
- Very specific: line 93
Use N for fixed parameters.
- Distinctive: line 94
Keep the current value equal to the chosen start value unless there is a reason not to.
- Very specific: line 106
Write Expert= relative to MQL5\Experts\.
- Very specific: line 107
Write the tester .ini under MQL5\config\.
- Distinctive: line 113
Use this command pattern:
- Distinctive: line 119
Before launching, close any existing MT5 process.
- Distinctive: line 123
Read these logs after launch:
- Distinctive: line 128
Treat these tester log lines as authoritative:
- Very specific: line 134
If the optimization did not start, inspect the .ini and especially [TesterInputs] before retrying.
- Distinctive: line 140
Read that XML and extract at least:
- Very specific: line 147
All optimized input columns, such as InpStopLossPoints and InpTakeProfitPoints
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Optimization
Overview
Use this skill for MT5 strategy optimizations in this workspace.
Confirm the optimization setup, write a tester .ini under MQL5\config\, place the parameter ranges in [TesterInputs], close any running MT5 instance, launch terminal64.exe with /config:..., and summarize the actual ranking from the exported XML report.
Required workflow
- Confirm the test configuration before launching.
- Ask for these fields in this order unless the user has already specified them clearly:
- Expert or strategy file
- Symbol
- Timeframe
- Date range
- Deposit
- Deposit currency
- Leverage
- Tick model
- Optimization on or off
- Visualization on or off
- Ask which input parameters will be optimized and the exact ranges.
- Create or update a tester
.iniunderMQL5\config\. - Put the optimization ranges inside a
[TesterInputs]section in that.ini. - Create
MQL5\backtest\reports\if missing. - If MT5 is already running, close it before launch.
- Launch MT5 with the generated
.ini. - Read terminal and tester logs to confirm the optimization really started and finished.
- Read the exported optimization XML and summarize the best passes.
Critical local rule
In this workspace, command-line optimization works when the parameter ranges are defined in [TesterInputs] inside the tester .ini.
Do not rely on ExpertParameters=...set for optimization ranges here. That produced the tester error:
no optimized parameter selected, please check input(s) to be optimized and set start, step and stop values
Tester ini pattern
Use this structure:
[Tester]
Expert=codex\RSICrossTrader.ex5
Symbol=GBPUSD
Period=M15
Model=4
Optimization=1
FromDate=2026.02.28
ToDate=2026.03.28
ForwardMode=0
Deposit=100000
Currency=USD
Leverage=1:100
ExecutionMode=0
OptimizationCriterion=0
Visual=0
Report=MQL5\backtest\reports\report_name
ReplaceReport=1
ShutdownTerminal=1
UseLocal=1
UseRemote=0
UseCloud=0
[TesterInputs]
InpRSIPeriod=4||4||1||4||N
InpRSIPrice=1||1||0||7||N
InpBuyLevel=30.0||30.0||3.000000||300.000000||N
InpSellLevel=70.0||70.0||7.000000||700.000000||N
InpLots=0.01||0.01||0.001000||0.100000||N
InpStopLossPoints=100||100||10||120||Y
InpTakeProfitPoints=100||100||10||120||Y
InpMagicNumber=20260328||20260328||1||202603280||N
InpOnePositionPerSymbol=true||false||0||true||NInput range format
Use MT5 optimization format:
ParameterName=current||start||step||stop||selectedRules:
- Use
Yonly for parameters being optimized. - Use
Nfor fixed parameters. - Keep the current value equal to the chosen start value unless there is a reason not to.
- Preserve the parameter names exactly as declared in the EA inputs.
Example:
InpStopLossPoints=100||100||10||120||Y
InpTakeProfitPoints=100||100||10||120||YPath rules
- Write
Expert=relative toMQL5\Experts\. Usecodex\RSICrossTrader.ex5, notExperts\codex\RSICrossTrader.ex5. - Write the tester
.iniunderMQL5\config\. - Export reports to
MQL5\backtest\reports\report_name. - Optimization exports a readable XML workbook. Use that XML as the primary source.
Launch command
Use this command pattern:
Start-Process -FilePath 'C:\Program Files\MetaTrader 5\terminal64.exe' -ArgumentList '/config:C:\Users\<user-id>\AppData\Roaming\MetaQuotes\Terminal\<terminal-id>\MQL5\config\your-optimization.ini' -WaitBefore launching, close any existing MT5 process. Otherwise the tester may not run.
Validation
Read these logs after launch:
Terminal\...\logs\YYYYMMDD.logTerminal\...\tester\logs\YYYYMMDD.log
Treat these tester log lines as authoritative:
- Start confirmed:
complete optimization started - Success confirmed:
optimization finished, total passes N - Broken config:
no optimized parameter selected
If the optimization did not start, inspect the .ini and especially [TesterInputs] before retrying.
Reading the report
Optimization results are exported as an XML workbook under MQL5\backtest\reports\.
Read that XML and extract at least:
- Pass
- Result
- Profit
- Profit Factor
- Equity DD %
- Trades
- All optimized input columns, such as
InpStopLossPointsandInpTakeProfitPoints
Summarize:
- The best combination
- The top ranking passes
- The report path used
- Whether the optimization finished successfully
Example from this workspace
This exact optimization was validated successfully:
- Expert:
codex\RSICrossTrader.ex5 - Symbol:
GBPUSD - Period:
M15 - Dates:
2026.02.28to2026.03.28 - Model: real ticks (
Model=4) - Optimization: on
- Visual: off
- Optimized params:
InpStopLossPoints=100||100||10||120||YInpTakeProfitPoints=100||100||10||120||Y
It completed with 9 passes and produced:
MQL5\backtest\reports\codex_rsicrosstrader_gbpusd_lastmonth_opt_sltp_100_120.xml
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

