NewHalfHour returns 1 (True) if this is the start of a new 30 minute p 0

Posted on 17, June 2013

in Category SID


Description for NewHalfHour SID 226

NewHalfHour returns 1 (True) if this is the start of a new 30 minute period. Works the same as NewDay or NewHour.

NewHalfHour returns 1 (True) if this is the start of a new 30 minute p/sid The logic for this function:

# NewHalfHour returns 1 if this is a new 30 minute bar
# Usage:  
#  if (NewHalfHour) 
#  { 
#		Output(" This is the first bar of a new 30 minute period");
#  }
if	(	(	(	(	Minute()				>	 0	)
				&&
				(	Minute()				<	31	)
			)
			&&
			(	(	Minute(Ago(DateTime,1))	>	30	)
				||
				(	Minute(Ago(DateTime,1))	==	00	)
			)
		)
		||
		(
			(	Minute()					> 	30	)
			&&
			(	Minute(Ago(DateTime,1))		< 	31	)
					
		)
	)
{
	return(1);
}
else
{
	return(0);
}

TAGS:

0 Comments

Leave a Message