1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
46 lines of Pine Script v6 from mt5/TF_BIAS_DETECTOR.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.
TF_BIAS_DETECTOR.pine
//@version=6
indicator("TF Bias Detector (SMC)", overlay=false)
// Capture la tendance via EMA sur 4 timeframes
// H4, H1, M15, M1
// RSI pour détecter la tendance
rsi_h4 = ta.rsi(close, 14)
rsi_h1 = request.security(syminfo.tickerid, "60", ta.rsi(close, 14))
rsi_m15 = request.security(syminfo.tickerid, "15", ta.rsi(close, 14))
rsi_m1 = ta.rsi(close, 14)
// EMA pour la direction
ema_h4 = ta.ema(close, 20)
ema_h1 = request.security(syminfo.tickerid, "60", ta.ema(close, 20))
ema_m15 = request.security(syminfo.tickerid, "15", ta.ema(close, 20))
ema_m1 = ta.ema(close, 20)
// Calcul direction (1 = bullish, -1 = bearish)
bias_h4 = close > ema_h4 ? 1 : -1
bias_h1 = close > ema_h1 ? 1 : -1
bias_m15 = close > ema_m15 ? 1 : -1
bias_m1 = close > ema_m1 ? 1 : -1
// Plot les tendances
plot(rsi_h4, "RSI H4", color.blue, linewidth=2)
plot(rsi_h1, "RSI H1", color.orange, linewidth=2)
plot(rsi_m15, "RSI M15", color.green, linewidth=2)
plot(rsi_m1, "RSI M1", color.red, linewidth=2)
// Alertes niveau 50
hline(50, "Mid", color.gray, linestyle.dashed)
hline(70, "Overbought", color.red, linestyle.dotted)
hline(30, "Oversold", color.green, linestyle.dotted)
// Export data window
plotchar(bias_h4, "Bias_H4", "", location.top, size=size.tiny)
plotchar(bias_h1, "Bias_H1", "", location.top, size=size.tiny)
plotchar(bias_m15, "Bias_M15", "", location.top, size=size.tiny)
plotchar(bias_m1, "Bias_M1", "", location.top, size=size.tiny)
// Affiche les valeurs en data window
plotchar(rsi_h4, "RSI_H4_Val", "", location.top)
plotchar(rsi_h1, "RSI_H1_Val", "", location.top)
plotchar(rsi_m15, "RSI_M15_Val", "", location.top)
plotchar(rsi_m1, "RSI_M1_Val", "", location.top)
Overview
TF Bias Detector (SMC) plots four 14-period RSI curves in a separate pane alongside 30, 50, and 70 reference levels. Directional bias values are calculated by comparing price to a 20-period EMA on each timeframe and exported alongside RSI values to the Data Window for integration with external trading systems. The script contains no user-adjustable inputs, and the M1 and H4 series directly sample the current chart resolution.
Multi-timeframe RSI tracking across four horizons
EMA-based directional bias calculation
Overbought, oversold, and midpoint reference levels
Data Window outputs designed for external bot consumption
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
The Derivative Oscillator calculates a double-exponentially smoothed Relative Strength Index (RSI) and subtracts its Simple Moving Average (SMA) to form the main oscillator line. A secondary signal line is plotted using an SMA of the main oscillator values. Th
This indicator calculates a modified MACD oscillator and signal line alongside a trend EMA filter, plotting the output as a stylized column histogram in a separate pane. Instead of plotting true MACD distance, it quantifies positive and negative histogram mome
This indicator calculates and plots the standard Moving Average Convergence Divergence oscillator in a separate pane. It computes the difference between a fast and slow moving average, derives a signal line through smoothing, and plots a histogram representing
MACD-V is a volatility-normalized momentum indicator based on research by Alex Spiroglou. It calculates the standard MACD histogram and normalizes it by dividing by the Average True Range (ATR). Plotted in a separate pane as a colored histogram, it includes us
Multi-Timeframe Analysis Suite calculates trend direction and momentum conditions across five user-selected timeframes using moving averages, RSI, and Stochastic oscillators. It evaluates moving average slope and oscillator levels to compute trend alignment, m
KamaFama is an indicator that translates a Freqtrade trading strategy into Pine Script for visualization. It combines Kaufman Adaptive Moving Average (KAMA), MAMA/FAMA calculations derived via Hilbert Transform, Williams %R, and correlation trend filters to ev