itsig is a lower study that shows all of the Investool arrow signals as a histogram. Here's a picture of the study:

Three green segments equal the Investools three green arrows (bullish signal) and three red segments equal the Investools three red arrows (bearish signal.) The advantage of such a study over the traditional Investools arrows is that it is easier to ascertain the arrow count, simply by looking at the sdi_itsig value on the right-most bar. This simplifies the task of browsing many equities for InvesTool signals. It also eases the job of identifying and comparing the duration of the composite buy/sell signals.

The dots identify where the MACD value has rolled over (i.e. started decreasing) while above the signal line or rolled-under (i.e. started increasing) while below the signal line. MACD roll-overs/unders are early warnings of a price reversal. Generally, I don't see much more than three or four MACD rolls in a given stretch of Investool buy/sell signals.

declare lower;

# stochastics inputs

input Sto_over_bought = 75;

#hint Sto_over_bought: % level that defines over-bought. Any Full-D value above over-bought is an investool green arrow. Full-D is the slower varying line in the stochastics study.

input Sto_over_sold = 25;

#hint Sto_over_sold: % level that defines over-sold. Any Full-D value below over-sold is an investool red arrow. Full-D is the slower varying line in the stochastics study.

input sto_KPeriod = 14;

#hint sto_KPeriod: bars used to average the stochastics calculation to produce Fast-K, an intermediate calculation to Full-K and Full-D.

input sto_DPeriod = 5;

#hint sto_DPeriod: bars used to average Full-K to produce Full-D. Full-D is the slower varying line displayed in stochastics studies. Full-D overbought or oversold produces an Investools green or red arrow, resp. In midrange, Full-D rising or falling produces an Investools phantom green or phantom red arrow, resp.

def sto_priceH = high;

def sto_priceL = low;

def sto_priceC = close;

input sto_slowing_period = 3;

#hint sto_slowing_period: bars used to average Fast-K to produce Full-K. Full-K is the more swiftly varying line displayed in stochastics studies.

#input sto_smoothingType = 1;

input MACDFastLength = 8;

#hint MACDfastLength: bars used to produce the more swiftly varying average in MACD studies. The MACD value is the difference between the fast and slow moving averages.

input MACDSlowLength = 17;

#hint MACDSlowLength: bars used to produce the less swiftly varying average in MACD studies. The MACD value is the difference between the fast and slow moving averages.

input MACDLength = 9;

#hint MACDLength: bars used to produce MACD signal line, the moving average of the MACD value. A MACD value greater or less than the signal line produces an Investools green or red arrow, resp.

input MvgAvgLength = 30 ;

#hint MvgAvgLength: bars used to produce the Investools moving average. Underlying price closes above or below this moving average produce and Investools green or red arrow, resp.

input MvgAvgType = { default SMA, EMA };

#hint MvgAvgType: Selects simple or exponential moving average calculations for all the composite studies.

def SimpleMvgAvgOnOrOff =

if mvgAvgType == mvgAvgType.SMA then

1

else

0

; # 0 = exponential

def sto_smoothingType = SimpleMvgAvgOnOrOff ;

def c1 = sto_priceC - Lowest(sto_priceL, sto_KPeriod);

def c2 = Highest(sto_priceH, sto_KPeriod) - Lowest(sto_priceL, sto_KPeriod);

def FastK = c1 / c2 * 100;

def FullK =

if sto_smoothingType == 1 then

Average(FastK, sto_slowing_period)

else

ExpAverage(FastK, sto_slowing_period);

def FullD =

if sto_smoothingType == 1 then

Average(FullK, sto_DPeriod)

else

ExpAverage(FullK, sto_DPeriod);

# moving average

def MAprice =

if simpleMvgAvgOnOrOff == 1 then

simpleMovingAvg( close, mvgAvgLength)

else

ExpAverage( close, mvgAvgLength);

def MACDdiff =

if simpleMvgAvgOnOrOff == 1 then

MACD( MACDfastLength, MACDslowLength, MACDLength, "SMA").Diff

else

MACD( MACDfastLength, MACDslowLength, MACDLength, "EMA").Diff

;

#plot md = macddiff;

# macd stuff

rec MACDarrow =

if MACDdiff == 0 then MACDarrow[1]

else if MACDdiff > 0 then 1

else -1 ;

#plot MCDdiag = MACDarrow ;

# red/green arrow stuff

rec MAarrow =

if close == MAprice then MAarrow[1]

else if close > MAprice then 1

else -1 ;

#plot MAdiag = MAarrow ;

rec StochsArrow =

if FULLD > sto_over_bought then 1

else if FULLD >= sto_over_sold and FULLD > FULLD[1] then 1

else if FULLD >= sto_over_sold and FULLD == FULLD[1] then

StochsArrow[1]

else -1 ;

#plot StochsDiag = StochsArrow ;

def arrowCount = MACDarrow + StochsArrow + MAarrow ;

def macdStoCount = MACDarrow + STOCHSArrow;

#plot mcdsto = macdStoCount;

plot up =

if arrowCount == 3 then 3

else if arrowCount == 1 then 2

else if arrowCount == -1 then 1

else double.NaN

;

up.SetPaintingStrategy(paintingStrategy.HISTOGRAM);

up.SetDefaultColor(color.GREEN);

up.SetLineWeight(4);

up.AssignValueColor(

if arrowCount == 3 && MACDdiff >= MACDdiff[1] then color.GREEN

else color.DARK_GREEN

);

plot dn =

if arrowCount == -3 then -3

else if arrowCount == -1 then -2

else if arrowCount == 1 then -1

else double.NaN

;

dn.SetPaintingStrategy(paintingStrategy.HISTOGRAM);

dn.SetDefaultColor(color.RED);

dn.SetLineWeight(4);

dn.AssignValueColor(

if arrowCount == -3 && MACDdiff <= MACDdiff[1] then coLor.RED

else color.DARK_RED

);

plot macd_rv =

if MACDdiff[2] < MACDdiff[1] && MACDdiff[1] > MACDdiff && MACDdiff[1] > 0 && FULLD[1] > sto_over_bought then

up+0.5

else if MACDdiff[2] > MACDdiff[1] && MACDdiff[1] < MACDdiff && MACDdiff[1] < 0 && FULLD[1] < sto_over_sold then

dn-0.5

else

double.NaN

;

macd_rv.hideBubble();

macd_rv.setpaintingStrategy( paintingStrategy.POINTS ) ;

macd_rv.setDefaultColor( COLor.DARK_GRAY) ;

macd_rv.setLineWeight(5) ;

macd_rv.AssignValueColor(

if isNaN( macd_rv ) then color.DARK_GRAY

else if MACDdiff[1] > 0 then color.RED

else if MACDdiff[1] < 0 then color.GREEN

else color.DARK_GRAY

);

plot z = 0 ;

z.SetDefaultColor( color.DARK_GRAY );

z.setLineWeight(3);

plot p3 = 3 ;

p3.setDefaultColor( color.DARK_GRAY);

plot p2 = 2 ;

p2.SetDefaultColor( color.DARK_GRAY);

plot p1 = 1 ;

p1.SetDefaultColor( color.DARK_GRAY);

plot m3 = -3 ;

m3.setdefaultColor( color.DARK_GRAY);

plot m2 = -2 ;

m2.SetDefaultColor( color.DARK_GRAY);

plot m1 = -1 ;

m1.SetDefaultColor( color.DARK_GRAY);