Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
if the ssd were the bottleneck; both the ssd and cpu would be 100% all the time.
However, if your ssd is less than 40% health, then, that could cause a low ssd usage % AND cause the cpu issue you describe. Check your ssd health. ssds, do not like read/writes by optimizer. optimizer wears out all flavours of ssds, nvme, and 7.5" satas.
EDIT try increasing the size of your virtual memory or page file.Many low end SSDs (and some good but older SSDs), don't have a parallel TRIM functionality.
So, every time Windows requests a TRIM (due to large files being deleted, by MetaTrader), the SSD stops all other activity to to carry out the TRIM. You can see this when the drive is at 100% but barely any throughput is taking place.
To improve things, disable the auto-TRIM feature during optimisations, and enable it again after you finished. Unfortunately MetaTrader 5 is not SSD friendly at all, and keeps creating and deleting very large files. It does not cache very well either as is not very efficient in my view.
To disable auto-TRIM, use the following at the Windows command prompt.
To enable it again, use the following ...fsutil behavior set DisableDeleteNotify 1
fsutil behavior set DisableDeleteNotify 0
To query the current state ...
fsutil behavior query DisableDeleteNotify
Please note, that the drive may still TRIM ocassionaliy based on its own internal states, but it will be less often then with the Windows auto-TRIM enabled.
ENGLISH: I have a problem when trying to optimize. Before everything worked fine, but for a few weeks now, when I try to optimize an EA (my own) my PC freezes, the optimization does not continue (or takes a long time to advance because the CPU stops being used) and it is unusable (I am not interested in using it while I optimize but before at least I could open programs while I optimize and now moving the mouse is almost impossible).
I am going to write what happens in the Task Manager. (FILE ATTACHED)
Task Manager (When I start an optimization):
- CPU 100%
- RAM 100%
- SSD 20%
Task Manager (15 seconds after the optimization started):
(Here is when the PC Stops being usable)
- CPU: 5%
- RAM 100%
- SSD 100%
And it stays like that for a long time. Occasionally SSD usage drops (about 20% for about 5 seconds) and CPU usage goes up to 100%, but that doesn't last long and is when the result of an optimization pass has been made.
My conclusion: My RAM is filling up and swapping with my SSD. My SSD being slower makes the CPU have to "wait" and that's why the CPU is hardly used, when really an optimization should use the CPU much more than anything else.
Is there a solution to this? I leave the components of my PC here below:
- Motherboard: MSI B650 GAMING PLUS WIFI
- CPU: AMD Ryzen 5 7600X 4.7 GHz Fanless Box
- GPU: Sapphire PULSE AMD Radeon RX 6600 8GB GDDR6
- SSD: Kingston NV2 1TB Hard Drive SSD 3500MB / S NVMe PCIe 4.0 M.2 Gen4
- RAM: Kingston FURY Beast DDR5 5600MHz 32GB 2x16GB CL36
- Power Supply: Corsair CX750 750 W 80 Plus Bronze
- CPU Fan: Be Quiet! Dark Rock 5 CPU Fan 6 Pipes 120mm Black
- Cabinet: MSI MAG FORGE 120A AIRFLOW Tempered Glass USB 3.2
Many low end SSDs (and some good but older SSDs), don't have a parallel TRIM functionality.
So, every time Windows requests a TRIM (due to large files being deleted, by MetaTrader), the SSD stops all other activity to to carry out the TRIM. You can see this when the drive is at 100% but barely any throughput is taking place.
To improve things, disable the auto-TRIM feature during optimisations, and enable it again after you finished. Unfortunately MetaTrader 5 is not SSD friendly at all, and keeps creating and deleting very large files. It does not cache very well either as is not very efficient in my view.
To disable auto-TRIM, use the following at the Windows command prompt.
To enable it again, use the following ...To query the current state ...
Please note, that the drive may still TRIM ocassionaliy based on its own internal states, but it will be less often then with the Windows auto-TRIM enabled.
Thanks for the comment Fernando, it's appreciated. However it didn't have any effect on the usage of the disk or CPU.
I bought a new SSD (Samsung 990 Pro) to see if that was really the problem, and that had a little effect, now the CPU usage it's around 20% to 40% instead of 0% while the disk is still on 100% (all of this when optimizing). It's not ideal, and not what I expected having this PC honestly.
An important note, after the first generation on parameters (the first results) the optimization seems to not advance and starts giving me this error every once in a while in the log: Core 04 - genetic pass (0, 77) tested with error "no memory for ticks generating (tick events error)" in 0:03:33.202
Do you have any other recommendation? I would love to know what is needed to optimize in MT5 without these issues.
For the moment I'm trying a different MT5 Terminal, one from a broker. I will let a comment if I see this works.
Way too many agents running in parallel. Decrease number of tasks running simultaneously until you RAM usage drops below 80% of usage, measured during the test, not before.
If you want to run more agents (because you have CPU cores available), install more RAM.
Way too many agents running in parallel. Decrease number of tasks running simultaneously until you RAM usage drops below 80% of usage, measured during the test, not before.
If you want to run more agents (because you have CPU cores available), install more RAM.
I did it, tried 1 agent, 2 agents, every agent... With 1 agent my Memory (RAM) was in 30% usage, CPU: 20% Disk (SSD): 2%.
But I keep having the same issue, after the first generation of results, the optimization doesnt advance (even waiting hours and hours) and the error "no memory for ticks generating (ticks events error)" is still there.
It's not looking like a Hardware issue.
NEW IMPORTANT INFORMATION
I bought a better SSD (Samsung 990 Pro 2TB) - The difference is that now the CPU doesn't go to 0% when the SSD is working, but the optimization is still not progressing.
ERROR FOUND: While optimizing, after the first generation of results is generated, in the Log says "Core 01 - no memory for ticks generating (tick events error)"
I tried less agents and the RAM is not filling to 100%, but the issue and error is still there.. Not looking like a hardware issue anymore?
Let me know if you have any ideas! Thanks

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
ENGLISH: I have a problem when trying to optimize. Before everything worked fine, but for a few weeks now, when I try to optimize an EA (my own) my PC freezes, the optimization does not continue (or takes a long time to advance because the CPU stops being used) and it is unusable (I am not interested in using it while I optimize but before at least I could open programs while I optimize and now moving the mouse is almost impossible).
I am going to write what happens in the Task Manager. (FILE ATTACHED)
Task Manager (When I start an optimization):
Task Manager (15 seconds after the optimization started):
(Here is when the PC Stops being usable)
And it stays like that for a long time. Occasionally SSD usage drops (about 20% for about 5 seconds) and CPU usage goes up to 100%, but that doesn't last long and is when the result of an optimization pass has been made.
My conclusion: My RAM is filling up and swapping with my SSD. My SSD being slower makes the CPU have to "wait" and that's why the CPU is hardly used, when really an optimization should use the CPU much more than anything else.
Is there a solution to this? I leave the components of my PC here below: