OPEN-SOURCE SCRIPT
Candle Majick - Booby Trap Detector mk1

CANDLE MAJICK - BOOBY TRAP DETECTOR mk1
INTRODUCTION
Candle Majick - Booby Trap Detector mk1 is an educational market-context indicator that evaluates apparent bullish and bearish reversal candles as developing hypotheses rather than automatic trade signals.
A reversal candle can look persuasive while still forming in a location where the market has not completed the structural work normally needed to support a genuine turn. This script was designed to examine that distinction.
Instead of asking only, “Is this a hammer, engulfing candle, pin bar, outside reversal, morning star, or evening star?”, the indicator asks a more useful question:
Has the surrounding market context earned the reversal thesis, or is the candle vulnerable to becoming a continuation trap?
WHAT THE SCRIPT ANALYZES
The indicator combines candle geometry with several independent context layers:
• Named intraday key-level zones:
- Previous-Day High and Low
- Developing Session High and Low
- Session VWAP
- Nearest configured Round Number
• Named swing key-level zones:
- Previous-Week High and Low
- Previous-Month High and Low
- Confirmed Swing High and Low
- Two optional user-defined manual levels
• Key-level distance and confluence
• Repeated-level testing and level-fatigue proxy
• Nearby confirmed swing references that may represent probable unswept liquidity
• Round-number surface-bounce behavior
• Relative-volume and true-range expansion used as a News-Like Event Proxy
• Three configurable higher-timeframe trend contexts:
- Tactical
- Structural
- Macro
• Persistent candidate memory
• Early retail-trap warnings
• Confirmed reversal-failure events
HOW THE ENGINE WORKS
1. A supported reversal pattern is detected.
2. The pattern receives a raw geometry score based on measurable candle proportions.
3. Setup quality is adjusted according to location. A strong-looking candle that forms away from every enabled key level is downgraded.
4. Trap risk is calculated from contextual warnings, including poor location, nearby unswept swing references, repeated testing, round-number behavior, abnormal expansion, and higher-timeframe contradiction.
5. The candidate is preserved for a configurable evaluation window rather than being recreated on every bar.
6. A WARN event can appear when the reversal candle is contextually vulnerable but has not yet failed.
7. A confirmed BT event appears only when price later violates the stored reversal thesis.
This separation matters. A warning is not treated as a confirmed trap, and candle geometry is not treated as reversal proof.
HOW TO USE
Apply the indicator to the chart timeframe used for execution.
Configure the three higher timeframes so they represent the context relevant to your trading horizon. For example, a lower-timeframe trader may use 15 minutes, 1 hour, and 4 hours.
Keep the named zones visible while learning the chart map. The script can display abbreviated names such as PDH, PDL, PWH, PWL, PMH, PML, SH, SL, VWAP, and RN, or spell the names out fully.
The available chart-label modes are:
• Off — hides event labels.
• Stealth — shows confirmed booby traps only.
• Icon Only — uses minimal symbols while preserving hover explanations.
• Compact — shows short event codes and associated higher timeframes.
• Verbose — prints classifications, scores, and higher-timeframe conflict directly on the chart.
Interpret the events as follows:
• Grey candidate marker:
A reversal pattern has been detected. This is an observation, not an entry signal.
• WARN:
Contextual trap risk is elevated, but the candidate has not yet been invalidated.
• BT:
The stored reversal thesis failed during its evaluation window.
Hover over labels for the exact reasons that contributed to the event.
WHY THIS SCRIPT IS VALUABLE
Many candlestick scanners stop at pattern recognition. That can encourage traders to react to appearance without evaluating location, unfinished liquidity work, repeated level testing, abnormal expansion, or higher-timeframe continuation pressure.
Candle Majick - Booby Trap Detector mk1 is designed to fill that gap.
Its value is not that it finds more reversal candles. Its value is that it:
• downgrades unsupported reversal setups;
• distinguishes warnings from confirmed failures;
• preserves the original candidate context;
• associates trap events with three higher-timeframe regimes;
• provides named key-level zones for faster chart cognition;
• and explains why a candle received its classification.
ORIGINALITY AND SOURCE DISCLOSURE
This implementation was independently written for this project in Pine Script v6.
No third-party or previously published Pine source code was copied, adapted, translated, or incorporated into this implementation. The script uses TradingView’s documented Pine built-ins, standard mathematical operations, and original project-specific logic for candidate memory, scoring, key-level zoning, higher-timeframe context, event classification, visual presentation, and explanations.
EDUCATIONAL TOOLTIP NOTICE
The tooltips are included for education, transparency, and auditability. They explain which measured facts and explicitly identified proxies contributed to a warning or trap classification.
The tooltips are not advertising, financial advice, performance guarantees, or claims of predictive certainty.
IMPORTANT LIMITATIONS
This script does not have direct access to:
• resting orders;
• institutional intent;
• real stop orders;
• confirmed economic-news causation;
• bid/ask delta;
• cumulative volume delta;
• footprint imbalance;
• or market-by-order data.
Accordingly, terms such as Probable Liquidity, News-Like Event, Level Fatigue, and Trap Risk describe analytical proxies—not directly observed order-flow facts.
Higher-timeframe requests use lookahead disabled for trend calculations. Swing references use confirmed pivots. Candidate markers remain on their original bars, while warnings and confirmed failures appear only when those events are observed.
This indicator is an analytical and educational tool. It should be combined with independent judgment, risk management, and appropriate market knowledge.
INTRODUCTION
Candle Majick - Booby Trap Detector mk1 is an educational market-context indicator that evaluates apparent bullish and bearish reversal candles as developing hypotheses rather than automatic trade signals.
A reversal candle can look persuasive while still forming in a location where the market has not completed the structural work normally needed to support a genuine turn. This script was designed to examine that distinction.
Instead of asking only, “Is this a hammer, engulfing candle, pin bar, outside reversal, morning star, or evening star?”, the indicator asks a more useful question:
Has the surrounding market context earned the reversal thesis, or is the candle vulnerable to becoming a continuation trap?
WHAT THE SCRIPT ANALYZES
The indicator combines candle geometry with several independent context layers:
• Named intraday key-level zones:
- Previous-Day High and Low
- Developing Session High and Low
- Session VWAP
- Nearest configured Round Number
• Named swing key-level zones:
- Previous-Week High and Low
- Previous-Month High and Low
- Confirmed Swing High and Low
- Two optional user-defined manual levels
• Key-level distance and confluence
• Repeated-level testing and level-fatigue proxy
• Nearby confirmed swing references that may represent probable unswept liquidity
• Round-number surface-bounce behavior
• Relative-volume and true-range expansion used as a News-Like Event Proxy
• Three configurable higher-timeframe trend contexts:
- Tactical
- Structural
- Macro
• Persistent candidate memory
• Early retail-trap warnings
• Confirmed reversal-failure events
HOW THE ENGINE WORKS
1. A supported reversal pattern is detected.
2. The pattern receives a raw geometry score based on measurable candle proportions.
3. Setup quality is adjusted according to location. A strong-looking candle that forms away from every enabled key level is downgraded.
4. Trap risk is calculated from contextual warnings, including poor location, nearby unswept swing references, repeated testing, round-number behavior, abnormal expansion, and higher-timeframe contradiction.
5. The candidate is preserved for a configurable evaluation window rather than being recreated on every bar.
6. A WARN event can appear when the reversal candle is contextually vulnerable but has not yet failed.
7. A confirmed BT event appears only when price later violates the stored reversal thesis.
This separation matters. A warning is not treated as a confirmed trap, and candle geometry is not treated as reversal proof.
HOW TO USE
Apply the indicator to the chart timeframe used for execution.
Configure the three higher timeframes so they represent the context relevant to your trading horizon. For example, a lower-timeframe trader may use 15 minutes, 1 hour, and 4 hours.
Keep the named zones visible while learning the chart map. The script can display abbreviated names such as PDH, PDL, PWH, PWL, PMH, PML, SH, SL, VWAP, and RN, or spell the names out fully.
The available chart-label modes are:
• Off — hides event labels.
• Stealth — shows confirmed booby traps only.
• Icon Only — uses minimal symbols while preserving hover explanations.
• Compact — shows short event codes and associated higher timeframes.
• Verbose — prints classifications, scores, and higher-timeframe conflict directly on the chart.
Interpret the events as follows:
• Grey candidate marker:
A reversal pattern has been detected. This is an observation, not an entry signal.
• WARN:
Contextual trap risk is elevated, but the candidate has not yet been invalidated.
• BT:
The stored reversal thesis failed during its evaluation window.
Hover over labels for the exact reasons that contributed to the event.
WHY THIS SCRIPT IS VALUABLE
Many candlestick scanners stop at pattern recognition. That can encourage traders to react to appearance without evaluating location, unfinished liquidity work, repeated level testing, abnormal expansion, or higher-timeframe continuation pressure.
Candle Majick - Booby Trap Detector mk1 is designed to fill that gap.
Its value is not that it finds more reversal candles. Its value is that it:
• downgrades unsupported reversal setups;
• distinguishes warnings from confirmed failures;
• preserves the original candidate context;
• associates trap events with three higher-timeframe regimes;
• provides named key-level zones for faster chart cognition;
• and explains why a candle received its classification.
ORIGINALITY AND SOURCE DISCLOSURE
This implementation was independently written for this project in Pine Script v6.
No third-party or previously published Pine source code was copied, adapted, translated, or incorporated into this implementation. The script uses TradingView’s documented Pine built-ins, standard mathematical operations, and original project-specific logic for candidate memory, scoring, key-level zoning, higher-timeframe context, event classification, visual presentation, and explanations.
EDUCATIONAL TOOLTIP NOTICE
The tooltips are included for education, transparency, and auditability. They explain which measured facts and explicitly identified proxies contributed to a warning or trap classification.
The tooltips are not advertising, financial advice, performance guarantees, or claims of predictive certainty.
IMPORTANT LIMITATIONS
This script does not have direct access to:
• resting orders;
• institutional intent;
• real stop orders;
• confirmed economic-news causation;
• bid/ask delta;
• cumulative volume delta;
• footprint imbalance;
• or market-by-order data.
Accordingly, terms such as Probable Liquidity, News-Like Event, Level Fatigue, and Trap Risk describe analytical proxies—not directly observed order-flow facts.
Higher-timeframe requests use lookahead disabled for trend calculations. Swing references use confirmed pivots. Candidate markers remain on their original bars, while warnings and confirmed failures appear only when those events are observed.
This indicator is an analytical and educational tool. It should be combined with independent judgment, risk management, and appropriate market knowledge.
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.