[MT4指标]dfc指标
主图指标
mt4指标类型:震荡指标
是否能用在mt4手机版上:否
是否含有未来函数:无
//+------------------------------------------------------------------------------------+
//| Din_fibo_Next.mq4 |
//| unknown author, get from kaizer, conversed by Rosh |
//| link to kaizer: http://forum.alpari-idc.ru/profile.php?mode=viewprofile&u=4196161 |
//| http://forexsystems.ru/phpBB/index.php|
//+------------------------------------------------------------------------------------+
#property copyright "unknown author, get from kaizer, conversed by Rosh"
#property link "http://forexsystems.ru/phpBB/index.php"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Red
//---- input parameters
extern int Fibo_Channel_Period=3;
extern double Ratio=0.786;
extern bool SetAllBars=false;
//---- buffers
double ExtMapBuffer1;
double ExtMapBuffer2;
double tvBuffer;
int hh,ll,first,counterPeriod;
double tv,MaH,MaL;
//+------------------------------------------------------------------+
//| 项塍麒 耠邃簋 镥痂钿 |
//+------------------------------------------------------------------+
string GetNextPeriod(int _Period)
{
string nextPeriod="";
//----
switch (_Period)
{
case 5: nextPeriod="H1"; break;
case 15: nextPeriod="H1"; break;
case 30: nextPeriod="H4"; break;
case 60: nextPeriod="H4"; break;
case 240: nextPeriod="D1"; break;
case 1440: nextPeriod="W1"; break;
case 10080: nextPeriod="M"; break;
default: Print("湾漕矬耱桁 镥痂钿!!!");
}
//----
return(nextPeriod);
}
//+------------------------------------------------------------------+
//| 橡钼屦桁 - 疣玟咫栩咫 滂囡噻铐 桦 礤 |
//+------------------------------------------------------------------+
bool isDelimeter(int _Period, int _shift)
{
bool result=false;
//----
switch (_Period)
{
case 5:result=(TimeMinute(Time[_shift])==0); break;
case 15:result=(TimeMinute(Time[_shift])==0); break;
case 30:result=(TimeMinute(Time[_shift])==0)&& MathMod(TimeHour(Time[_shift]),4.0)==0.0; break;
case 60:result=(TimeMinute(Time[_shift])==0)&& MathMod(TimeHour(Time[_shift]),4.0)==0.0;break;
case 240:result=(TimeMinute(Time[_shift])==0)&&(TimeHour(Time[_shift])==0); break;
case 1440:result=(TimeDayOfWeek(Time[_shift])==1)&&(TimeHour(Time[_shift])==0); break;
case 10080:result=(TimeDay(Time[_shift])==1)||((TimeDay(Time[_shift])==2 && TimeDay(Time[_shift+1])!=1))||((TimeDay(Time[_shift])==3 && TimeDay(Time[_shift+1])!=2)); break;
default: Print("湾漕矬耱桁 镥痂钿!!!");
}
//----
return(result);
}
//+------------------------------------------------------------------+
//| 玉蜞眍忤 MaH MaL 磬 沭囗桷 滂囡噻铐 |
//+------------------------------------------------------------------+
void SetHnL(int _shift)
{
//----
int i=_shift+1;
counterPeriod=0;
first=0;
while (counterPeriodCurBar;m_cnt--)
{
ExtMapBuffer1[m_cnt]=ExtMapBuffer1[m_cnt+1]-deltaH;
ExtMapBuffer2[m_cnt]=ExtMapBuffer2[m_cnt+1]-deltaL;
}
for (m_cnt=_DelimeterBar-1;m_cnt>CurBar;m_cnt--)
{
ExtMapBuffer1[m_cnt]=NormalizeDouble(ExtMapBuffer1[m_cnt],Digits);
ExtMapBuffer2[m_cnt]=NormalizeDouble(ExtMapBuffer2[m_cnt],Digits);
}
//----
return;
}
//+------------------------------------------------------------------+
//| 玉蜞眍忤 MaH MaL 磬 镳噔铎 牮帼 |
//+------------------------------------------------------------------+
void SetValuesNullBar(int _shift)
{
//----
int i=_shift;
while (tvBuffer==0.0) i++;
for (int j=i-1;j>_shift;j--)
{
ExtMapBuffer1[j]=0.0;
ExtMapBuffer2[j]=0.0;
}
first=0;
i=_shift;
counterPeriod=0;
while (counterPeriod0) limit=Bars-counted_bars;
if (counted_bars==0)
{
// 磬轵 镥疴 怛铕铋 疣玟咫栩咫 篑蜞眍忤螯 limit
cnt=Bars-1;
while (!isDelimeter(Period(),cnt)) cnt--;
first=cnt;
cnt--;
counterPeriod=0;
while (counterPeriod=0;shift--)
{
if (isDelimeter(Period(),shift)) SetHnL(shift);// else SetMovingHnL(shift);
if (shift==0) SetValuesNullBar(shift);
}
return(0);
}
//+------------------------------------------------------------------+
DFC%20Next.jpg
