Trend scan for 10-day period

ARL

Member
Plus
Greetings! I'm after a trend scan that works on a 10 day chart using 3 data points, where the close of A is less than the close of B and the close of B is less than the close of C. Please see the illustration below. I know this would be an easy script for the more experienced and I would sure appreciate the help. I checked the forums and couldn't find anything that addresses this specifically. I also tried a solution using the candlestick pattern editor but not sure how to space the candles for the days needed.

What I think could be valuable about this scan is that it allows for plenty of price action volatility between data points A,B,C while still keeping a general direction intact. Thanks! =A=

14456[/ATTACH]']
MvagDLR.jpg
 

Attachments

  • MvagDLR.jpg
    MvagDLR.jpg
    69.4 KB · Views: 74
Last edited by a moderator:
How specific is it; do the bars need to appear in these exact positions?

Or is it just that the close of the green bars are lower than the close of the prior green bar?
 
Yes, the data points are the day's close on day 2 (which is really the previous day from the current trading day), the close on day 5 and the close on day 9. Does not matter if the close is represented by a green or red candle. Sorry for the confusion, it's just a coincidence on the chart that the data point closes are green candles, I could see how that would be misleading. Thanks!
 
The offsets are zero-based, so the current bar is bar #0, and what you have as bar #2 is really bar #1, and so on.

Direct Editor:

close[1] < close[4] and Close[4] < Close[8];

As a saved study w/ condition editor ( is true ):

Plot Scan = close[1] < close[4] and Close[4] < Close[8];

To check the results on a chart:

Plot Scan = close[1] < close[4] and Close[4] < Close[8];
Scan.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
 
  • Like
Reactions: ARL
Thank you, Joshua. Nice & clean, works great. I also worked with the TOS candlestick pattern editor more and found a way to a solution below, but your approach is so much better. I appreciate your help. =A=

def IsUp = close > open;
def IsDown = close < open;
def IsDoji = IsDoji();
def avgRange = 0.05 * Average(high - low, 20);
plot PatternPlot =
((Sum(IsUp, 1)[9] >= 0)) and
((Sum(IsUp, 1)[8] >= 0)) and
((Sum(IsUp, 1)[7] >= 0)) and
((Sum(IsUp, 1)[6] >= 0)) and
((Sum(IsUp, 1)[5] >= 0)) and
((Sum(IsUp, 1)[4] >= 0)) and
((Sum(IsUp, 1)[3] >= 0)) and
((Sum(IsUp, 1)[2] >= 0)) and
((Sum(IsUp, 1)[1] >= 0)) and
((Sum(IsUp, 1)[0] >= 0)) and
close[4] > close[1] and
close[7] > close[4];

PatternPlot.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
PatternPlot.SetDefaultColor(GetColor(0));
 

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