|
一直在用这个指标,挺方便的。
通过调整WhatCorner参数1 or 2 or 3 or 4可以让货币名称以及时间周期分别在四个角的位置
效果图:
- #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=DeepSkyBlue;
- extern string note3="Font Size";
- extern int FontSize=32;
- extern string note4="Font Type";
- //extern string FontType="Comic Sans MS";
- extern string FontType="Arial";
- extern int WhatCorner=4;
-
- string StringShow;
- string StringPeriod;
- //+------------------------------------------------------------------+
- //| |
- //+------------------------------------------------------------------+
- int init()
- {
- return(0);
- }
- //+------------------------------------------------------------------+
- //| |
- //+------------------------------------------------------------------+
- int deinit()
- {
- ObjectDelete("Market_Price_Label");
- ObjectDelete("Market_Price_Label2");
- ObjectDelete("Market_Price_Label3");
- //----
- return(0);
- }
- //+------------------------------------------------------------------+
- //| |
- //+------------------------------------------------------------------+
- int start()
- {
- if(Period()==1){
- StringPeriod="M1";
- }
- else if(Period()==5){
- StringPeriod="M5";
- }
- else if(Period()==15){
- StringPeriod="M15";
- }
- else if(Period()==30){
- StringPeriod="M30";
- }
- else if(Period()==60){
- StringPeriod="H1";
- }
- else if(Period()==240){
- StringPeriod="H4";
- }
- else if(Period()==1440){
- StringPeriod="D1";
- }
- else if(Period()==10080){
- StringPeriod="W1";
- }
- else if(Period()==43200){
- StringPeriod="MN";
- }
- StringShow=Symbol()+","+StringPeriod;
- //----
- ObjectCreate("Market_Price_Label", OBJ_LABEL, 0, 0, 0);
- ObjectSetText("Market_Price_Label", StringShow, FontSize, FontType, FontColor);
- ObjectSet("Market_Price_Label", OBJPROP_CORNER, WhatCorner);
- ObjectSet("Market_Price_Label", OBJPROP_XDISTANCE, 1);
- ObjectSet("Market_Price_Label", OBJPROP_YDISTANCE, 10);
- }
复制代码 |
|