OPEN-SOURCE SCRIPT

Semaphore

132
📌 Indicator Description: Semaphore
The Semaphore indicator plots three key moving averages on the current asset's price, allowing users to select between SMA (Simple Moving Average) or EMA (Exponential Moving Average), and to choose whether the calculation should be based on the daily timeframe or the current chart timeframe.

🔧 Customizable Parameters:
Moving average type: SMA or EMA.

Data source: Daily timeframe or current chart timeframe.

Fixed lengths: 10 (short-term), 21 (medium-term), and 50 (long-term).

🎯 What does it do?
Calculates and plots the three selected moving averages.

Automatically adapts to the chosen timeframe (e.g., display daily averages on a 1h chart).

Color-coded lines for easy visual distinction:

🔵 Blue for the 10-period MA

🟡 Yellow for the 21-period MA

🔴 Red for the 50-period MA

🌟 Benefits and Advantages:
Timeframe flexibility: Follow higher timeframe trends (daily) while trading on lower timeframes.

Clean and quick visual reference: With just three colored lines, you get a clear view of short, medium, and long-term trends.

Perfect for “traffic light” strategies: For example, all MAs aligned in one direction can indicate strong trend confirmation.

Universal use: Works seamlessly with any asset — stocks, crypto, forex, indices, and more.

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.