//+------------------------------------------------------------------+ //| ClickerBO.mq5 | //| Copyright 2022, Alexey Vochanskiy | //| https://www.mql5.com/ru/users/vdev | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ #property strict #define AU3_INTDEFAULT (-2147483647) // "Default" value for _some_ int parameters (largest negative number) struct PointXY { int x; int y; }; #import "AutoItX3_x64.dll " int AU3_PixelGetColor(int nX, int nY); void AU3_MouseGetPos(PointXY &lpPoint); // int AU3_MouseClick(/*[in,defaultvalue("LEFT")]*/LPCWSTR szButton, int nX = AU3_INTDEFAULT, int nY = AU3_INTDEFAULT, int nClicks = 1, int nSpeed = -1); int AU3_MouseClick(/*[in,defaultvalue("LEFT")]*/string szButton = "LEFT", int nX = AU3_INTDEFAULT, int nY = AU3_INTDEFAULT, int nClicks = 1, int nSpeed = 0); #import input int MSTimerInterval = 500; input int PutX = 0; input int PutY = 0; input int CallX = 0; input int CallY = 0; int mX = 0, mY = 0; PointXY lpPoint; int MaxTicket = -1; int OnInit() { if(!ChartSetInteger( 0, // идентификатор графика CHART_EVENT_MOUSE_MOVE, // идентификатор свойства true // значение )) { Print(__FUNCTION__+", Error Code = ",GetLastError()); return(false); } AU3_MouseGetPos(lpPoint); EventSetMillisecondTimer(MSTimerInterval); return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { EventKillTimer(); } //+------------------------------------------------------------------+ //| Timer function | //+------------------------------------------------------------------+ void OnTimer() { //--- } //+------------------------------------------------------------------+ //| ChartEvent function | //+------------------------------------------------------------------+ /*void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) { }*/ void OnChartEvent(const int id, // идентификатор события const long& lparam, // параметр события типа long const double& dparam, // параметр события типа double const string& sparam ) { if(id == CHARTEVENT_MOUSE_MOVE) { AU3_MouseGetPos(lpPoint); mX = (int)lparam; mY = (int)dparam; Comment("mX = ", mX, " mY = ", mY, " lpPoint.x = ", lpPoint.x, " lpPoint.y = ", lpPoint.y); } } //+------------------------------------------------------------------+ //| Trade function | //+------------------------------------------------------------------+ void OnTrade() { } //+------------------------------------------------------------------+ //| TradeTransaction function | //+------------------------------------------------------------------+ /*void OnTradeTransaction(const MqlTradeTransaction& trans, const MqlTradeRequest& request, const MqlTradeResult& result) { //--- }*/ //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { }