Arbitrary days above an arbitrary period moving average?

Oleron

New member
I'm trying to set up a scan that will sift for stocks that have just popped over a given moving average, but only just, within an arbitrary time period, say five days. The latter part is (to me), the tricky bit. Please assist. Thanks.
 
Solution
Code:
input AvgLength = 20;
input DaysAbove = 5;
plot SMA = SimpleMovingAvg(close,AvgLength);
def Days = if close < SMA then 0 else Days[1] + 1;
plot Scan = Days and Days <= DaysAbove;
Scan.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
Code:
input AvgLength = 20;
input DaysAbove = 5;
plot SMA = SimpleMovingAvg(close,AvgLength);
def Days = if close < SMA then 0 else Days[1] + 1;
plot Scan = Days and Days <= DaysAbove;
Scan.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
 
Solution

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

Correct, but not necessarily. They way its setup now is intended to be added to a chart and verified.

If you paste it directly into the scan editor, it will give an error about the extra plot.

If you save it as a study, and load it in as a custom study condition, it will allow you to select from multiple plots via drop down menu.

p52adWB.png


So it could go either way really.
 
Correct, but not necessarily. They way its setup now is intended to be added to a chart and verified.

If you paste it directly into the scan editor, it will give an error about the extra plot.

If you save it as a study, and load it in as a custom study condition, it will allow you to select from multiple plots via drop down menu.

p52adWB.png


So it could go either way really.

I've set it up as a custom study, but I'm not seeing this menu choice. Please bear with me; new territory here.
 
The first "plot" should be "def" I take it?
So, let me say thanks, i do find some good indicators, and some even better scanners; this one is quite good in a very interesting way.

On a 1 hr.chart, my small blue arrow pops too often, but this shows up as intense follow thru happens

Squares #1 thru #4 are solid hits (green arrow) on a stock scanned thru with this.

Yellow line is SMA

Great work Joshua, great idea Oleron, it will kill

ADoD < - - - - #1 Image

image #2 <-----
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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