[MT4指标]INERCIA双色趋势指标
主图指标
mt4指标类型:趋势指标
是否能用在mt4手机版上:否
是否含有未来函数:无
//+------------------------------------------------------------------+
//| INERCIA_bars.mq4 |
//| Translated by KimIV |
//| Author := BOL |
//| Name := INERCIA_bars |
//| http://www.kimiv.ru |
//| |
//| 10.11.2005 剜犭铐 桧滂赅蝾疣 ? 溻箪? 耔沩嚯囔? |
//+------------------------------------------------------------------+
#property copyright "NICTRADER"
#property link "http://nyctrader.ru/"
//----
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
//------- 马屮龛? 镟疣戾蝠? 桧滂赅蝾疣 -------------------------------
extern int body =7;
extern int NumberOfBars=400; // 暑腓麇耱忸 徉痤? 钺聍蛤? (0-怦?)
//------- 馏翦瘥 桧滂赅蝾疣 ------------------------------------------
double buf0;
double buf1;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
void init()
{
SetIndexBuffer(0, buf0);
SetIndexStyle (0, DRAW_HISTOGRAM);
SetIndexEmptyValue(0, EMPTY_VALUE);
//
SetIndexBuffer(1, buf1);
SetIndexStyle (1, DRAW_HISTOGRAM);
SetIndexEmptyValue(1, EMPTY_VALUE);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
void start()
{
int LoopBegin, sh;
//----
if (NumberOfBars==0) LoopBegin=Bars-1;
else LoopBegin=NumberOfBars-1;
LoopBegin=MathMin(Bars-25, LoopBegin);
for(sh=LoopBegin; sh>=0; sh--)
{
buf0[sh]=EMPTY_VALUE;
buf1[sh]=EMPTY_VALUE;
if (Close[sh]>Open[sh] && Close[sh]-Open[sh]>body*Point)
{
buf0[sh]=High[sh];
buf1[sh]=Low[sh];
}
if (Close[sh]body*Point)
{
buf0[sh]=Low[sh];
buf1[sh]=High[sh];
}
}
}
//+------------------------------------------------------------------+
INERCIA_bars.jpg

发表于:2017-08-11 09:33只看该作者
2楼
阅尽天下指标
韬客社区www.talkfx.co