Converging TEMAs

XATPER

New member
I'm trying to locate stocks who's TEMA 10 and TEMA 20 are converging as the stock (and TEMAs) are falling. I have come up with the following script, but am not getting the desired results. Any help would be apprecitated.

Def T20 = TEMA(20);
Def T10 = TEMA (10);
Def T201 = TEMA (20)[1];
Def T101 = TEMA (10)[1];
Def Diff1 = T201-T101;
Def Diff = T20-T10;
Plot Scan = (Diff1 - Diff)/Diff1 > .4;

If I use the above scan, I don't get any results, but if I change the > to < I get results but, again, not the ones I'm looking for.
 
Solution
I'm trying to locate stocks who's TEMA 10 and TEMA 20 are converging as the stock (and TEMAs) are falling. I have come up with the following script, but am not getting the desired results. Any help would be apprecitated.

Def T20 = TEMA(20);
Def T10 = TEMA (10);
Def T201 = TEMA (20)[1];
Def T101 = TEMA (10)[1];
Def Diff1 = T201-T101;
Def Diff = T20-T10;
Plot Scan = (Diff1 - Diff)/Diff1 > .4;

If I use the above scan, I don't get any results, but if I change the > to < I get results but, again, not the ones I'm looking for.
tema has 2 input parameters. the first is price, not length.
your formulas are evaluating tema of $10 and $20 , over and over and over.... not the stock price.

example formulas with 2 parameters,
Def T20...
I'm trying to locate stocks who's TEMA 10 and TEMA 20 are converging as the stock (and TEMAs) are falling. I have come up with the following script, but am not getting the desired results. Any help would be apprecitated.

Def T20 = TEMA(20);
Def T10 = TEMA (10);
Def T201 = TEMA (20)[1];
Def T101 = TEMA (10)[1];
Def Diff1 = T201-T101;
Def Diff = T20-T10;
Plot Scan = (Diff1 - Diff)/Diff1 > .4;

If I use the above scan, I don't get any results, but if I change the > to < I get results but, again, not the ones I'm looking for.
tema has 2 input parameters. the first is price, not length.
your formulas are evaluating tema of $10 and $20 , over and over and over.... not the stock price.

example formulas with 2 parameters,
Def T20 = TEMA(close, 20);
Def T10 = TEMA (close, 10);

https://tlc.thinkorswim.com/center/reference/Tech-Indicators/studies-library/T-U/TEMA


try this code.
i made it a lower study, so i could see if there are output signals ( scan = 1)
i don't like putting constants in formulas, so i added input variables.

Code:
declare lower;
input tema_offset = 1;

input len1 = 10;
input len2 = 20;
Def T1 = TEMA(close, len1);
Def T2 = TEMA(close, len2);

def t1_off = t1[tema_offset];
def t2_off = t2[tema_offset];

def diff1 = t2_off - t1_off;
def diff = t2 - t1;

input ratio_level = 0.4;
Plot Scan = (Diff1 - Diff)/Diff1 > ratio_level;
 
Solution
tema has 2 input parameters. the first is price, not length.
your formulas are evaluating tema of $10 and $20 , over and over and over.... not the stock price.

example formulas with 2 parameters,
Def T20 = TEMA(close, 20);
Def T10 = TEMA (close, 10);

https://tlc.thinkorswim.com/center/reference/Tech-Indicators/studies-library/T-U/TEMA


try this code.
i made it a lower study, so i could see if there are output signals ( scan = 1)
i don't like putting constants in formulas, so i added input variables.

Code:
declare lower;
input tema_offset = 1;

input len1 = 10;
input len2 = 20;
Def T1 = TEMA(close, len1);
Def T2 = TEMA(close, len2);

def t1_off = t1[tema_offset];
def t2_off = t2[tema_offset];

def diff1 = t2_off - t1_off;
def diff = t2 - t1;

input ratio_level = 0.4;
Plot Scan = (Diff1 - Diff)/Diff1 > ratio_level;
Thank you Halcyonguy, it's exactly what I was looking for, I just didn't know how to input the right formulas. I appreciate the education.
 

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

Thread starter Similar threads Forum Replies Date
thefollower VWAP Bands Converging. What does it mean? Can it be Alerted? Questions 1

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
222 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