'*********************************************************************
'*	NASDAQ High/Low Logic Indicator
'* 		by Jeremy Williams
'*
'*	Adapted from Technical Analysis of Stocks and Commodities
'* 	October 2011
'*
'*	Summary: 
'* 		This indicator uses the percentage of new highs or lows
'* 	to predict overbought and oversold conditions. For more information
'*	see "The JK HiLo Index" in the October 2011 Issue of Technical 
'*	Analysis of Stocks and Commodities.
'*
'**********************************************************************

#Indicator

Dim NewHighs	As Single
Dim NewLows		As Single
Dim TotalIssues As Single
Dim Indicator 	As Single

' Get Market Breadth Data
NewHighs = GetClose("$NQ52WH.N")
NewLows = GetClose("$NQ52WL.N")
TotalIssues = GetClose("$NQTI.N")

' Calculate the Indicator
Indicator = 100*Math.Min(NewHighs,NewLows)/TotalIssues

' Plot the Indicator
SetScales(0,5)
Plot("HLLogic",Indicator)

' Return the value calculated by the indicator
Return Indicator