[MT4指标]分型信号指标
主图指标,分型信号指标
mt4指标类型:趋势指标
是否能用在mt4手机版上:否
是否含有未来函数:无
使用分型原理来指示区间的涨跌信号
//+------------------------------------------------------------------+
//| Fractals5+Signal.mq4 |
//+------------------------------------------------------------------+
#property copyright "? Maloma"
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 Blue
#property indicator_color3 OrangeRed
#property indicator_color4 CornflowerBlue
//---- input parameters
//---- buffers
double dUpFractalsBuffer;
double dDownFractalsBuffer;
double dUpSignalBuffer;
double dDownSignalBuffer;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicator buffers mapping
SetIndexBuffer(0,dUpFractalsBuffer);
SetIndexBuffer(1,dDownFractalsBuffer);
SetIndexBuffer(2,dUpSignalBuffer);
SetIndexBuffer(3,dDownSignalBuffer);
//---- drawing settings
SetIndexStyle(0,DRAW_ARROW,EMPTY,1);
SetIndexArrow(0,119);
SetIndexStyle(1,DRAW_ARROW,EMPTY,1);
SetIndexArrow(1,119);
SetIndexStyle(2,DRAW_ARROW,EMPTY,2);
SetIndexArrow(2,241);
SetIndexStyle(3,DRAW_ARROW,EMPTY,2);
SetIndexArrow(3,242);
//----
SetIndexEmptyValue(0,0.0);
SetIndexEmptyValue(1,0.0);
SetIndexEmptyValue(2,0.0);
SetIndexEmptyValue(3,0.0);
//---- name for DataWindow
SetIndexLabel(0,"Fractal Up");
SetIndexLabel(1,"Fractal Down");
SetIndexLabel(2,"Signal Up");
SetIndexLabel(3,"Signal Down");
//---- initialization done
IndicatorShortName("F5S");
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i,nCountedBars;
nCountedBars=IndicatorCounted();
//---- check for possible errors
if(nCountedBars<0 || Bars<5) return(-1);
//----
i=Bars-nCountedBars-1;
while(i>=0)
{
//----Up and Down Fractals
//----5 bars Fractal
if(High[i+3]>High[i+4] && High[i+3]>High[i+5] && High[i+3]>High[i+2] && High[i+3]>High[i+1])
{
dUpSignalBuffer= Low-3*Point;
dUpFractalsBuffer[i+3]= High[i+3];
}
if(Low[i+3]

发表于:2017-08-11 10:33只看该作者
2楼
阅尽天下指标
韬客社区www.talkfx.co
发表于:2017-08-16 01:10只看该作者
3楼
谢楼主的分享
韬客社区www.talkfx.co
发表于:2017-08-18 18:39只看该作者
4楼
谢谢分享
韬客社区www.talkfx.co