//+------------------------------------------------------------------+ //| ChartControl.mqh | //| Gunther Schulz | //| https://github.com/khramkov/MQL5-JSON-API | //+------------------------------------------------------------------+ // EXPERIMENTAL - DO NOT USE ;) #property copyright "Gunther Schulz" #property link "https://github.com/khramkov/MQL5-JSON-API" #define CHART_CONTROL true int CHART_DATA_PORT=15560; int CHART_INDICATOR_DATA_PORT=15562; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ Socket chartDataSocket(context,ZMQ_PULL); Socket chartIndicatorDataSocket(context,ZMQ_PUB); // Variables for controlling chart struct ChartWindow { long id; // Internal id string chartId; // UUID }; ChartWindow chartWindows[]; int chartWindowCount = 0; struct ChartWindowIndicator { long id; // Internal id string indicatorId; // UUID int indicatorHandle; // Internal id/handle }; ChartWindowIndicator chartWindowIndicators[]; int chartWindowIndicatorCount = 0; //+----------------------------------------------------------------------+ //| Function return index of chart window array by chart window id string| //+----------------------------------------------------------------------+ int GetChartWindowIdxByChartWindowId(string chartWindowId) { for(int i=0; i