# 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);

input length3 = 3;
def derivative2 = ((derivative[0] - derivative[length3]) / (length3));
#derivative2.SetDefaultColor(CreateColor(255, 155, 255));
#derivative2.SetLineWeight(1);

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

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

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

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

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

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

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

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

It looks nice with a 60 length on a 5 min

87k+ Posts
360 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

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?