[MT4指标]FNSignal(变种macd)指标
附图指标,FNSignal(变种macd)指标
mt4指标类型:趋势指标
是否能用在mt4手机版上:否
是否含有未来函数:无
使用类似macd的运算方法来预测价格未来走势的一个指标
ema使用的是 5 13的指数 fn参数34 后期可调整
//+------------------------------------------------------------------+
//| FN Signal.mq4 |
//| Belomor |
//| [email protected] |
//+------------------------------------------------------------------+
#property copyright "Belomor"
#property link "[email protected]"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_color3 Silver
//---- input parameters
extern int FN=34;
extern double Deviation=3.0;
extern int FastEMA=5;
extern int SlowEMA=13;
//---- buffers
double ExtMapBuffer1;
double ExtMapBuffer2;
double ExtMapBuffer3;
double ExtMapBuffer4;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(4);
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3);
SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,3);
SetIndexStyle(2,DRAW_LINE,STYLE_DOT);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexBuffer(3,ExtMapBuffer4);
if(FN<2)
FN=2;
if(Deviation<0)
Deviation=1;
if(FastEMA<1)
FastEMA=1;
if(SlowEMA<1)
SlowEMA=1;
IndicatorShortName("FNCD ("+FN+","+FastEMA+","+SlowEMA+")");
SetIndexDrawBegin(0,FN+SlowEMA);
SetIndexDrawBegin(1,FN+SlowEMA);
SetIndexLabel(0,"FN Up");
SetIndexLabel(1,"FN Down");
SetIndexEmptyValue(0,0);
SetIndexEmptyValue(1,0);
IndicatorDigits(4);
//----
return(0);
}
double NormalizedX(int F_period, int i)
{
double result;
double A;
double S;
double C;
if(i0)
{
X=NormalizedX(F_period,i)/Dev;
if(X>0.99)
X=0.99;
if(X<-0.99)
X=-0.99;
result=0.5*MathLog((1+X)/(1-X));
}
else
result=0;
return(result);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(int i=0; iExtMapBuffer3)
{
ExtMapBuffer1=iMAOnArray(ExtMapBuffer4,Bars,FastEMA,0,MODE_EMA,i);
ExtMapBuffer2=0;
}
else
{
ExtMapBuffer1=0;
ExtMapBuffer2=iMAOnArray(ExtMapBuffer4,Bars,FastEMA,0,MODE_EMA,i);
}
}
//---- done
return(0);
}
//+------------------------------------------------------------------+
FN%20Signal.jpg

发表于:2017-08-09 23:52只看该作者
2楼
韬客交易社区-国内最大的外汇交易社区
韬客社区www.talkfx.co