MT4编程授课-对象的编程
- void writetext(string Labelname,string data,int x,int y,color ColorValue,int FontSize)//通过Object写文字
- {
- ObjectDelete(Labelname);
- ObjectCreate(Labelname, OBJ_LABEL, 0, 0, 0);
- ObjectSetText(Labelname, data, FontSize, "Arial", ColorValue);
- ObjectSet(Labelname, OBJPROP_CORNER, 0);
- ObjectSet(Labelname, OBJPROP_XDISTANCE, x);
- ObjectSet(Labelname, OBJPROP_YDISTANCE, y);
- }
- void CreatText(string objName,int i,double data,string Chars)//画K线文字
- {
- ObjectDelete(objName);
- ObjectCreate(objName, OBJ_TEXT, 0, Time, data);
- ObjectSetText(objName, Chars, 10, "Arial",DodgerBlue);
- }
- void CreatLine(string objName,double Data,color Cl)
- {
- ObjectDelete(objName);
- ObjectCreate(objName,OBJ_HLINE,0,Time[0],Data);
- ObjectSet(objName,OBJPROP_COLOR,Cl);}
复制代码 |