新手入门教程 发表于 2026-3-7 10:03:57

显示自定义字体报价

显示自定义字体报价
#property indicator_chart_window
//----
extern string note1="Change font colors automatically? True = Yes";
extern bool   Bid_Ask_Colors=True;
extern string note2="Default Font Color";
extern colorFontColor=Black;
extern string note3="Font Size";
extern int    FontSize=24;
extern string note4="Font Type";
extern string FontType="Comic Sans MS";
extern string note5="Display the price in what corner?";
extern string note6="Upper left=0; Upper right=1";
extern string note7="Lower left=2; Lower right=3";
extern int    WhatCorner=2;
//----
double      Old_Price;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
{
   return(0);
}
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int deinit()
{
   ObjectDelete("Market_Price_Label");
//----
   return(0);
}
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
{
   if (Bid_Ask_Colors==True)
   {
      if (Bid > Old_Price) FontColor=LawnGreen;
      if (Bid < Old_Price) FontColor=Red;
      Old_Price=Bid;
   }
   string Market_Price=DoubleToStr(Bid, Digits);
//----   
   ObjectCreate("Market_Price_Label", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("Market_Price_Label", Market_Price, FontSize, FontType, FontColor);
   ObjectSet("Market_Price_Label", OBJPROP_CORNER, WhatCorner);
   ObjectSet("Market_Price_Label", OBJPROP_XDISTANCE, 1);
   ObjectSet("Market_Price_Label", OBJPROP_YDISTANCE, 1);
}



大家在看了小编以上对"显示自定义字体报价"的介绍后应该都清楚了吧,希望对大家做单有所帮助。如果大家还想要下载更多有关"显示自定义字体报价"的相关EA源码,敬请关注汇探网下载。我们会持续更新交易系统,EA源码。
页: [1]
查看完整版本: 显示自定义字体报价