You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Trade Duration vs Profitability Scatter Plot Indicator in MQL5.
The article presents a compact dashboard that relates trade duration to net profit using MQL5 and CCanvas. It pulls closed deals, derives duration in minutes, and renders a log‑scaled scatter by symbol, with an overlaid least‑squares line and R². A bucketed duration view identifies which hold‑time range produced the highest average result, helping assess exit timing.
Every trader who has tried to tighten up their exits has asked the same question: does holding a trade longer actually help, or is it just adding risk without adding return? Aggregate statistics like win rate cannot answer this. A strategy can have a solid win rate at every hold time, yet its profitable trades may cluster in one duration range while its losing trades cluster in another. That relationship is account- and strategy-specific. MQL5 has no built-in tool that visualizes it.
This article builds a script that extracts every closed deal, computes each trade's hold duration (minutes) and net profit, and plots them on a CCanvas scatter plot. Each trade is shown as one dot, colored by symbol. A linear regression line overlaid on the scatter reveals the overall trend, and a duration-bucket analysis identifies which range of hold times has produced the best average result. Two short theory sections along the way explain the math doing the actual work: least-squares regression with its R², and why the chart's duration axis is scaled logarithmically rather than linearly.
Author: Ushana Kevin Iorkumbul