901810 2010-8-10 18:34
帮改一下指标,大师,有图,
帮改一下指标,大师,有图,
在指标右边显示 M15 h1 h4周期图的值
#property indicator_separate_window
#property indicator_levelcolor DarkSlateGray
#property indicator_buffers 3
#property indicator_color1 DeepSkyBlue
#property indicator_color2 Red
#property indicator_color3 DeepSkyBlue
#property indicator_width1 2
#property indicator_level1 80.0
#property indicator_width2 2
#property indicator_level2 50.0
#property indicator_level3 20.0
extern int TimeFrame = 60;
extern int KPeriod = 8;
extern int DPeriod = 3;
extern int Slowing = 3;
extern int MAMethod = 0;
extern int PriceField = 1;
bool ShowDots = TRUE;
string PriceField_ = "0=Hi/Low 1=Close/Close";
string MA_Method_ = "SMA0 EMA1 SMMA2 LWMA3";
string TimeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN;0-currentTF";
double g_ibuf_128[];
double g_ibuf_132[];
double g_ibuf_136[];
int init() {
string ls_0;
SetIndexBuffer(0, g_ibuf_128);
SetIndexStyle(0, DRAW_SECTION);
SetIndexBuffer(1, g_ibuf_132);
SetIndexStyle(1, DRAW_LINE);
if (ShowDots) {
SetIndexBuffer(2, g_ibuf_136);
SetIndexStyle(2, DRAW_ARROW);
SetIndexArrow(2, 158);
SetIndexShift(2, TimeFrame / Period() - 1);
SetIndexEmptyValue(2, EMPTY_VALUE);
}
TimeFrame = MathMax(TimeFrame, Period());
switch (TimeFrame) {
case 1:
ls_0 = "M1";
break;
case 5:
ls_0 = "M5";
break;
case 15:
ls_0 = "M15";
break;
case 30:
ls_0 = "M30";
break;
case 60:
ls_0 = "H1";
break;
case 240:
ls_0 = "H4";
break;
case 1440:
ls_0 = "D1";
break;
case 10080:
ls_0 = "W1";
break;
case 43200:
ls_0 = "MN";
break;
default:
ls_0 = "TF0";
}
IndicatorShortName("GP_Stochastic");
return (0);
}
int start() {
int lia_0[];
int li_4 = IndicatorCounted();
if (li_4 < 0) return (-1);
if (li_4 > 0) li_4--;
ArrayCopySeries(lia_0, 5, Symbol(), TimeFrame);
int li_8 = Bars - li_4;
li_8 = MathMax(li_8, TimeFrame / Period());
int l_index_12 = 0;
int l_shift_16 = 0;
while (l_index_12 < li_8) {
if (Time[l_index_12] < lia_0[l_shift_16]) l_shift_16++;
g_ibuf_128[l_index_12] = iStochastic(NULL, TimeFrame, KPeriod, DPeriod, Slowing, MAMethod, PriceField, MODE_MAIN, l_shift_16);
g_ibuf_132[l_index_12] = iStochastic(NULL, TimeFrame, KPeriod, DPeriod, Slowing, MAMethod, PriceField, MODE_SIGNAL, l_shift_16);
if (ShowDots && Time[l_index_12] == lia_0[l_shift_16]) g_ibuf_136[l_index_12] = g_ibuf_128[l_index_12];
l_index_12++;
}
return (0);
}
[[i] 本帖最后由 901810 于 2010-8-10 18:36 编辑 [/i]]
901810 2010-8-11 18:32
回复 1# 的帖子
pp012 大师呢,怎么还没现身?
901810 2010-8-12 07:09
回复 3# 的帖子
这里有大师的,只是没现身呢pp014