Sunday, November 2, 2008

Elder Impulse System - Thinkorswim Thinkscript

I've had a few emails since my post yesterday asking about the Elder Impulse System and if I could provide some code for that. Since I just so happened to have already written that before, you bet!

#Name:             ElderImpulse
#Programmed By: Chris Ball ( on 11/2/08
#Posted At:
#Description: This study can be adopted for display in many formats, however by default, it will display itself as a dot below each candle for the day. Think of this system as telling you what you "may" do, rather than what you "must" do. Alexander Elder created this system as a means of filtration rather than recommendation.

input length = 13;

def EMA = MovAvgExponential(length=length)."AvgExp";
def MACDHist = MACDHistogram()."Diff";

def impulseSignal = if (EMA < EMA[1] and MACDHist < MACDHist[1])
then 0
else if (EMA > EMA[1] and MACDHist > MACDHist[1])
then 1
else -1;

plot signal = low*0.95;
signal.assignValueColor(if impulseSignal == 1 then Color.Green else if impulseSignal == 0 then Color.Red else Color.Blue);

Have fun!