StockFetcher Forums · General Discussion · Bear flag<< >>Post Follow-up
1up1down
1 posts
msg #161658
Ignore 1up1down
3/12/2025 6:31:52 AM

Hello all, Interesting markets! I'm trying to write a filter for a bear flag, and not having much luck.
Here it is:
show all stocks that had new 12 week low 4 days ago and low 3 days ago was < 1.5% above low 4 days ago and low 3 days ago was < 1.5% below low 2 days ago and low 2 days ago was < 1.5% above low 3 days ago and low 2 days ago was < 1.5% below low 3 days ago and low 1 day ago was < 1.5% above low 2 days ago and low 1 day ago was < 1.5% below low 2 days ago and low today was < 1.5% above low 1 day ago and low today is < 2% below low 1 day ago and low 4 days ago was > $10.

Anyone have a better way to do this?

xarlor
592 posts
msg #161660
Ignore xarlor
3/12/2025 9:14:31 AM

I *think* this is what you're going for, but not entirely certain.

Fetcher[
low reached a new 12-week low 4 days ago
low 3 days ago < 1.5% above low 4 days ago
low 3 days ago < 1.5% below low 4 days ago
low 2 days ago < 1.5% above low 3 days ago
low 2 days ago < 1.5% below low 3 days ago
low 1 day ago < 1.5% above low 2 days ago
low 1 day ago < 1.5% below low 2 days ago
low today < 1.5% above low 1 day ago
low today < 2% below low 1 day ago
low 4 days ago > 10
]



TheRumpledOne
6,498 posts
msg #161663
Ignore TheRumpledOne
3/12/2025 1:13:38 PM

ChatGPT:

write a stockfetcher filter for bear flag

ChatGPT said:
A bear flag is a continuation pattern that occurs after a strong downward price move, followed by a consolidation (flag), and then a potential continuation downward. Below is a StockFetcher filter to scan for bear flag patterns:

Fetcher[
/*StockFetcher Bear Flag Scan Identify strong downward move (Flagpole) */

close dropped more than 10% over the last 5 days
and average volume(10) is above 100000

/* Identify consolidation (Flag) */
and close is above lower bollinger band(20)
and close is below upper bollinger band(20)
and close is within 10% of the 5-day high
and close is above the lowest close in the last 5 days

/* Ensure the stock is still in a downtrend */
and ma(20) is below ma(50)
and ma(50) is below ma(200)

/* Sort results by the highest volume */
sort by volume descending
]




Explanation of the Criteria:
Strong Downward Move: Price drops at least 10% over the last 5 days, ensuring a sharp decline.
Consolidation: Price remains between Bollinger Bands (20) and within 10% of the 5-day high, forming the "flag."
Overall Downtrend: Moving averages confirm the bearish trend (MA20 < MA50 < MA200).
Liquidity Filter: Ensures average volume is above 100,000 to avoid illiquid stocks.

StockFetcher Forums · General Discussion · Bear flag<< >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.