Skip to content
All library documents

Calculating the Intersection of Two Chart Lines in MQL4

Article MQL5 code base

Summary

The document explains how to find where two straight lines cross on a MetaTrader 4 chart. It maps chart time to the horizontal coordinate and price to the vertical coordinate, then represents each line using either two known points or one point and its slope. Solving the resulting pair of line equations yields the intersection’s time and price coordinates.

The article says the calculation can be implemented with a small amount of MQL4 code and mentions that a source file accompanies the explanation. It gives no worked numerical example, code details, validation, or trading results. The technique is a geometric utility for chart objects; by itself, it does not define a trading signal or establish that line intersections predict market movements. The document also appears to have been machine translated, so some wording is unclear.

Key ideas

  • Represent each chart line with two points or with a point and its slope.
  • Treat chart time as the horizontal coordinate and price as the vertical coordinate.
  • Solve the two line equations together to calculate the crossing coordinates.
  • The described calculation is a charting utility, not a tested trading strategy.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.