[MT4指标]均线交叉指标
附图指标,均线交叉在附图使用红蓝显示的趋势指标
mt4指标类型:趋势指标
是否能用在mt4手机版上:否
是否含有未来函数:无
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//Coded By FX Sniper
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
extern int MA1 = 5;
extern int MA1_Type = 1;
extern int MA2 = 20;
extern int MA2_Type = 1;
double buf1;
double buf2;
double buf3;
double buf4;
int init()
{
//---- indicators
// ObjectDelete("EU");
// ObjectDelete("USSession");
//----
IndicatorBuffers(8);
SetIndexStyle(0,DRAW_HISTOGRAM,EMPTY,5,Blue);
SetIndexBuffer(0,buf1);
SetIndexStyle(1,DRAW_HISTOGRAM,EMPTY,5,Red);
SetIndexBuffer(1,buf2);
SetIndexBuffer(2,buf3);
SetIndexBuffer(3,buf4);
IndicatorShortName(" ");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
for (int x=Bars;x>=0;x--)
{
switch(MA1_Type)
{
case 1:
buf3[x]=iMA(NULL,0,MA1,0,MODE_SMA,PRICE_CLOSE,x);
break;
case 2:
buf3[x]=iMA(NULL,0,MA1,0,MODE_EMA,PRICE_CLOSE,x);
break;
case 3:
buf3[x]=iMA(NULL,0,MA1,0,MODE_LWMA,PRICE_CLOSE,x);
break;
}
switch(MA2_Type)
{
case 1:
buf4[x]=iMA(NULL,0,MA2,0,MODE_SMA,PRICE_CLOSE,x);
break;
case 2:
buf4[x]=iMA(NULL,0,MA2,0,MODE_EMA,PRICE_CLOSE,x);
break;
case 3:
buf4[x]=iMA(NULL,0,MA2,0,MODE_LWMA,PRICE_CLOSE,x);
break;
}
if (buf3[x]>buf4[x])
{
buf1[x]=24;
buf2[x]=0;
}
else
{ buf2[x]=24;
buf1[x]=0;
}
}
return(0);
}
//+------------------------------------------------------------------+
FX%20Sniper\'s%20MA%20Cross.jpg

发表于:2014-04-11 12:16只看该作者
2楼
很好的指标,就是不知道如何放进系统中。。。

韬客社区www.talkfx.co
发表于:2015-04-20 11:55只看该作者
3楼
缺钱,灌水赚通宝,谢谢分享!!
发表于:2015-04-21 15:47只看该作者
4楼
这个感觉还是太抽象了,而且不是很好找点位。
韬客社区www.talkfx.co
发表于:2015-05-26 05:05只看该作者
5楼
看看再说
韬客社区www.talkfx.co
发表于:2015-05-26 05:07只看该作者
6楼
看看再说
韬客社区www.talkfx.co