OPEN-SOURCE SCRIPT
Market + Direction + Entry + Hold + Exit v1.5 FINAL

Overview
This script is a complete trend-based trading framework designed to filter market conditions, determine directional bias, detect high-quality pullback entries, manage active trades, and identify trend-weakening exit points.
It is optimized for NQ futures, Gold (XAUUSD), and Bitcoin, with adaptive parameters for each asset.
The logic focuses on trading only when conditions are favorable, aligning entries with the primary trend, and avoiding low-probability setups.
1. Market Condition Filter
Before any signal appears, the script checks whether the market is active using three conditions:
ATR compared to ATR moving average (volatility condition)
Volume compared to average volume (liquidity condition)
Price distance from VWAP (suppression of mean-reversion environments)
A trade environment is considered active when at least two of these three conditions are positive.
2. Trend Direction Filter
Directional bias is defined by:
EMA21 relative to EMA55
Price relative to VWAP
Heikin-Ashi structure
When these conditions align, the script switches into long-only or short-only mode.
No counter-trend signals are displayed.
3. Entry Logic (L, L2, L3 and S, S2, S3)
The system identifies pullback entries within a confirmed trend.
Long entries require:
Uptrend confirmation
Price dipping toward EMA21 or EMA55
A constructive Heikin-Ashi candle
Market environment active
Short entries mirror the same structure in bearish conditions.
Re-entries (L2, L3, S2, S3) are given only if the trend remains intact after the first entry.
4. Hold Logic
A hold signal appears if momentum remains aligned with the trend.
Momentum is evaluated using the Stochastic indicator (K and D lines).
5. Exit Logic
An exit signal appears when:
The recent structural low (for longs) or high (for shorts) is broken, and
The EMA slope indicates weakening trend strength
This combination identifies high-probability trend exhaustion.
How to Use
Add the script to your chart.
Select an asset preset (NQ, GOLD, BTC).
Wait for the market to be active.
Follow the entry signals (L, L2, L3 or S, S2, S3).
Hold signals help confirm continuation.
Exit signals indicate potential trend reversal or weakness.
Feature Summary
Market environment filter
Trend direction filter
Pullback-based entry system
Multi-stage re-entry framework
Momentum-based hold signal
Structure-based exit
Asset-adaptive parameters
Clean chart visualization
Disclaimer
This script is for research and educational use.
It does not constitute financial advice.
Always backtest before using in live markets.
개요
이 스크립트는 시장 상태 필터링, 추세 방향 판단, 고품질 눌림목 진입, 보유 판단, 추세 약화 기반 청산까지 모두 포함하는 완전한 트레이딩 프레임워크입니다.
NQ, 골드(XAUUSD), 비트코인에 맞게 최적화되어 있습니다.
1. 시장 필터
다음 세 가지 중 두 가지 이상이 충족될 때만 매매 환경을 ‘활성’으로 판단합니다.
ATR 기준 변동성 체크
거래량 활성도 체크
가격의 VWAP 거리 체크
2. 방향(추세) 필터
다음 조건을 기반으로 상승·하락 추세를 결정합니다.
EMA21 vs EMA55
가격 vs VWAP
Heikin-Ashi 구조
이 조건이 일치할 때만 롱 전용 또는 숏 전용 모드로 진입합니다.
3. 진입 로직
추세가 유지되는 상태에서 EMA21 또는 EMA55까지 눌림이 나올 때
L 또는 S 신호를 제공합니다.
추세가 유지되면 L2/L3, S2/S3 재진입 신호가 추가로 발생합니다.
4. 보유(Hold)
모멘텀이 추세 방향과 일치할 때 보유 신호를 제공합니다.
5. 청산(Exit)
다음 두 조건이 동시에 나타날 때 청산 신호가 표시됩니다.
직전 구조(스윙)가 붕괴될 때
EMA 기울기가 약화될 때
사용 방법
차트에 스크립트를 추가합니다.
자산 프리셋(NQ, GOLD, BTC)을 선택합니다.
시장이 활성일 때만 신호를 참고합니다.
L/S 진입 신호와 보유/청산 신호를 활용해 매매 흐름을 관리합니다.
This script is a complete trend-based trading framework designed to filter market conditions, determine directional bias, detect high-quality pullback entries, manage active trades, and identify trend-weakening exit points.
It is optimized for NQ futures, Gold (XAUUSD), and Bitcoin, with adaptive parameters for each asset.
The logic focuses on trading only when conditions are favorable, aligning entries with the primary trend, and avoiding low-probability setups.
1. Market Condition Filter
Before any signal appears, the script checks whether the market is active using three conditions:
ATR compared to ATR moving average (volatility condition)
Volume compared to average volume (liquidity condition)
Price distance from VWAP (suppression of mean-reversion environments)
A trade environment is considered active when at least two of these three conditions are positive.
2. Trend Direction Filter
Directional bias is defined by:
EMA21 relative to EMA55
Price relative to VWAP
Heikin-Ashi structure
When these conditions align, the script switches into long-only or short-only mode.
No counter-trend signals are displayed.
3. Entry Logic (L, L2, L3 and S, S2, S3)
The system identifies pullback entries within a confirmed trend.
Long entries require:
Uptrend confirmation
Price dipping toward EMA21 or EMA55
A constructive Heikin-Ashi candle
Market environment active
Short entries mirror the same structure in bearish conditions.
Re-entries (L2, L3, S2, S3) are given only if the trend remains intact after the first entry.
4. Hold Logic
A hold signal appears if momentum remains aligned with the trend.
Momentum is evaluated using the Stochastic indicator (K and D lines).
5. Exit Logic
An exit signal appears when:
The recent structural low (for longs) or high (for shorts) is broken, and
The EMA slope indicates weakening trend strength
This combination identifies high-probability trend exhaustion.
How to Use
Add the script to your chart.
Select an asset preset (NQ, GOLD, BTC).
Wait for the market to be active.
Follow the entry signals (L, L2, L3 or S, S2, S3).
Hold signals help confirm continuation.
Exit signals indicate potential trend reversal or weakness.
Feature Summary
Market environment filter
Trend direction filter
Pullback-based entry system
Multi-stage re-entry framework
Momentum-based hold signal
Structure-based exit
Asset-adaptive parameters
Clean chart visualization
Disclaimer
This script is for research and educational use.
It does not constitute financial advice.
Always backtest before using in live markets.
개요
이 스크립트는 시장 상태 필터링, 추세 방향 판단, 고품질 눌림목 진입, 보유 판단, 추세 약화 기반 청산까지 모두 포함하는 완전한 트레이딩 프레임워크입니다.
NQ, 골드(XAUUSD), 비트코인에 맞게 최적화되어 있습니다.
1. 시장 필터
다음 세 가지 중 두 가지 이상이 충족될 때만 매매 환경을 ‘활성’으로 판단합니다.
ATR 기준 변동성 체크
거래량 활성도 체크
가격의 VWAP 거리 체크
2. 방향(추세) 필터
다음 조건을 기반으로 상승·하락 추세를 결정합니다.
EMA21 vs EMA55
가격 vs VWAP
Heikin-Ashi 구조
이 조건이 일치할 때만 롱 전용 또는 숏 전용 모드로 진입합니다.
3. 진입 로직
추세가 유지되는 상태에서 EMA21 또는 EMA55까지 눌림이 나올 때
L 또는 S 신호를 제공합니다.
추세가 유지되면 L2/L3, S2/S3 재진입 신호가 추가로 발생합니다.
4. 보유(Hold)
모멘텀이 추세 방향과 일치할 때 보유 신호를 제공합니다.
5. 청산(Exit)
다음 두 조건이 동시에 나타날 때 청산 신호가 표시됩니다.
직전 구조(스윙)가 붕괴될 때
EMA 기울기가 약화될 때
사용 방법
차트에 스크립트를 추가합니다.
자산 프리셋(NQ, GOLD, BTC)을 선택합니다.
시장이 활성일 때만 신호를 참고합니다.
L/S 진입 신호와 보유/청산 신호를 활용해 매매 흐름을 관리합니다.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.