TEMA Derivative Indicator for ThinkorSwim

WbKiki

New member
Someone in the Discord server had asked for an indicator to determine where the inflection points were on an EMA. I figured it would look interesting taking the derivative of the TEMA. I also added a bunch of them. Looks pretty interesting IMO.

Code:
#############################
# TEMA DERIVATIVE INDICATOR #
#############################

declare lower;

input price = close;
input length = 10;
plot zero = 0;

def ema1 = ExpAverage(price, length);
def ema2 = ExpAverage(ema1, length);
def ema3 = ExpAverage(ema2, length);

def TEMA = 3 * ema1 - 3 * ema2 + ema3;
#TEMA.SetDefaultColor(GetColor(0));

input length2 = 3;
def derivative = ((TEMA[0] - TEMA[length2]) / (length2));
#derivative.SetDefaultColor(CreateColor(255, 155, 255));
#derivative.SetLineWeight(1);
addCloud(derivative/6, zero, color.green, color.light_red, no);

input length3 = 3;
def derivative2 = ((derivative[0] - derivative[length3]) / (length3));
#derivative2.SetDefaultColor(CreateColor(255, 155, 255));
#derivative2.SetLineWeight(1);
addCloud(derivative2/2, zero, color.green, color.light_red, no);

input length4 = 3;
def derivative3 = ((derivative2[0] - derivative2[length4]) / (length4));
#derivative3.SetDefaultColor(CreateColor(255, 155, 255));
#derivative3.SetLineWeight(1);
addCloud(derivative3, zero, color.green, color.light_red, no);

input length5 = 3;
def derivative4 = ((derivative3[0] - derivative3[length5]) / (length5));
#derivative4.SetDefaultColor(CreateColor(255, 155, 255));
#derivative4.SetLineWeight(1);
addCloud(derivative4, zero, color.green, color.light_red, no);

input length6 = 3;
def derivative5 = ((derivative4[0] - derivative4[length6]) / (length6));
#derivative5.SetDefaultColor(CreateColor(255, 155, 255));
#derivative5.SetLineWeight(1);
addCloud(derivative5, zero, color.green, color.light_red, no);

input length7 = 3;
def derivative6 = ((derivative5[0] - derivative5[length7]) / (length7));
#derivative6.SetDefaultColor(CreateColor(255, 155, 255));
#derivative6.SetLineWeight(1);
addCloud(derivative6, zero, color.green, color.light_red, no);

input length8 = 3;
def derivative7 = ((derivative6[0] - derivative6[length8]) / (length8));
#derivative7.SetDefaultColor(CreateColor(255, 155, 255));
#derivative7.SetLineWeight(1);
addCloud(derivative7, zero, color.green, color.light_red, no);

input length9 = 3;
def derivative8 = ((derivative7[0] - derivative7[length9]) / (length9));
#derivative8.SetDefaultColor(CreateColor(255, 155, 255));
#derivative8.SetLineWeight(1);
addCloud(derivative8, zero, color.green, color.light_red, no);

input length10 = 3;
def derivative9 = ((derivative8[0] - derivative8[length10]) / (length10));
#derivative9.SetDefaultColor(CreateColor(255, 155, 255));
#derivative9.SetLineWeight(1);
addCloud(derivative9, zero, color.green, color.light_red, no);

input length11 = 3;
def derivative10 = ((derivative9[0] - derivative9[length11]) / (length11));
#derivative10.SetDefaultColor(CreateColor(255, 155, 255));
#derivative10.SetLineWeight(1);
addCloud(derivative10, zero, color.green, color.light_red, no);

Screenshot-7.png
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
360 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top