[MT4指标]iFractals阻力支撑指标
主图指标,iFractals阻力支撑指标
mt4指标类型:趋势指标
是否能用在mt4手机版上:否
是否含有未来函数:无
//+------------------------------------------------------------------+
//| iFractals.mq4 |
//| Copyright ? 2006, SOK.LiteForEx.Net |
//| http://sok.liteforex.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ? 2006, SOK.LiteForEx.Net"
#property link "http://sok.liteforex.net"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue
//---- input parameters
extern int ExtParam1 = 0;
//---- buffers
double ExtMapBuffer1;
double ExtMapBuffer2;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0, DRAW_ARROW, 0, 1);
SetIndexArrow(0, 159);
SetIndexBuffer(0, ExtMapBuffer1);
SetIndexEmptyValue(0, 0.0);
SetIndexStyle(1, DRAW_ARROW, 0, 1);
SetIndexArrow(1, 159);
SetIndexBuffer(1, ExtMapBuffer2);
SetIndexEmptyValue(1, 0.0);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars = IndicatorCounted();
//----
int periods = {0, PERIOD_M1, PERIOD_M5, PERIOD_M15, PERIOD_M30, PERIOD_H1,
PERIOD_H4, PERIOD_D1, PERIOD_W1, PERIOD_MN1};
int period0 = periods[ArrayBsearch(periods, Period()) + ExtParam1];
int limit;
//---- 镱耠邃龛? 镱聍栩囗睇? 徉? 狍溴? 镥疱聍栩囗
if(counted_bars > 0)
counted_bars--;
limit = Bars - counted_bars;
//---- 铖眍忭铋 鲨觌
for(int i = limit; i > 0; i--)
{
//---- ma_shift 镳桉忄桠噱蝰? 0, 镱蝾祗 黩? SetIndexShift, 恹琨忄屐 恹
int BS = iBarShift(NULL, period0, iTime(NULL, 0, i), true);
ExtMapBuffer1 = iFractals(NULL, period0, MODE_UPPER, BS);
if(ExtMapBuffer1 == 0)
{
ExtMapBuffer1 = ExtMapBuffer1[i+1];
}
ExtMapBuffer2 = iFractals(NULL, period0, MODE_LOWER, BS);
if(ExtMapBuffer2 == 0)
{
ExtMapBuffer2 = ExtMapBuffer2[i+1];
}
}
//----
return(0);
}
//+------------------------------------------------------------------+iFractals2.jpg
发表于:2018-09-12 07:30只看该作者
4楼
感谢楼主热心分享
韬客社区www.talkfx.co
发表于:2018-10-13 07:31只看该作者
5楼
感谢楼主热心分享
韬客社区www.talkfx.co