[MT4指标]分型范围指标
主图指标
分型范围指标
mt4指标类型:趋势指标
是否能用在mt4手机版上:否
是否含有未来函数:无
依据分型原理画出相应的线段
比较明确的显示出趋势的运行轨迹
//+------------------------------------------------------------------+
//| Fractals5+Signal.mq4 |
//+------------------------------------------------------------------+
#property copyright "? Maloma"
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Magenta
#property indicator_color2 Teal
#property indicator_color3 GreenYellow
//---- input parameters
//---- buffers
double UpDiapazonBuffer;
double DnDiapazonBuffer;
double MdDiapazonBuffer;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicator buffers mapping
SetIndexBuffer(0,UpDiapazonBuffer);
SetIndexBuffer(1,DnDiapazonBuffer);
SetIndexBuffer(2,MdDiapazonBuffer);
//---- drawing settings
SetIndexStyle(0,DRAW_SECTION,EMPTY,2);
SetIndexStyle(1,DRAW_SECTION,EMPTY,2);
SetIndexStyle(2,DRAW_SECTION,STYLE_DASH);
//----
SetIndexEmptyValue(0,0.0);
SetIndexEmptyValue(1,0.0);
SetIndexEmptyValue(2,0.0);
//---- name for DataWindow
SetIndexLabel(0,"Diapazon Up");
SetIndexLabel(1,"Diapazon Down");
SetIndexLabel(2,"Diapazon Middle");
//---- initialization done
IndicatorShortName("F5-Diapazon");
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i,j,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])
{
UpDiapazonBuffer= Open;
MdDiapazonBuffer= Open;
}
if(Low[i+3]Fractals5-diapazon.jpg
发表于:2017-08-09 23:56只看该作者
2楼
韬客交易社区-国内最大的外汇交易社区
韬客社区www.talkfx.co
发表于:2017-08-09 23:57只看该作者
3楼
韬客交易社区-国内最大的外汇交易社区
韬客社区www.talkfx.co