string buttonID="Button"; string labelID="Info"; int broadcastEventID=5000;
if (id>CHARTEVENT_CUSTOM)
{ if(id==broadcastEventID) { Print("Got broadcast message from a chart with id = "+lparam); } else { //--- We read a text message in the event string info=sparam; Print("Handle the user event with the ID = ",id); //--- Display a message in a label ObjectSetString(0,labelID,OBJPROP_TEXT,sparam); ChartRedraw();// Forced redraw all chart objects } }
string buttonID="Button";
string labelID="Info";
int broadcastEventID=5000;
if (id>CHARTEVENT_CUSTOM)
{
if(id==broadcastEventID)
{
Print("Got broadcast message from a chart with id = "+lparam);
}
else
{
//--- We read a text message in the event
string info=sparam;
Print("Handle the user event with the ID = ",id);
//--- Display a message in a label
ObjectSetString(0,labelID,OBJPROP_TEXT,sparam);
ChartRedraw();// Forced redraw all chart objects
}
}
链接:https://docs.mql4.com/eventfunctions/eventchartcustom