I have managed to use the ObjectCreate code successfully in MetaTrader 4 to display an OBJ_LABEL on the chart. However when i migrate my robot to a virtual server this OBJ_LABEL does not appear nor is there any error. I know the robot is running because all other functions of the robot are effective.
Does ObjectCreate not work in virtual hosting scenario?
The code used:
int start()
{
long current_chart_id=ChartID();
//--- creating label object (it does not have time/price coordinates) if(!ObjectCreate(current_chart_id,"label_object1",OBJ_LABEL,0,0,0))
{
Print("Error: can't create label1! code #",GetLastError());
return(0);
}
//--- set color to Red ObjectSetInteger(current_chart_id,"label_object1",OBJPROP_COLOR,clrRed);
//--- set distance property ObjectSet("label_object1",OBJPROP_YDISTANCE,50);
//--- set text property ObjectSetString(current_chart_id,"label_object1",OBJPROP_TEXT,"VIRTUAL ROBOT");
//--- forced chart redraw ChartRedraw(current_chart_id);
return(0);
}
Ultimately all i want to do is display my program variables on the chart so that i can monitor what is going on. If there is abetter way to achieve this than the above would really appreciate the advice?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi.
I have managed to use the ObjectCreate code successfully in MetaTrader 4 to display an OBJ_LABEL on the chart. However when i migrate my robot to a virtual server this OBJ_LABEL does not appear nor is there any error. I know the robot is running because all other functions of the robot are effective.
Does ObjectCreate not work in virtual hosting scenario?
The code used:
Ultimately all i want to do is display my program variables on the chart so that i can monitor what is going on. If there is abetter way to achieve this than the above would really appreciate the advice?