MT4 大字报价详细设置方法
MT4系统报价字体太小,很多朋友都觉得看起了不舒服。经本人多次试验,不用任何工具,看这个文档就可以轻松搞定了,非常简单
红色报价表示上涨,绿色表示下跌,符合国人习惯。
自己动手丰衣足食,我们以前来设置一下吧!
先看这个图,大家都熟悉吧
第一步:自定义指标上右键->创建
下一步,名称输入DZ
下一步,完成,自动打开编辑窗口:
关键的步骤来了:全选->删除….这下全部清空了,哈哈复制这篇文档最后的源代码,粘贴进去就可以了。
贴好了,点一下编译。
不要怀疑该做的都已经做好了,把这个窗口关了吧。
再看看自定义指标下面多了个DZ吧,赶快双击,确定。惊喜来了,看到可爱的大字报价了吧
//+---------------------------------------------------------------+
//| DZ.mq4 ver1.0 |
//+---------------------------------------------------------------+
//---MT4大字报价源码
#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=32;
extern string note4 = "Font Type";
extern string FontType="Arial";
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=3;
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 =Red;
if (Bid < Old_Price) FontColor = LawnGreen;
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);
}
再送两个其它指标,注意不要和上面的大字指标源码混起了!
//+------------------------------------------------------------------+
//| Zigzag.mq4 |
//| Copyright ?2005-2007, MetaQuotes Software Corp. |
//| https://www.doczj.com/doc/9718074724.html,/ |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2007, MetaQuotes Software Corp."
#property link "https://www.doczj.com/doc/9718074724.html,/"
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- indicator parameters
extern int ExtDepth=12;
extern int ExtDeviation=5;
extern int ExtBackstep=3;
//---- indicator buffers
double ZigzagBuffer[];
double HighMapBuffer[];
double LowMapBuffer[];
int level=3; // recounting's depth
bool downloadhistory=false;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(3);
//---- drawing settings
SetIndexStyle(0,DRAW_SECTION);
//---- indicator buffers mapping
SetIndexBuffer(0,ZigzagBuffer);
SetIndexBuffer(1,HighMapBuffer);
SetIndexBuffer(2,LowMapBuffer);
SetIndexEmptyValue(0,0.0);
//---- indicator short name
IndicatorShortName("ZigZag("+ExtDepth+","+ExtDeviation+","+ExtBackstep+")"); //---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
int i, counted_bars = IndicatorCounted();
int limit,counterZ,whatlookfor;
int shift,back,lasthighpos,lastlowpos;
double val,res;
double curlow,curhigh,lasthigh,lastlow;
if (counted_bars==0 && downloadhistory) // history was downloaded
{
ArrayInitialize(ZigzagBuffer,0.0);
ArrayInitialize(HighMapBuffer,0.0);
ArrayInitialize(LowMapBuffer,0.0);
}
if (counted_bars==0)
{
limit=Bars-ExtDepth;
downloadhistory=true;
}
if (counted_bars>0)
{
while (counterZ { res=ZigzagBuffer[i]; if (res!=0) counterZ++; i++; } i--; limit=i; if (LowMapBuffer[i]!=0) { curlow=LowMapBuffer[i]; whatlookfor=1; } else { curhigh=HighMapBuffer[i]; whatlookfor=-1; } for (i=limit-1;i>=0;i--) { ZigzagBuffer[i]=0.0; LowMapBuffer[i]=0.0; HighMapBuffer[i]=0.0; } } for(shift=limit; shift>=0; shift--) { val=Low[iLowest(NULL,0,MODE_LOW,ExtDepth,shift)]; if(val==lastlow) val=0.0; else { lastlow=val; if((Low[shift]-val)>(ExtDeviation*Point)) val=0.0; else { for(back=1; back<=ExtBackstep; back++) { res=LowMapBuffer[shift+back]; if((res!=0)&&(res>val)) LowMapBuffer[shift+back]=0.0; } } } if (Low[shift]==val) LowMapBuffer[shift]=val; else LowMapBuffer[shift]=0.0; //--- high val=High[iHighest(NULL,0,MODE_HIGH,ExtDepth,shift)]; if(val==lasthigh) val=0.0; else { lasthigh=val; if((val-High[shift])>(ExtDeviation*Point)) val=0.0; else { for(back=1; back<=ExtBackstep; back++) { res=HighMapBuffer[shift+back]; if((res!=0)&&(res } } } if (High[shift]==val) HighMapBuffer[shift]=val; else HighMapBuffer[shift]=0.0; } // final cutting if (whatlookfor==0) { lastlow=0; lasthigh=0; } else { lastlow=curlow; lasthigh=curhigh; } for (shift=limit;shift>=0;shift--) { res=0.0; switch(whatlookfor) { case 0: // look for peak or lawn if (lastlow==0 && lasthigh==0) { if (HighMapBuffer[shift]!=0) { lasthigh=High[shift]; lasthighpos=shift; whatlookfor=-1; ZigzagBuffer[shift]=lasthigh; res=1; } if (LowMapBuffer[shift]!=0) { lastlow=Low[shift]; lastlowpos=shift; whatlookfor=1; ZigzagBuffer[shift]=lastlow; res=1; } } break; case 1: // look for peak if (LowMapBuffer[shift]!=0.0 && LowMapBuffer[shift] { ZigzagBuffer[lastlowpos]=0.0; lastlowpos=shift; lastlow=LowMapBuffer[shift]; ZigzagBuffer[shift]=lastlow; res=1; } if (HighMapBuffer[shift]!=0.0 && LowMapBuffer[shift]==0.0) { lasthigh=HighMapBuffer[shift]; lasthighpos=shift; ZigzagBuffer[shift]=lasthigh; whatlookfor=-1; res=1; } break; case -1: // look for lawn if (HighMapBuffer[shift]!=0.0 && HighMapBuffer[shift]>lasthigh && LowMapBuffer[shift]==0.0) { ZigzagBuffer[lasthighpos]=0.0; lasthighpos=shift; lasthigh=HighMapBuffer[shift]; ZigzagBuffer[shift]=lasthigh; } if (LowMapBuffer[shift]!=0.0 && HighMapBuffer[shift]==0.0) { lastlow=LowMapBuffer[shift]; lastlowpos=shift; ZigzagBuffer[shift]=lastlow; whatlookfor=1; } break; default: return; } } return(0); } //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| Stochastic.mq4 | //| Copyright ?2004, MetaQuotes Software Corp. | //| https://www.doczj.com/doc/9718074724.html,/ | //+------------------------------------------------------------------+ #property copyright "Copyright ?2004, MetaQuotes Software Corp." #property link "https://www.doczj.com/doc/9718074724.html,/" #property indicator_separate_window #property indicator_minimum 0 #property indicator_maximum 100 #property indicator_buffers 2 #property indicator_color1 LightSeaGreen #property indicator_color2 Red //---- input parameters extern int KPeriod=5; extern int DPeriod=3; extern int Slowing=3; //---- buffers double MainBuffer[]; double SignalBuffer[]; double HighesBuffer[]; double LowesBuffer[]; //---- int draw_begin1=0; int draw_begin2=0; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string short_name; //---- 2 additional buffers are used for counting. IndicatorBuffers(4); SetIndexBuffer(2, HighesBuffer); SetIndexBuffer(3, LowesBuffer); //---- indicator lines SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0, MainBuffer); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1, SignalBuffer); //---- name for DataWindow and indicator subwindow label short_name="Sto("+KPeriod+","+DPeriod+","+Slowing+")"; IndicatorShortName(short_name); SetIndexLabel(0,short_name); SetIndexLabel(1,"Signal"); //---- draw_begin1=KPeriod+Slowing; draw_begin2=draw_begin1+DPeriod; SetIndexDrawBegin(0,draw_begin1); SetIndexDrawBegin(1,draw_begin2); //---- return(0); } //+------------------------------------------------------------------+ //| Stochastic oscillator | //+------------------------------------------------------------------+ int start() { int i,k; int counted_bars=IndicatorCounted(); double price; //---- if(Bars<=draw_begin2) return(0); //---- initial zero if(counted_bars<1) { for(i=1;i<=draw_begin1;i++) MainBuffer[Bars-i]=0; for(i=1;i<=draw_begin2;i++) SignalBuffer[Bars-i]=0; } //---- minimums counting i=Bars-KPeriod; if(counted_bars>KPeriod) i=Bars-counted_bars-1; while(i>=0) { double min=1000000; k=i+KPeriod-1; while(k>=i) { price=Low[k]; if(min>price) min=price; k--; } LowesBuffer[i]=min; i--; } //---- maximums counting i=Bars-KPeriod; if(counted_bars>KPeriod) i=Bars-counted_bars-1; while(i>=0) { double max=-1000000; k=i+KPeriod-1; while(k>=i) { price=High[k]; if(max k--; } HighesBuffer[i]=max; i--; } //---- %K line i=Bars-draw_begin1; if(counted_bars>draw_begin1) i=Bars-counted_bars-1; while(i>=0) { double sumlow=0.0; double sumhigh=0.0; for(k=(i+Slowing-1);k>=i;k--) { sumlow+=Close[k]-LowesBuffer[k]; sumhigh+=HighesBuffer[k]-LowesBuffer[k]; } if(sumhigh==0.0) MainBuffer[i]=100.0; else MainBuffer[i]=sumlow/sumhigh*100; i--; } //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; int limit=Bars-counted_bars; //---- signal line is simple movimg average for(i=0; i SignalBuffer[i]=iMAOnArray(MainBuffer,Bars,DPeriod,0,MODE_SMA,i); //---- return(0); } //+------------------------------------------------------------------+