# Using Trend Intensity parameter to scan for stocks

#### 8Nick8

##### Active member
2019 Donor
VIP
Hi, i found these few codes that using Trend Intensity to find the list of trending stocks fulfilling the criteria. As a short term trade, i want to focus on momentum stocks and I tried to use thinkscript editor to convert to a simple scan for the list of stocks but was unsuccessful. May i request someone to teach or help me convert them to a simple scan. Thanks

scan 1
#avgc7/avgc65>=1.05
def conditionOne = Average(close, 7) / Average(close, 65) >= 1.05;

Scan 2
#avgc7/avgc65>=1.05and AVGC7.25 / AVGC65.25 <= 1.05
def conditionTwo = conditionOne and Average(close, 7)[25] / Average(close, 6)[25] <- 1.05;

Scan 3
#minv3.1>=100000 and c>3 and avgc7/avgc65>=1.05 and c>0 and c>c1 and c/c1>c1/c2 and c1/c2<1.02
def ConditionThree = Lowest(volume[1], 3) >= 10000 and close > 3 and conditionOne and close > 0 and close > close[1] and close / close[1] > close[1] / close[2] and close[1] / close[2] < 1.02;

Last edited by a moderator:
Well here you go . But criteria 2 and 3 do not fire (I assumed this was daily timeframe).
https://tos.mx/vxtDhD

Last edited:
Well here you go . But criteria 1 and 2 do not fire (I assumed this was daily timeframe).
https://tos.mx/vxtDhD
@skynetgen Thanks and Yes it is suppose to be on Daily Timeframe.
I was unable to get any scan output from the scan query you created

Maybe just the scan for this code, how should the scan query be created?

#avgc7/avgc65>=1.05
def conditionOne = Average(close, 7) / Average(close, 65) >= 1.05;

Thanks

@skynetgen Thanks and Yes it is suppose to be on Daily Timeframe.
I was unable to get any scan output from the scan query you created

Maybe just the scan for this code, how should the scan query be created?

#avgc7/avgc65>=1.05
def conditionOne = Average(close, 7) / Average(close, 65) >= 1.05;

Thanks
Yeah only one which picks up anything is condition one. you just change >=2 to >=1 in scan parameters

@skynetgen Thanks and Yes it is suppose to be on Daily Timeframe.
I was unable to get any scan output from the scan query you created
Maybe just the scan for this code, how should the scan query be created?
#avgc7/avgc65>=1.05
def conditionOne = Average(close, 7) / Average(close, 65) >= 1.05;
Thanks
@Nick In the Tutorials is "How to Drive the Scanner". 2 good videos in there as well.
Also, in the Universe of Thinkscript there are are piles upon piles of scans and examples. Start with the Tutorials IMO. Markos

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