[MT4指标]历史语言指标配套指标
历史语言指标配套指标
附图指标
mt4指标类型:趋势指标
是否能用在mt4手机版上:否
mt4指标类型:震荡指标
是否能用在mt4手机版上:否
是否含有未来函数:无
/*------------------------------------------------------------------+
| BackToFuture-B.mq4 |
| Copyright ? 2010 |
| [email protected] |
+------------------------------------------------------------------*/
#property copyright "Copyright ? 2010, [email protected]"
#property link "[email protected]"
//-----
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Yellow
#property indicator_color2 Red
#property indicator_color3 Green
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_level1 76
#property indicator_level2 62
#property indicator_level3 50
#property indicator_level4 38
#property indicator_level5 24
//-----
extern int indPeriod = 4;
extern double UpLevel = 76.4;
extern double DnLevel = 23.6;
//-----
double MainBuffer;
double bufRed;
double bufGreen;
double buf;
double sumH;
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(5);
string short_name;
SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 1);
SetIndexBuffer(0, MainBuffer);
//------
SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 2);
SetIndexBuffer(1, bufRed);
//------
SetIndexStyle(2, DRAW_LINE, STYLE_SOLID, 2);
SetIndexBuffer(2, bufGreen);
//------
SetIndexBuffer(3, buf);
SetIndexBuffer(4, sumH);
//-----
short_name="BackToFuture("+indPeriod+")";
IndicatorShortName(short_name);
return(0);
}
//+------------------------------------------------------------------+
int start()
{
double sumC = 0;
int counted_bars = IndicatorCounted();
int i, j, k;
j = Bars - indPeriod;
if(counted_bars >= indPeriod) j = Bars - counted_bars - 1;
//-----
for(i = j; i >= 0; i--)
{
buf = 100 * ((Close - Low) / ((High - Low) + Point));
for(k = i; k < i + indPeriod; k++)
{
sumC += buf[k];
}
sumH = sumC / indPeriod;
//---------------------
MainBuffer = sumH;
if(sumH >= UpLevel)
{
bufRed = sumH;
}
if(sumH <= DnLevel)
{
bufGreen = sumH;
}
//-----
sumC = 0;
}
//-----
return(0);
}
BackToFuture-B.jpg
