CandleTime





//====================================================================
//                                                   CandleTime.mq4
//                                                   by Derk Wehler
//                                             derkwehler@gmail.com
//====================================================================

#property copyright "Copyright © 2005, Derk Wehler"
#property link      "http://www.ArrogantFxBastards.com"

#property indicator_chart_window
extern bool		UseComment			= false;
extern color 	TextColor			= Aqua;
extern int	 	TextSize			= 8;
extern string	TextFont			= "Verdana";
//extern int		Corner 				= 0;

// buffers
double s1[];

//====================================================================
// Init and Deinit
//+------------------------------------------------------------------+

int init()
{
	return(0);
}
  
  
int deinit()
{
	ObjectDelete("time");
	return(0);
}
  
  
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
{
	double	i;
	int		m, s, k;
	string	output;
	
	m = Time[0] + Period() * 60 - CurTime();
	i = m / 60.0;
	s = m % 60;
	m = (m - m % 60) / 60;
	output = m + " minutes " + s + " seconds left to bar end";
	
	if (UseComment)
		Comment(output);
	else
	{
		ObjectDelete("time");
//		Print("NOT == 0, so not in main win, creating");
		ObjectCreate("time", OBJ_TEXT, 0, Time[0], Close[0]+ 0.0005);
		ObjectSetText("time", output, TextSize, TextFont, TextColor);
//		ObjectSet("time", OBJPROP_CORNER, Corner);
	}

	return(0);
}







Sample





Analysis



Market Information Used:

Series array that contains open time of each bar
Series array that contains close prices for each bar


Indicator Curves created:


Indicators Used:



Custom Indicators Used:

Order Management characteristics:

Other Features: