i try to create EA to draw manually trendlines between high and low prices from candles.
The coordinates comes from left mouse click.
How can i find the nearest candle-high or low, to snap the line on the candle?
Thanks for replys
ChartXYToTimePrice(0, int(lparam), int(dparam), w, time, price);
under the OnChartEvent, then search the nearest appearance of time in your copyrates-table. Result is your candle.