OPEN-SOURCE SCRIPT
Spira Alligator

This is an trend-following pullback system inspired by Bill Williams’ Alligator, but built to operate as a purely mechanical signal system. It’s designed for traders who want to:
Follow the main trend
Buy or sell on pullbacks back into the trend
Use simple, visual logic without having to interpret too many “subtle” patterns
How it works
The Alligator lines (Lips, Teeth, Jaw) visualize trend direction and strength.
A separate trend line (default EMA 144) is used as a long-term trend filter.
The system detects a pullback back to the Teeth (Lips crosses once against the trend and then crosses back), but only when price is on the correct side of the trend line.
When the conditions are met, it prints:
A BUY signal when price is above the trend line
A SELL signal when price is below the trend line
How to use it
Add Spira Alligator to TradingView and enable the line + signal display.
Use BUY signals as candidate entries in an uptrend (price above the trend line).
Use SELL signals as candidate entries in a downtrend (price below the trend line).
Use the background color to quickly spot when an active signal event occurs.
This logic is meant as a starting point—add your own risk management (stop-loss, take-profit, confluence with other indicators) as needed.
Important notes
This is not the classic Alligator approach, but a systematic variation that produces clear, mechanical signals.
It’s made for testing and experimentation, and is especially suitable for trend-following traders who prefer simple but robust logic.
Follow the main trend
Buy or sell on pullbacks back into the trend
Use simple, visual logic without having to interpret too many “subtle” patterns
How it works
The Alligator lines (Lips, Teeth, Jaw) visualize trend direction and strength.
A separate trend line (default EMA 144) is used as a long-term trend filter.
The system detects a pullback back to the Teeth (Lips crosses once against the trend and then crosses back), but only when price is on the correct side of the trend line.
When the conditions are met, it prints:
A BUY signal when price is above the trend line
A SELL signal when price is below the trend line
How to use it
Add Spira Alligator to TradingView and enable the line + signal display.
Use BUY signals as candidate entries in an uptrend (price above the trend line).
Use SELL signals as candidate entries in a downtrend (price below the trend line).
Use the background color to quickly spot when an active signal event occurs.
This logic is meant as a starting point—add your own risk management (stop-loss, take-profit, confluence with other indicators) as needed.
Important notes
This is not the classic Alligator approach, but a systematic variation that produces clear, mechanical signals.
It’s made for testing and experimentation, and is especially suitable for trend-following traders who prefer simple but robust logic.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Spira Scalper
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Spira Scalper
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.