OPEN-SOURCE SCRIPT
Trinity Swing Trading Buy and Sell

This is a simple little Heiken Ashi MA + ADX & MACD trend-following trading system designed to capture medium- to longer-term moves while filtering out noise and weak trends. It combines modified Heiken Ashi candles (for smoother trend detection) with a moving average alignment, plus optional confirmation from ADX (trend strength) and MACD (momentum).
In practice, the indicator works well on higher timeframes (e.g., 1H, 4H, daily) where trends are more sustained. It performs best in trending markets and naturally avoids choppy/range-bound conditions thanks to the ADX filter (requiring ADX > 20 by default). All key components are fully customizable, so you can disable filters or adjust parameters to suit different instruments (stocks, forex, crypto, futures).
Default settings are:
16 HMA
8,17,9 MACD
15,20 ADX
Recommend to add an additional longer term EMA like 200 for long term trend confirmation.
Adjust inputs in the settings panel as needed:
Toggle MA, ADX, or MACD filters on/off.
Change MA type/length, MACD parameters, ADX threshold
- Use the visual blue diamonds (below bars) for long entries and purple diamonds (above bars) for short entries as confirmation of signals.
- Set alerts on the "Buy Alert" and "Sell Alert" conditions if you want real-time notifications.
This setup gives you a complete, rule-based system that avoids emotional trading and repetitive entries, making it suitable for both backtesting and live trading with proper risk management.
In practice, the indicator works well on higher timeframes (e.g., 1H, 4H, daily) where trends are more sustained. It performs best in trending markets and naturally avoids choppy/range-bound conditions thanks to the ADX filter (requiring ADX > 20 by default). All key components are fully customizable, so you can disable filters or adjust parameters to suit different instruments (stocks, forex, crypto, futures).
Default settings are:
16 HMA
8,17,9 MACD
15,20 ADX
Recommend to add an additional longer term EMA like 200 for long term trend confirmation.
Adjust inputs in the settings panel as needed:
Toggle MA, ADX, or MACD filters on/off.
Change MA type/length, MACD parameters, ADX threshold
- Use the visual blue diamonds (below bars) for long entries and purple diamonds (above bars) for short entries as confirmation of signals.
- Set alerts on the "Buy Alert" and "Sell Alert" conditions if you want real-time notifications.
This setup gives you a complete, rule-based system that avoids emotional trading and repetitive entries, making it suitable for both backtesting and live trading with proper risk management.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.