StockFetcher Forums · General Discussion · Bullish or Bearish divergence<< >>Post Follow-up
nkhaladkar
5 posts
msg #162159
Ignore nkhaladkar
9/6/2026 10:41:31 PM

Hello,

Has anyone written a filter that would identify a positive or a negative divergence between the price trend and the corresponding indicator (RSI, MACD, etc.) over a specified period? For example, if over a period of 30 days, stock XYZ has been trending lower, while the indicator-MACD has been rising, resulting in a positive divergence between the the two, This may suggest a potential upside reversal of the price trend. Similarly, a negative divergence, meaning rising prices and dropping MACD values would suggest a potential downside price reversal.

Any suggestions from the Forum to write such a filter would be greatly appreciated.

Nick K.


xarlor
647 posts
msg #162160
Ignore xarlor
9/8/2026 8:08:27 AM

This should get you started. You can increase the 0 value depending on how pronounced you want the trend.

Fetcher[
30 day slope of close < 0
30 day slope of MACD Slow Line(12,26,9) > 0
MACD Fast Line(12,26,9) > MACD Slow Line(12,26,9)
]



StockFetcher Forums · General Discussion · Bullish or Bearish divergence<< >>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 2026 - 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.