ObjectCreate not working in virtual hosting

 

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:

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?

Reason: