Weekly Pre-Breakout Consolidation Scan

pobox78

New member
Can someone write a scanner with below condition. thanks in adavance
( weekly ema ( close,13 ) > weekly ema ( close,26 ) and
weekly ema ( close,26 ) > weekly sma ( close,50 ) and
weekly sma ( close,40 ) > 5 weeks ago sma ( close,40 ) and
latest close >= weekly min ( 50 , weekly low * 1.3 ) and
latest close >= weekly max ( 50 , weekly high * 0.75 ) and
20 days ago ema ( close,13 ) > 20 weeks ago ema ( close,26 ) and
5 weeks ago sma ( close,40 ) > 10 weeks ago sma ( close,40 ) and
latest close > latest sma ( close,50 ) and
( weekly wma ( close,8 ) - weekly sma ( close,8 ) ) * 6 / 29 < 0.5 and latest close > 10 )
 
Solution
PTEpYWh.png

Code:
# Weekly Trend Strength Scanner for TOS Scan Tab
# Assumes each bar is 1 week — set scan aggregation to "1 Week" manually
#Antwerks
declare lower;

input price = close;

def EMA13 = ExpAverage(price, 13);
def EMA26 = ExpAverage(price, 26);
def SMA40 = Average(price, 40);
def SMA50 = Average(price, 50);
def WMA8 = WMA(price, 8);
def SMA8 = Average(price, 8);

def weeklyLow = low;
def weeklyHigh = high;

def cond1 = EMA13 > EMA26;
def cond2 = EMA26 > SMA50;
def cond3 = SMA40 > SMA40[5];
def cond4 = close >= Min(weeklyLow * 1.3, Lowest(weeklyLow, 50));
def cond5 = close >= Max(weeklyHigh * 0.75, Highest(weeklyHigh, 50));
def cond6 = ExpAverage(close[20], 13) > ExpAverage(close[20], 26);
def cond7 =...
PTEpYWh.png

Code:
# Weekly Trend Strength Scanner for TOS Scan Tab
# Assumes each bar is 1 week — set scan aggregation to "1 Week" manually
#Antwerks
declare lower;

input price = close;

def EMA13 = ExpAverage(price, 13);
def EMA26 = ExpAverage(price, 26);
def SMA40 = Average(price, 40);
def SMA50 = Average(price, 50);
def WMA8 = WMA(price, 8);
def SMA8 = Average(price, 8);

def weeklyLow = low;
def weeklyHigh = high;

def cond1 = EMA13 > EMA26;
def cond2 = EMA26 > SMA50;
def cond3 = SMA40 > SMA40[5];
def cond4 = close >= Min(weeklyLow * 1.3, Lowest(weeklyLow, 50));
def cond5 = close >= Max(weeklyHigh * 0.75, Highest(weeklyHigh, 50));
def cond6 = ExpAverage(close[20], 13) > ExpAverage(close[20], 26);
def cond7 = SMA40[5] > SMA40[10];
def cond8 = close > SMA50;
def cond9 = ((WMA8 - SMA8) * 6 / 29) < 0.5;
def cond10 = close > 10;

plot scan = cond1 and cond2 and cond3 and cond4 and cond5 and cond6 and cond7 and cond8 and cond9 and cond10;

https://tos.mx/!sNIp8y5a
 
Last edited by a moderator:
Solution

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
444 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