This TradingView Pine Script indicator is designed to analyze market trends across multiple timeframes—4-hour, 1-hour, and 15-minute charts—to identify bullish and bearish trends, entry/exit points, and key support/resistance levels.
1. Inputs & Timeframe Selection The script requests data from three different timeframes:
4-hour (240 min) 1-hour (60 min) 15-minute (15 min) It processes moving averages, RSI values, and price action from these timeframes to determine trend strength and market direction.
2. Trend Analysis Using Moving Averages A 50-period Simple Moving Average (SMA) is calculated for each timeframe. If the 15-minute SMA is above the 1-hour SMA and the 1-hour SMA is above the 4-hour SMA, this indicates a strong bullish trend. Conversely, if the 15-minute SMA is below the 1-hour SMA and the 1-hour SMA is below the 4-hour SMA, it signals a bearish trend. 3. Momentum Confirmation Using RSI (Relative Strength Index) The RSI (14-period) is calculated for each timeframe. If the 15-minute RSI is above 50, it supports a bullish trend. If the 15-minute RSI is below 50, it confirms a bearish trend. 4. Entry & Exit Conditions The script uses crossovers of moving averages for buy/sell signals:
Buy Signal (Long Entry): When the 15-minute SMA crosses above the 1-hour SMA while confirming a bullish trend. Sell Signal (Short Entry): When the 15-minute SMA crosses below the 1-hour SMA while confirming a bearish trend. Exit Conditions: Exit Long: If the 15-minute SMA crosses below the 1-hour SMA. Exit Short: If the 15-minute SMA crosses above the 1-hour SMA. Buy signals are marked in green, sell signals in red, and exits in blue/orange.
5. Support & Resistance Levels The script identifies key support and resistance levels for each timeframe:
Support Levels: Lowest price over the last 50 bars for 4-hour, 1-hour, and 15-minute timeframes. Resistance Levels: Highest price over the last 50 bars for 4-hour, 1-hour, and 15-minute timeframes. Each support and resistance level is plotted in different colors:
4-Hour Levels: Blue 1-Hour Levels: Green 15-Minute Levels: Purple 6. Visual Representation Buy & Sell Markers: Green "BUY" labels appear below the candles for long entries. Red "SELL" labels appear above the candles for short entries. Exit Markers: Blue and orange "X" markers indicate exit points. Support & Resistance Lines: Clearly plotted on the chart for traders to recognize major price levels. How This Indicator Helps Traders Multi-timeframe analysis for a better market perspective. Trend confirmation using moving averages and RSI. Clear buy/sell signals to assist in trade execution. Support/resistance plotting for better decision-making. This script is useful for intraday and swing traders who rely on multiple timeframes for trade confirmation.