顺水外汇EA交易网MT4
标题:
哪位大神帮忙改一下?
[打印本页]
作者:
chzh
时间:
2018-1-11 13:40
标题:
哪位大神帮忙改一下?
这是KD指标,能否在30分钟,和1小时级别的KD指标中在叠加一条4小时级别的K值线
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 White
#property indicator_color2 Red
#property indicator_color3 Yellow
#property indicator_color4 Blue
double g_ibuf_76[];
double g_ibuf_80[];
double g_ibuf_84[];
double g_ibuf_88[];
extern int KPeriod = 8;
extern int DPeriod = 5;
extern int Slowing = 3;
extern bool Alert_Switch = TRUE;
double g_time_108;
int init() {
SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 1);
SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 1);
SetIndexStyle(2, DRAW_ARROW);
SetIndexStyle(3, DRAW_ARROW);
SetIndexArrow(2, 233);
SetIndexArrow(3, 234);
SetIndexBuffer(0, g_ibuf_76);
SetIndexBuffer(1, g_ibuf_80);
SetIndexBuffer(2, g_ibuf_84);
SetIndexBuffer(3, g_ibuf_88);
string ls_0 = "Sto(" + KPeriod + "," + DPeriod + "," + Slowing + ")";
IndicatorShortName(ls_0);
SetIndexLabel(0, ls_0);
SetIndexLabel(1, "Signal");
SetIndexLabel(2, "金叉");
SetIndexLabel(3, "死叉");
IndicatorDigits(Digits);
return (0);
}
int deinit() {
return (0);
}
int start() {
int li_4 = IndicatorCounted();
if (li_4 0) li_4--;
int li_0 = Bars - li_4;
for (int l_shift_8 = 0; l_shift_8 g_ibuf_80[l_shift_8] && g_ibuf_76[l_shift_8 + 1] g_ibuf_80[l_shift_8 + 1]) g_ibuf_88[l_shift_8] = g_ibuf_80[l_shift_8];
if (g_ibuf_76[l_shift_8] > g_ibuf_80[l_shift_8] && g_ibuf_76[l_shift_8 + 1] == g_ibuf_80[l_shift_8 + 1] && g_ibuf_76[l_shift_8 + 2] g_ibuf_80[l_shift_8 + 2]) g_ibuf_88[l_shift_8] = g_ibuf_80[l_shift_8];
}
if (Alert_Switch == TRUE && g_ibuf_76[0] > g_ibuf_80[0] && g_ibuf_76[1] g_ibuf_80[1] && g_time_108 != Time[0]) {
g_time_108 = Time[0];
Alert(Symbol(), " ", Period(), ":", "Stochastic 死叉");
}
if (Alert_Switch == TRUE && g_ibuf_76[0] > g_ibuf_80[0] && g_ibuf_76[1] == g_ibuf_80[1] && g_ibuf_76[2] g_ibuf_80[2] && g_time_108 != Time[0]) {
g_time_108 = Time[0];
Alert(Symbol(), " ", Period(), ":", "Stochastic 死叉");
}
return (0);
}
作者:
skyhorse
时间:
2018-1-11 15:18
看不懂,会的上~~
欢迎光临 顺水外汇EA交易网MT4 (http://waterforex.com/)
Powered by Discuz! X3.2