Prior Month Low Scanner

BrianPaul

New member
Hi,

Does anyone have or can make me a simple scanner that shows stocks that have just hit the prior month low? I would like to know when it happens as it seems to be a pretty solid reversal signal for small caps...

Thanks
 
Solution
On daily data:

Ruby:
input WithinDays = 5;
def Month = GetMonth();
def MonthlyLow; def PriorMonth;
if Month != Month[1] {
    MonthlyLow = low;
    PriorMonth = MonthlyLow[1];
} else {
    MonthlyLow =
        if low < MonthlyLow[1] then Low
        else MonthlyLow[1]
    ;
    PriorMonth = PriorMonth[1];
}
plot Scan =
    Sum(crosses(Low,PriorMonth,CrossingDirection.BELOW),WithinDays) > No
;

Add this to the bottom to see how it works more visually on a chart:

Code:
plot x = priormonth;
x.setPaintingStrategy(paintingStrategy.HORIZONTAL);
Scan.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);

Pre-market may be an issue. I am not sure how much intraday data is available to the scanner. The table in the documentation is no longer...
Yes, that is fairly easy, but it is complicated at the same time. It is extremely unlikely for the current price to at the exact same price as the prior monthly low when the scan is run. Therefore, you need to come up with additional rules regarding how you detect this. Crossing below the prior monthly low is one way. You could also create a +/- threshold in the area of the prior monthly low, and require current prices to be within that zone, and so on. Depending on the method, timing may come into play. Just for example, you might not want results which have been below the prior monthly low for like two weeks already, but rather, prefer only those which just crossed today.

I would need more detailed specifications on how you would like to handle such things, otherwise, the code is relatively easy.
 
Yes, that is fairly easy, but it is complicated at the same time. It is extremely unlikely for the current price to at the exact same price as the prior monthly low when the scan is run. Therefore, you need to come up with additional rules regarding how you detect this. Crossing below the prior monthly low is one way. You could also create a +/- threshold in the area of the prior monthly low, and require current prices to be within that zone, and so on. Depending on the method, timing may come into play. Just for example, you might not want results which have been below the prior monthly low for like two weeks already, but rather, prefer only those which just crossed today.

I would need more detailed specifications on how you would like to handle such things, otherwise, the code is relatively easy.
I think anything that has crossed below in the last 5 days. wouldn’t that be enough extra criteria to get a basic scan? I would just rerun the scan every morning. Ideally it considers premarket transactions below the monthly low as well. Please let me know what else if anything you would need. I can add other filters like price, market cap, etc later myself.
 
On daily data:

Ruby:
input WithinDays = 5;
def Month = GetMonth();
def MonthlyLow; def PriorMonth;
if Month != Month[1] {
    MonthlyLow = low;
    PriorMonth = MonthlyLow[1];
} else {
    MonthlyLow =
        if low < MonthlyLow[1] then Low
        else MonthlyLow[1]
    ;
    PriorMonth = PriorMonth[1];
}
plot Scan =
    Sum(crosses(Low,PriorMonth,CrossingDirection.BELOW),WithinDays) > No
;

Add this to the bottom to see how it works more visually on a chart:

Code:
plot x = priormonth;
x.setPaintingStrategy(paintingStrategy.HORIZONTAL);
Scan.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);

Pre-market may be an issue. I am not sure how much intraday data is available to the scanner. The table in the documentation is no longer accurate. I would have to run a few tests.
 
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
377 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