• Get $30 off VIP with code SUMMER30. Ends July 27. Happy trading!

William Blau SMI with EMA difference (aka histogram)

Tango

New member
I have not been able to find in the forum an indicator of the original William Balu's SMI that includes the EMA difference shown as a histogram. Please see the following images for details and required parameters.

(click on images to enlarge)

SMI.png


SMI-parameters.png


I would appreciate if anyone can point me to the equivalent thinkscript. Thanks in advance.
 

rad14733

Well-known member
VIP
@Tango It would be helpful if you could provide a link to the study you have referenced... We do have SMI study topics here in these forums... Most notably the Ironrod_SMI_Histogram which is a lower indicator...
 

mfsteve

Member
VIP
Dunno where to find 'the original William Balu's SMI' but TOS has one.

Added a histgram to the original study.


Code:
#
# TD Ameritrade IP Company, Inc. (c) 2008-2020
#

declare lower;

input over_bought = 40.0;
input over_sold = -40.0;
input percentDLength = 13;
input percentKLength = 25;

def min_low = Lowest(low, percentKLength);
def max_high = Highest(high, percentKLength);
def rel_diff = close - (max_high + min_low) / 2;
def diff = max_high - min_low;

def avgrel = ExpAverage(ExpAverage(rel_diff, percentDLength), percentDLength);
def avgdiff = ExpAverage(ExpAverage(diff, percentDLength), percentDLength);

plot SMI = if avgdiff != 0 then avgrel / (avgdiff / 2) * 100 else 0;
SMI.SetDefaultColor(Color.ORANGE);

plot AvgSMI = ExpAverage(SMI, percentDLength);
AvgSMI.SetDefaultColor(Color.LIGHT_GREEN);

plot overbought = over_bought;
overbought.SetDefaultColor(Color.GRAY);

plot oversold = over_sold;
oversold.SetDefaultColor(Color.GRAY);

# Add a histogram -- mfsteve 12/10/20
plot ZeroLine = 0;
ZeroLine.SetDefaultColor(Color.WHITE);

plot wave = SMI - AvgSMI;
wave.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
wave.SetLineWeight(5);
wave.SetDefaultColor(Color.RED);
 

Tango

New member
@mfsteve thanks so much.... this is pretty much what was looking for. It has the histogram. The only thing that is missing are the typical additional smoothing averages, but that is not a big deal. Cheers!
 
Thread starter Similar threads Forum Replies Date
S Smart Money Index (SMI) Indicator for ThinkorSwim Questions 21
P SMI Ergodic Indicator for ThinkorSwim Questions 9

Similar threads

Top