2楼
韬客社区www.talkfx.co
发表于:2010-10-09 06:14只看该作者
3楼
你用同花顺。里面有 外汇也有预警。
韬客社区www.talkfx.co
发表于:2010-10-18 05:22只看该作者
4楼
好久没来这里了。
承蒙你这么看得起秃鹫,下面这段代码你试试吧。
你这里指定要用M15时段MACD,由于可能存在数据缺失的情况,所以本代码中采用了时段转换的方法,把不同时段的数据转换为M15数据,所以本指标只能在M15及以下的时段上使用,当然MACD也自动转换为M15图MACD。另外,H4图均线采用直接调用的方法,所以最好能把同货币对的H4图表也保持在打开状态,以保证H4数据实时更新。
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 Aqua
#property indicator_color2 Yellow
#property indicator_color3 Red
#property indicator_color4 Green
extern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9;
double ind_buffer1;
double ind_buffer2;
double ind_buffer3;
double ind_buffer4;
int myalte=0;
int init() {
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID);
SetIndexStyle(1,DRAW_LINE,STYLE_SOLID);
SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID);
SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID);
SetIndexDrawBegin(1,SignalSMA);
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+1);
if(!SetIndexBuffer(0,ind_buffer1)
&&!SetIndexBuffer(1,ind_buffer2)
&&!SetIndexBuffer(2,ind_buffer3)
&& !SetIndexBuffer(3,ind_buffer4))
Print("cannot set indicator buffers!");
IndicatorShortName("MACD_auto("+FastEMA+","+SlowEMA+","+SignalSMA+","+")");
SetIndexLabel(0,"MACD");
SetIndexLabel(1,"Signal");
return(0);
}
void start() {
if(Period()>15) return(0);
int multiple=PERIOD_M15/Period();
int limit=Bars-IndicatorCounted()-1;
double temp;
for(int i=0; i0) {ind_buffer3=temp;ind_buffer4=EMPTY_VALUE;}
else {ind_buffer3=EMPTY_VALUE;ind_buffer4=temp;}
}
if( ind_buffer1[0]<=0 && ind_buffer1[0]>=ind_buffer2[0] && ind_buffer1[1]MaH4(55) && myalte!=1) {
Alert(Symbol()+"M15图MACD金叉,且H4图Ma8>Ma55");
myalte=1;
}
if( ind_buffer1[0]>=0 && ind_buffer1[0]<=ind_buffer2[0] && ind_buffer1[1]>ind_buffer2[1] && MaH4(8)
顺势