How to Move & Replace text (Objects/Label) from the chart
Maybe the object is already created before you run this new indicator, but anyway using the StringReplace function here does not make sense. You should use ObjectSetString function:
void OnChartEvent(const int id, const long& lparam, const double& dparam, const string& sparam) { string obj_name = "Object"; if(id==CHARTEVENT_OBJECT_CREATE && sparam==obj_name) { ResetLastError(); if(!ObjectSetString(0, obj_name, OBJPROP_TEXT, "new text")) PrintFormat("Unable to change: %s text. Error: %d", obj_name, GetLastError()); else PrintFormat("%s text changed successfully", obj_name); } }
Hello,
One of my indicators is printing text not good on the chart, I do not have the mq4 file for that indicator.
Can I move and replace text using another indicator?
I tried Object list, but not keep Also, this code did not work
I would appreciate any ideas?