The article implements a MetaTrader 5 Expert Advisor that provides spread-only pre-trade estimates in points for a planned Buy or Sell. It compares a current-spread result with a historical scenario that uses the maximum of the live spread and a selected percentile from recent Bid/Ask ticks, and shows both on a collapsible panel. Manual market execution is available without SL/TP, with readiness checks kept separate from the estimates.
Before placing a planned Buy or Sell, how much of the expected favorable price move would remain after spread? The live Bid and Ask describe current entry conditions, but the estimate also depends on the spread assumed at exit.
In this article, we will build Trading Cost Planner, an MQL5 Expert Advisor for the chart's current symbol. It compares two spread-only estimates in points: one assumes the current spread at exit; the other uses the greater of the current spread and a percentile calculated from retrieved historical samples. Both estimates use the planned favorable movement of the midpoint between Bid and Ask. They are scenario calculations, not predictions of profit, and exclude commission, swap, and slippage.
Check out the new article: Measuring Spread Costs Before a Market Order in MQL5.
Before placing a planned Buy or Sell, how much of the expected favorable price move would remain after spread? The live Bid and Ask describe current entry conditions, but the estimate also depends on the spread assumed at exit.
In this article, we will build Trading Cost Planner, an MQL5 Expert Advisor for the chart's current symbol. It compares two spread-only estimates in points: one assumes the current spread at exit; the other uses the greater of the current spread and a percentile calculated from retrieved historical samples. Both estimates use the planned favorable movement of the midpoint between Bid and Ask. They are scenario calculations, not predictions of profit, and exclude commission, swap, and slippage.
Author: Chacha Ian Maroa