OPEN-SOURCE SCRIPT

Chart Custom Period Scanner

91
How it Works
1. The Scanner (Inputs): The script defaults to a 20-bar lookback. This means it scans the last 20 candles. You can change this to 50, 200, or any number you like in the settings menu.
2. The Logic:

* It calculates the Highest Price reached in that past period.
* It calculates the Lowest Price reached in that past period.
3. The Suggestion:
* BUY: If the current price breaks above the highest price of your past period, it suggests the trend is turning bullish.
* SELL: If the current price breaks below the lowest price of your past period, it suggests the trend is turning bearish.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.