The script defines the place where it has been dragged by the mouse and looks for the nearest bar. The process is based on the concept of bar boundaries:
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/16926
The semi-automated Expert Advisor using a trend line (TrendLIne).Simplest Hedging EA ever
Only for hedge accounts. Opening two opposite positions on a new bar.