OPEN-SOURCE SCRIPT

Buy Sell Magic Rework

325
📌 Purpose
This script is a reworked version of the Parabolic SAR strategy, with an optional ZigZag filter to confirm reversal points.
It helps traders identify potential trend reversals with reduced noise compared to the standard SAR.

🧠 How It Works
1. Parabolic SAR Flip Signals
Buy Signal: Triggered when SAR flips from above price to below price.

Sell Signal: Triggered when SAR flips from below price to above price.
(Default SAR parameters: Start = 0.02, Increment = 0.02, Max = 0.2)

2. ZigZag Filter (Optional)
When Use ZigZag Filter = true:

The script confirms reversals only at significant pivots (swing highs/lows) detected by the ZigZag algorithm over the selected ZigZag Period (default = 14 bars).

Buy Signal: Appears only when a new pivot low is detected.

Sell Signal: Appears only when a new pivot high is detected.

3. Trade-Off
Without ZigZag: More signals, more noise.

With ZigZag: Fewer signals, but stronger confirmation and reduced false entries.

📈 How to Use
Signals appear as green arrows for buy and red arrows for sell.

Works well for:

Trend reversal detection.

Swing trading confirmation.

Filtering entries for other systems.

Recommended Timeframes: 15m, 1h, 4h.
Markets: Forex, Crypto, Stocks.

⚙️ Inputs
ZigZag Period (bars for pivot detection)

SAR Start / Increment / Max (SAR parameters)

Use ZigZag Filter (toggle for confirmation)

⚠️ Disclaimer
This script is for educational purposes only. It does not constitute financial advice.
Always test thoroughly before live trading.

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.