FOREX MT4 INDICATORS DOWNLOAD
  • Register
  • Donate to us
  • MT4 INDICATORS A
  • MT4 INDICATORS B
  • MT4 INDICATORS C
  • MT4 INDICATORS D
  • MT4 INDICATORS E
  • MT4 INDICATORS F
  • MT4 INDICATORS G
  • MT4 INDICATORS H
  • MT4 INDICATORS I
  • MT4 INDICATORS J
  • MT4 INDICATORS K
  • MT4 INDICATORS L
  • MT4 INDICATORS M
  • MT4 INDICATORS N
  • MT4 INDICATORS O
  • MT4 INDICATORS P
  • MT4 INDICATORS Q
  • MT4 INDICATORS R
  • MT4 INDICATORS S
  • MT4 INDICATORS T
  • MT4 INDICATORS U
  • MT4 INDICATORS V
  • MT4 INDICATORS W
  • MT4 INDICATORS X
  • MT4 INDICATORS Y
  • MT4 INDICATORS Z
  • MT4 INDICATORS NUM
  • MT4 INDICATORS SIGN

Daily open line.mq4

Daily open line.mq4 FOREX MetaTrader4 Indicators Download

Daily open line.mq4 download link will appear after 10 seconds.



Icon

Daily open line.mq4

1 file(s) 2.43 KB
Download


Daily open line.mq4 Programming source code

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 White
#property indicator_style1 2
#property indicator_width1 1

double TodayOpenBuffer[];
extern int TimeZoneOfData= 0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
	SetIndexStyle(0,DRAW_LINE);
	SetIndexBuffer(0,TodayOpenBuffer);
	SetIndexLabel(0,"Open");
	SetIndexEmptyValue(0,0.0);
	return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
{
	return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
{
   int lastbar;
   int counted_bars= IndicatorCounted();
   
   if (counted_bars>0) counted_bars--;
   lastbar = Bars-counted_bars;	
   DailyOpen(0,lastbar);
   
   return (0);
}
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int DailyOpen(int offset, int lastbar)
{
   int shift;
   int tzdiffsec= TimeZoneOfData * 3600;
   double barsper30= 1.0*PERIOD_M30/Period();
   bool ShowDailyOpenLevel= True;
   // lastbar+= barsperday+2;  // make sure we catch the daily open		 
   lastbar= MathMin(Bars-20*barsper30-1, lastbar);

	for(shift=lastbar;shift>=offset;shift--){
	  TodayOpenBuffer[shift]= 0;
     if (ShowDailyOpenLevel){
       if(TimeDay(Time[shift]-tzdiffsec) != TimeDay(Time[shift+1]-tzdiffsec)){      // day change
         TodayOpenBuffer[shift]= Open[shift];         
         TodayOpenBuffer[shift+1]= 0;                                                           // avoid stairs in the line
       }
       else{
         TodayOpenBuffer[shift]= TodayOpenBuffer[shift+1];
       }
	  }
   }
   return(0);
}

EasyTrendVisualizer.ex4 B-Gen Trend.ex4

Related Posts

METATRADER4D

Divergence Petr_HL_BB.mq4

METATRADER4D

Divergence Petr_HL.mq4

METATRADER4D

DEMA_RLH2.mq4

METATRADER4D

DEMA_mod.mq4

METATRADER4D

DEMA.mq4

METATRADER4D

DED.ex4

METATRADER4D

DB Pivots Strategy.mq4

How to use this site.
  1. Subscribe YouTube
  2. Subscribe Facebook
  3. Subscribe Instagram
  4. Download MT4
  5. Watch Youtube Video
  6. Downliad Indicator and Try Trading
  7. Donate to us for update

Recent News

  • i-g-cci2.mq4
  • haosvisual_27jk8.mq4
  • HamaSystem separate window.ex4
  • HalfTrend 2.mq4
  • Gitalovsa.mq4

Donate