Download Daily Open MT4 Indicator

Daily-OpenDownload Daily Open MT4 Indicator Indicator draws lines for open price for all days, there are two open lines- current open price from meta trader time zone, and additional for some custom. You can set euro and us session.

Input parameters (to shift open price):
DailyOpen = 0
EuroOpen = 8

Daily Open indicator displays the opening values of the day and the Europe session. However, you can adjust the parameters to display other sessions. By default, the blue line is the daily open and the green line is the Europe session open.

[php]</pre>
//+——————————————————————+
//| 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[];

&nbsp;

&nbsp;
//—- variables
int indexbegin = 0;
double dailyopen = 0,euroopen=0;

&nbsp;

//+——————————————————————+
//| 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[i]) == 0) && (TimeHour(Time[i]) – DailyOpen == 0))
dailyopen = Open[i];
DailyOpenBuffer[i] = dailyopen;

if ((TimeMinute(Time[i]) == 0) && (TimeHour(Time[i]) – EuroOpen == 0))
euroopen = Open[i];
EuroOpenBuffer[i] = euroopen;
}
return(0);

}
//+——————————————————————+
<pre>[/php]

Click Here to Download

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *