16评论

0收藏

各位大神看看这段代码哪里出错了帮忙改下

avatar 握不住的沙 | 2440 人阅读 | 16 人评论 | 2019-04-01

//---------------------------------------------------------------------------------------
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Aqua
#property indicator_color2 Yellow
#property indicator_color3 Aqua
#property indicator_color4 Yellow
extern string
添加商品='EURUSD';
extern int
对准均线=5;
double MyBuffer1[];
double MyBuffer2[];
double MyBuffer3[];
double MyBuffer4[];
double multp;
string my_symbol;
int init() {
SetIndexBuffer(0, MyBuffer1);
SetIndexBuffer(1, MyBuffer2);
SetIndexBuffer(2, MyBuffer3);
SetIndexBuffer(3, MyBuffer4);
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3);
SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,3);
SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,0);
SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,0);
my_symbol=
添加商品;
int kk=PERIOD_D1/Period();
if(kk<1) kk=1;
multp=iMA(NULL,0,
对准均线*kk,0,MODE_SMA,PRICE_CLOSE,0)/iMA(my_symbol,0,对准均线*kk,0,MODE_SMA,PRICE_CLOSE,0);
return(0);
}
int start() {
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(int t=0; t
MyBuffer1[t]=iOpen(my_symbol,0,t)*multp;
MyBuffer2[t]=iClose(my_symbol,0,t)*multp;
if(iOpen(my_symbol,0,t)==iClose(my_symbol,0,t))
MyBuffer2[t]=iClose(my_symbol,0,t)*multp-0.1*Point;
if(iOpen(my_symbol,0,t)>=iClose(my_symbol,0,t)) {
MyBuffer3[t]=iHigh(my_symbol,0,t)*multp;
MyBuffer4[t]=iLow(my_symbol,0,t)*multp;
}
else if(iOpen(my_symbol,0,t)
MyBuffer3[t]=iLow(my_symbol,0,t)*multp;
MyBuffer4[t]=iHigh(my_symbol,0,t)*multp;
}
}
return(0);
}
//-----------------------------------------------------------------------------------------------

评论|共 16 个

侠者

发表于 2019-4-1 14:34:51 | 显示全部楼层

看看

听风者

发表于 2019-4-1 14:44:45 | 显示全部楼层

是想要商品叠加么,你可以找论坛找现成的指标的

qq6987843

发表于 2019-4-2 21:31:05 | 显示全部楼层

什么指标的吗

fxg

发表于 2020-6-12 17:13:06 | 显示全部楼层

LZ真是人才

gsrce

发表于 2020-6-14 21:40:05 | 显示全部楼层

真是 收益 匪浅

星辰的灰烬

发表于 2020-6-15 18:34:43 | 显示全部楼层

路过,支持一下啦

人在深圳

发表于 2020-7-8 21:11:08 | 显示全部楼层

帮你顶下哈!!

jhyzjxc123

发表于 2020-7-12 13:05:51 | 显示全部楼层

学习了,不错

ccc

发表于 2020-7-31 10:11:15 | 显示全部楼层

学习了,不错

12下一页
您需要登录后才可以回帖 登录 | 注册 微信登录

EA之家评论守则