OPEN-SOURCE SCRIPT

Custom SMA Crossover Strategy with Text Signals

144
Custom SMA Crossover Strategy with Text Signals
This indicator combines three simple moving averages (9, 21, and 100 periods) to generate trading signals with clear visual feedback:

Core Logic

Buy Signal: When price is above 100 SMA + 9 SMA crosses above 21 SMA

Sell Signal: When price is below 100 SMA + 9 SMA crosses below 21 SMA

Visual Features

Colored 100 SMA (green=price above, red=price below)

Gradient fill between 9/21 SMAs (green=uptrend, red=downtrend)

Clear "BUY"/"SELL" labels with directional arrows

Background highlighting on signal bars

Practical Benefits

Prevents consecutive signals until opposite condition occurs

Automatic label cleanup (max 50 visible signals)

Ready-to-use price alerts for automation

Clean chart integration with adjustable SMA lengths

Usage
Identifies trend-confirmed entries:

100 SMA acts as trend filter

9/21 SMA crossover provides entry timing

Ideal for swing trading and trend following strategies

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.