Friday, May 15, 2009

An honest to goodness Trindicator



This works well on the 15 minute chart.

What's a Trindicator? This indicator is truly a representation of 3 indicators; RSI, DMI, and the StochasticsMomentumIndex. It's the difference between the 3 and 15 ema painted in one area, and the difference between the 30 and 60 ema is the other. Pretty, yes very.

You need to create 2 seperate sudies for this to work. One study will paint your chart. The other will create a new lower panel. Give it a try. Copy/paste the code below.

#-----------------------------------------------begin code

declare lower;plot rsi1 = if RSIWilder(length = 14)."RSI" >= 50 then 10 else 9;plot rsi2 = if RSIWilder(length = 14)."RSI" < 50 then 10 else 9;AddCloud(rsi1, rsi2);plot dmi1 = if DMI(length = 14)."DI+" >= DMI(length = 14)."DI-" then 8 else 7;plot dmi2 = if DMI(length = 14)."DI+" < DMI(length = 14)."DI-" then 8 else 7;AddCloud(dmi1, dmi2);plot sto1 = if StochasticMomentumIndex()."SMI" >= StochasticMomentumIndex()."AvgSMI" then 6 else 5;plot sto2 = if StochasticMomentumIndex()."SMI" < StochasticMomentumIndex()."AvgSMI" then 6 else 5;AddCloud(sto1, sto2);rsi1.setDefaultColor(Color.Gray);rsi2.setDefaultColor(Color.Gray);dmi1.setDefaultColor(Color.Gray);dmi2.setDefaultColor(Color.Gray);sto1.setDefaultColor(Color.Gray);sto2.setDefaultColor(Color.Gray);

#-----------------------------------------------end code

#-----------------------------------------------begin code

declare upper;input price = close;input displace = 0;def length3ema = 3;def length15ema = 15;def length30ema = 30;def length60ema = 60;plot avgexp3 = ExpAverage(data = price[-displace], length = length3ema);avgexp3.SetDefaultColor(Color.Gray);plot avgexp15 = ExpAverage(data = price[-displace], length = length15ema);avgexp15.SetDefaultColor(Color.Gray);AddCloud(avgexp3, avgexp15);plot avgexp30 = ExpAverage(data = price[-displace], length = length30ema);avgexp30.SetDefaultColor(Color.Gray);plot avgexp60 = ExpAverage(data = price[-displace], length = length60ema);avgexp60.SetDefaultColor(Color.Gray);AddCloud(avgexp30, avgexp60);

#-----------------------------------------------end code


hat tip to errbody
blog comments powered by Disqus