您需要 登录 才可以下载或查看,没有帐号?注册
公式目前有俩个问题:
1、zigzag指标将箭头显示修改成了价格,但是顶部价格在MT4升级到432版本后有了偏移;
2、均线价格显示,指标内的代码是定义了显示多周期的均线价格,MT4升级后只能显示四组;而且字体太小,改大了又对不齐。
麻烦BULL版出手相助,谢谢!! div >
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 LightPink
#property indicator_width1 1
#property indicator_color2 CornflowerBlue
#property indicator_width2 1
//---- indicator parameters
extern string IIIIIIIIIIIII1 =
extern int 上标签距离点差=5;
extern bool 是否显示ZigZag = true;
extern bool 显示剩余时间 = true;
extern bool 显示均线价格 = true;
extern bool 显示临界价格 = false;
extern bool 均线交叉提示 = true;
extern bool 上下穿均线 = true;
extern int 显示位置 = 2;//0:左上角 1:右上角 2:左下角 3:右下角
extern string IIIIIIIIIIIII11 =
extern int ExtDepth=21;
extern int ExtDeviation=10;
extern int ExtBackstep=10;
extern int sumbar = 150;
extern string IIIIIIIIIIIII2 =
extern int MA1 = 5;
extern int MA2 = 15;
extern int MA3 = 30;
extern int MA4 = 60;
extern string 显示周期 = 5;15;30;60;
extern int 平均模式=0;
extern string _说明1= 例:0简单平均,1指数,2平滑,3线性
extern int 价格类型=0;
extern string _说明2= 例:0收,1开,2高,3低,4中
extern string IIIIIIIIIIIII3 =
extern int CrossMA1 = 10;
extern int CrossMA2 = 30;
extern int CrossMA3 = 20;
extern int CrossMA4 = 60;
extern int 第一个周期 = PERIOD_M15;
extern int 第二个周期 = PERIOD_H1;
extern int CrossMa平均模式=0;
extern string _CrossMa说明1= 例:0简单平均,1指数,2平滑,3线性
extern int CrossMa价格类型=0;
extern string _CrossMa说明2= 例:0收,1开,2高,3低,4中
extern bool CrossMa报警 = true;
extern string CrossMa音乐文件 = alert.wav
extern string IIIIIIIIIIIII5 =
extern int SubMA1 = 30;
extern int 周期一 = PERIOD_M15;
extern int SubMA2 = 60;
extern int 周期二 =PERIOD_H1;
extern int SubMA平均模式=0;
extern string _SubMA说明1= 例:0简单平均,1指数,2平滑,3线性
extern int SubMA价格类型=0;
extern string _SubMA说明2= 例:0收,1开,2高,3低,4中
extern bool SubMA报警 = true;
extern string SubMA音乐文件 = alert.wav
extern string IIIIIIIIIIIII6 =
extern int 均线周期一 = 10;
extern int 均线周期二 = 30;
extern int 价格周期一 = PERIOD_M15;
extern int 均线周期三 = 30;
extern int 均线周期四 = 60;
extern int 价格周期二 = PERIOD_H1;
string aaa;
//---- indicator buffers
int gia_168[];
int g_arr_size_172;
int gi_176;
double gd_96;
int MAtest = 0;
int gi_180 = 0;
int gi_184 = 0;
int gi_unused_188 = 0;
int gi_unused_192 = 0;
double ExtMapBuffer[];
double ExtMapBuffer2[];
double CrossTime1;
double CrossTime2;
double CrossTime3;
double CrossTime4;
double SubTime1;
double SubTime2;
int OldLastZigZag, OldPreviousZigZag;
int YJG = 15;
int XJG = 50;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(2);
//---- drawing settings
SetIndexStyle(0,DRAW_NONE);
SetIndexArrow(0, 233);
SetIndexStyle(1,DRAW_NONE);
SetIndexArrow(1, 234);
//---- indicator buffers mapping
SetIndexBuffer(0,ExtMapBuffer);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexEmptyValue(0,0.0);
//---- indicator short name
//IndicatorShortName( ZigZag( +ExtDepth+ , +ExtDeviation+ , +ExtBackstep+ )
IndicatorShortName( ZIGZAG-hcp
int li_16;
string ls_0 = 显示周期;
ls_0 = StringTrimLeft(StringTrimRight(ls_0));
if (StringSubstr(ls_0, StringLen(ls_0) - 1, 1) != ) ls_0 = StringConcatenate(ls_0,
int li_8 = 0;
//if(MAtest==0){
for (int li_12 = StringFind(ls_0, , li_8); li_12 li_12 = StringFind(ls_0, , li_8)) {
li_16 = StrToInteger(StringSubstr(ls_0, li_8, li_12 - li_8));
if (li_16 0) {
//alert(li_16);
ArrayResize(gia_168, ArraySize(gia_168) + 1);
gia_168[ArraySize(gia_168) - 1] = li_16;
}
li_8 = li_12 + 1;
}
g_arr_size_172 = ArraySize(gia_168);
if(Digits==3||Digits==5||(StringFind(Symbol(), XAU ,0)==0 Digits==2))
上标签距离点差*=10;
//---- initialization done
return(0);
}
int deinit() {
for(int i=0;i=0; shift--)
{
val=Low[Lowest(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; backval)){ ExtMapBuffer[shift+back]=0.0;if(是否显示ZigZag)ObjectDelete( ZigZag## +(shift+back));}
}
}
}
ExtMapBuffer[shift]=val;
if(是否显示ZigZag)drawLabel( ZigZag## +shift,DoubleToStr(val,Digits),val,MediumOrchid,shift);
//--- high
val=High[Highest(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; backbr / li curlow=ExtMapBuffer[shift];br / li curhigh=ExtMapBuffer2[shift];br / li if((curlow==0) (curhigh==0)) continue;br / li //---br / li if(curhigh!=0)br / li {br / li if(lasthigh 0)
{
if(lasthigh / li h++;br / li }br / li br / li PreviousZigZag=h;br / li br / li if (OldLastZigZag!=LastZigZag || OldPreviousZigZag!=PreviousZigZag) {br / li if(OldLastZigZag LastZigZag)
{
aaa= ZZ Pointer alert... (M +Period()+ +Symbol()+ )
//mylabel( 报警标签2 ,WindowFind( ZIGZAG-hcp ),aaa,1,10,10,Red);
}
OldLastZigZag=LastZigZag;
OldPreviousZigZag=PreviousZigZag;
//ObjectDelete( Fibo
//ObjectCreate( Fibo , OBJ_FIBO, 0, Time[PreviousZigZag], ExtMapBuffer[LastZigZag], Time[LastZigZag], ExtMapBuffer[PreviousZigZag]);
}
if (OldLastZigZag!=LastZigZag || OldPreviousZigZag!=PreviousZigZag) {
if(OldLastZigZag
外汇交易有很大的风险性,本站所有资源均来自网络,请选择使用,如若出现亏损,本站不承担任何责任!