找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
首页论坛EAHub 外汇论坛
查看: 22|回复: 0

显示自定义字体报价

[复制链接]

4万

主题

54

回帖

4万

积分

管理员

积分
45954
发表于 2026-8-27 11:57:00 | 显示全部楼层 |阅读模式
#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 color  FontColor=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);
  }

复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|EAHub外汇论坛

GMT+8, 2026-10-9 22:34 , Processed in 0.101429 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表