OPEN-SOURCE SCRIPT
Timeframe Direction

This indicator automatically marks supply and demand zones across three timeframes — 1H, 4H, and Daily — and shows the trend bias (Buy / Sell / Flat) for each, all on a single chart.
Zone detection (classic method)
Zones are formed using the textbook supply/demand pattern: a small consolidation base (1–3 candles with tight bodies) followed by a strong departure candle measured against ATR. A bullish leg-out creates a green DEMAND zone; a bearish leg-out creates a red SUPPLY zone. Each zone is labeled with its source timeframe (1H, 4H, 1D), so you can instantly see which zones carry more weight.
Multi-timeframe trend bias
A corner table reads the EMA relationship (fast vs slow) on each timeframe and reports the directional bias as BUY, SELL, or FLAT — giving you 1H, 4H, and Daily context at a glance for top-down alignment.
Key features
Classic consolidation-plus-impulse zone logic, not just raw pivots
Simultaneous 1H, 4H, and Daily zones, each labeled
EMA-slope trend bias table for all three timeframes
Optional automatic removal of zones once price mitigates (returns into) them
Adjustable base-candle sensitivity, ATR leg multiple, EMA lengths, colors, and zone extension
Built-in alerts for 1H bias flips to Buy or Sell
How to use it
Look for trade setups where the lower-timeframe price reaches a higher-timeframe zone while the trend bias agrees — for example, price tapping a 4H/Daily demand zone while the 1H bias turns BUY. Tune the base body % and ATR multiple to match the volatility of your instrument.
This tool is for educational and analytical purposes only and is not financial advice. Always combine it with your own risk management.
Zone detection (classic method)
Zones are formed using the textbook supply/demand pattern: a small consolidation base (1–3 candles with tight bodies) followed by a strong departure candle measured against ATR. A bullish leg-out creates a green DEMAND zone; a bearish leg-out creates a red SUPPLY zone. Each zone is labeled with its source timeframe (1H, 4H, 1D), so you can instantly see which zones carry more weight.
Multi-timeframe trend bias
A corner table reads the EMA relationship (fast vs slow) on each timeframe and reports the directional bias as BUY, SELL, or FLAT — giving you 1H, 4H, and Daily context at a glance for top-down alignment.
Key features
Classic consolidation-plus-impulse zone logic, not just raw pivots
Simultaneous 1H, 4H, and Daily zones, each labeled
EMA-slope trend bias table for all three timeframes
Optional automatic removal of zones once price mitigates (returns into) them
Adjustable base-candle sensitivity, ATR leg multiple, EMA lengths, colors, and zone extension
Built-in alerts for 1H bias flips to Buy or Sell
How to use it
Look for trade setups where the lower-timeframe price reaches a higher-timeframe zone while the trend bias agrees — for example, price tapping a 4H/Daily demand zone while the 1H bias turns BUY. Tune the base body % and ATR multiple to match the volatility of your instrument.
This tool is for educational and analytical purposes only and is not financial advice. Always combine it with your own risk management.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.