EZ Trend and Momentum Indicator for ThinkorSwim

BenTen

Administrative
Staff member
Staff
VIP
Lifetime
Great oscillator which determines trend and momentum. So accurate it could be used as a stand alone indicator.

Remove the assignPriceColor line in the code if you wish not to have the candles painted.

HcygLiG.png

TUTNyTv.png


thinkScript Code

Code:
# EZ Trend & Momentum
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/IzvxaVhB-ROMI2/

declare lower;

def s2 = expAverage(close, 10) - expAverage(close, 24);

plot line = s2;

line.assignValueColor(if s2 <= 0 then color.red else color.green);

assignPriceColor(if s2 <= 0 then color.red else color.green);
 

Attachments

  • HcygLiG.png
    HcygLiG.png
    89.6 KB · Views: 321
  • TUTNyTv.png
    TUTNyTv.png
    90.1 KB · Views: 322

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

Hi Ben. Is it possible to change current trend and momentum set up from colorbars to a histogram? Keen to know how to do this as well on the slimribbon.
 
@JohnsonM Add this snippet to the bottom of your script:

Code:
line.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
 
@BenTen

Thanks for this script. How can I convert it into a scanner that scans for changes in the line color within 1 to 3 candles?

Thank you.
 
@camerdr Here you go, load up the indicator in the scan tab, then use a condition like this:

BhSRF3H.png


That's a bullish scan. Use less than or equal to if you want to scan for bearish signal.
 
@Dom173 Add the following snippet to your script, right below declare lower;

Code:
input aggregationPeriod = AggregationPeriod.DAY;
def close = close(period = aggregationPeriod);
 
The Idea of this indicator takes 2 EMA's, one shorter and subtracting the longer one. (10 ,24)
The MACD uses the same idea and adds a signal line. (12, 26, 9)

I know that it is faster by 2 bars, but I can't determine which is more profitable until there is some sort of backtest.
 
Hi Ben,

Any way to remove "repaint the candles"? TIA.
This indicator "paints" a candle green whenever the 10ema > 24ema.
If you provide a different definition, you can "paint" differently.
 
Is it possible to scan for the following EZ Trend condition:
Condition1 EZ trend is below 0
Condition2 EZ trend yesterday was lower than 2 days ago
Condition3 EZ Trend today is greater than yesterday

Just looking for a change in the slope
 
Is it possible to scan for the following EZ Trend condition:
Condition1 EZ trend is below 0
Condition2 EZ trend yesterday was lower than 2 days ago
Condition3 EZ Trend today is greater than yesterday

Just looking for a change in the slope
Here is a link to a shared scanner: http://tos.mx/dWWRBLF Click here for --> Easiest way to load shared links
OgmvTVK.png

Ruby:
def ezTrend = expAverage(close, 10) - expAverage(close, 24);
plot scan = ezTrend<0 and ezTrend[1]<ezTrend[2] and ezTrend>ezTrend[1];
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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