//+------------------------------------------------------------------+
//|                                                         Test.mq5 |
//|                                  Copyright 2025, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2025, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   ::ChartSetInteger(0, CHART_EVENT_MOUSE_MOVE,   true);
   ::ChartSetInteger(0, CHART_EVENT_MOUSE_WHEEL,  true);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
datetime time = 0;
double   pric = 0;
void OnChartEvent(const int id, const long& lparam, const double& dparam, const string& sparam)
  {
   if(id == CHARTEVENT_MOUSE_MOVE)
     {
      XY_TP((int)lparam, (int)dparam, time, pric);

      ::Print(" ======================================================================== ");
     }

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnTimer()
  {

  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
  }
//+------------------------------------------------------------------+
bool XY_TP(const int aX, const int aY, datetime & aTime, double & aPrice)
  {
// ===
   int wind = 0;

   Print(" 1 Y " + aY + "  " + DoubleToString(aPrice, _Digits));

   aPrice = NormalizeDouble(aPrice, _Digits);

   Print(" 2 Y " + aY + "  " + DoubleToString(aPrice, _Digits));

   ::ChartXYToTimePrice(0, aX, aY, wind, aTime, aPrice); // < --- Бажит <<<<<<<<<<<<<<<<<<

   Print(" 3 Y " + aY + "  " + DoubleToString(aPrice, _Digits));

   aPrice = NormalizeDouble(aPrice, _Digits);

   Print(" 4 Y " + aY + "  " + DoubleToString(aPrice, _Digits));

   return(true);
// ===
  }
//+------------------------------------------------------------------+
