[MT4指标]日线开盘指示
主图指标,日线开盘指示
mt4指标类型:震荡指标
是否能用在mt4手机版上:否
是否含有未来函数:无
//+------------------------------------------------------------------+
//| Bunnygirl Cross and Daily Open.mq4 |
//| Copyright ? 2005, David W. Thomas |
//| mailto:[email protected] |
//+------------------------------------------------------------------+
#property copyright "Copyright ? 2005, David W. Thomas"
#property link "mailto:[email protected]"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 MediumSlateBlue
#property indicator_color2 ForestGreen
//---- input parameters
extern int DailyOpen=0;
extern int EuroOpen=8;
//---- buffers
double DailyOpenBuffer;
double EuroOpenBuffer;
//---- variables
int indexbegin = 0;
double dailyopen = 0,euroopen=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0, DRAW_LINE, STYLE_DASH);
SetIndexBuffer(0, DailyOpenBuffer);
SetIndexLabel(0, "Daily Open");
SetIndexEmptyValue(0, 0.0);
SetIndexStyle(1, DRAW_LINE, STYLE_DASH);
SetIndexBuffer(1, EuroOpenBuffer);
SetIndexLabel(1, "Euro Open");
SetIndexEmptyValue(1, 0.0);
//----
indexbegin = Bars - 20;
if (indexbegin < 0)
indexbegin = 0;
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i;
int counted_bars = IndicatorCounted();
//---- check for possible errors
if (counted_bars < 0) counted_bars = 0;
//---- last counted bar will be recounted
if (counted_bars > 0) counted_bars--;
if (counted_bars > indexbegin) counted_bars = indexbegin;
for (i = indexbegin-counted_bars; i >= 0; i--)
{
if ((TimeMinute(Time) == 0) && (TimeHour(Time) - DailyOpen == 0))
dailyopen = Open;
DailyOpenBuffer = dailyopen;
if ((TimeMinute(Time) == 0) && (TimeHour(Time) - EuroOpen == 0))
euroopen = Open;
EuroOpenBuffer = euroopen;
}
return(0);
}
//+------------------------------------------------------------------+
Daily%20Open.jpg
