外汇EA
在屏幕指定位置写出文字
回复:0  浏览:987
  • 楼主admin 圈主
  • 2019-05-05 09:12
通过Object系列函数,创建文字对象,设定纵横坐标和内容,还可以设定字体和大小

  1. void writetext(string Labelname,string data,int x,int y,color ColorValue,int FontSize)//通过Object写文字
  2. {
  3.    ObjectDelete(Labelname);
  4.    ObjectCreate(Labelname, OBJ_LABEL, 0, 0, 0);
  5.    ObjectSetText(Labelname, data, FontSize, "Arial", ColorValue);
  6.    ObjectSet(Labelname, OBJPROP_CORNER, 0);
  7.    ObjectSet(Labelname, OBJPROP_XDISTANCE, x);
  8.    ObjectSet(Labelname, OBJPROP_YDISTANCE, y);
  9. }