OPEN-SOURCE SCRIPT
ที่อัปเดต: CUSUM Core

A clean CUSUM-based market pressure and regime filter that tracks bullish and bearish directional pressure relative to a smoothed baseline. Designed to help traders separate trending pressure from noisy chop and use the output as a confirmation layer inside broader trading systems.
Vollbeschreibung
TradingMonster CUSUM Filter is a custom-built CUSUM-inspired regime and pressure tool designed to highlight directional market pressure in a clean and practical way.
Instead of acting as a standalone entry signal generator, this script is built to answer a more important question first:
Is there enough directional pressure in the market to justify taking the setup at all?
The script measures price deviation relative to a smoothed baseline, applies a volatility-adaptive drift component, and accumulates bullish and bearish pressure separately. This allows small, low-quality fluctuations to fade into the background while stronger directional pressure builds toward a meaningful regime shift.
The result is a simple but useful filter that can help reduce low-quality trades during choppy market conditions and improve context for trend-following or pullback-based systems.
Core Logic
The script works in four steps:
A smoothed baseline is calculated from price.
The deviation between price and the baseline is measured.
A volatility-based drift is subtracted to ignore smaller, less meaningful fluctuations.
Bullish and bearish pressure are accumulated separately until a threshold is exceeded.
When directional pressure grows large enough, the script marks a bullish or bearish regime.
What the script is built for
This script is intended for traders who want:
a market regime filter
a directional pressure filter
a cleaner way to avoid random chop
an additional confirmation layer for existing strategies
It is especially useful when combined with:
trend filters
pullback setups
ATR-based triggers
session-based trading logic
Features
CUSUM-inspired directional pressure model
Separate bullish and bearish accumulation
Volatility-adaptive drift and threshold
Smoothed baseline reference
Clear regime visualization
Histogram-based pressure display
Bullish and bearish background regime zones
Confirmed-bar logic for stable state changes
How to use it
A practical way to use the script is:
Use your main system to define direction and setup.
Use this CUSUM filter to decide whether the market currently has enough directional pressure.
Only allow trades when the filter agrees with the intended direction.
Example:
Longs only when bullish regime is active
Shorts only when bearish regime is active
Avoid trades when pressure is weak or regime is unclear
Interpretation
Cyan pressure shows bullish accumulation.
Magenta pressure shows bearish accumulation.
Background coloring highlights the current active regime.
Thin mirrored lines help visualize the current pressure structure and threshold relationship more clearly.
The mirrored display is intentional:
bullish pressure is shown above zero, bearish pressure is shown below zero for easier visual comparison.
Best use cases
Trend-following systems
Pullback entries
Re-entry models
Session-based intraday trading
Market regime analysis
Chop filtering
Important note
This script is not meant to predict tops or bottoms and is not presented as a standalone profitable strategy.
It is best used as a context and filtering tool inside a broader trading framework.
Risk disclaimer
This script is for educational and analytical purposes only. It does not guarantee profits and should not be treated as financial advice. Always test thoroughly before using any tool in live trading.
Vollbeschreibung
TradingMonster CUSUM Filter is a custom-built CUSUM-inspired regime and pressure tool designed to highlight directional market pressure in a clean and practical way.
Instead of acting as a standalone entry signal generator, this script is built to answer a more important question first:
Is there enough directional pressure in the market to justify taking the setup at all?
The script measures price deviation relative to a smoothed baseline, applies a volatility-adaptive drift component, and accumulates bullish and bearish pressure separately. This allows small, low-quality fluctuations to fade into the background while stronger directional pressure builds toward a meaningful regime shift.
The result is a simple but useful filter that can help reduce low-quality trades during choppy market conditions and improve context for trend-following or pullback-based systems.
Core Logic
The script works in four steps:
A smoothed baseline is calculated from price.
The deviation between price and the baseline is measured.
A volatility-based drift is subtracted to ignore smaller, less meaningful fluctuations.
Bullish and bearish pressure are accumulated separately until a threshold is exceeded.
When directional pressure grows large enough, the script marks a bullish or bearish regime.
What the script is built for
This script is intended for traders who want:
a market regime filter
a directional pressure filter
a cleaner way to avoid random chop
an additional confirmation layer for existing strategies
It is especially useful when combined with:
trend filters
pullback setups
ATR-based triggers
session-based trading logic
Features
CUSUM-inspired directional pressure model
Separate bullish and bearish accumulation
Volatility-adaptive drift and threshold
Smoothed baseline reference
Clear regime visualization
Histogram-based pressure display
Bullish and bearish background regime zones
Confirmed-bar logic for stable state changes
How to use it
A practical way to use the script is:
Use your main system to define direction and setup.
Use this CUSUM filter to decide whether the market currently has enough directional pressure.
Only allow trades when the filter agrees with the intended direction.
Example:
Longs only when bullish regime is active
Shorts only when bearish regime is active
Avoid trades when pressure is weak or regime is unclear
Interpretation
Cyan pressure shows bullish accumulation.
Magenta pressure shows bearish accumulation.
Background coloring highlights the current active regime.
Thin mirrored lines help visualize the current pressure structure and threshold relationship more clearly.
The mirrored display is intentional:
bullish pressure is shown above zero, bearish pressure is shown below zero for easier visual comparison.
Best use cases
Trend-following systems
Pullback entries
Re-entry models
Session-based intraday trading
Market regime analysis
Chop filtering
Important note
This script is not meant to predict tops or bottoms and is not presented as a standalone profitable strategy.
It is best used as a context and filtering tool inside a broader trading framework.
Risk disclaimer
This script is for educational and analytical purposes only. It does not guarantee profits and should not be treated as financial advice. Always test thoroughly before using any tool in live trading.
Release Note
CUSUM Filter by TradingMonster A clean CUSUM-based bullish, bearish, and neutral market regime filter that measures directional pressure relative to a smoothed baseline. Built to help traders separate meaningful directional pressure from weak or choppy market conditions.
Vollbeschreibung
TradingMonster CUSUM Filter is a custom-built CUSUM-inspired market pressure and regime tool designed to identify three distinct market states:
bullish pressure
bearish pressure
neutral / low-pressure conditions
Instead of acting as a standalone entry script, this indicator is built to answer a more useful question first:
Is there enough directional pressure in the market to justify taking the trade at all?
The script measures price deviation relative to a smoothed baseline, applies a volatility-adaptive drift component to suppress smaller fluctuations, and accumulates bullish and bearish pressure separately. Once enough directional pressure has built up, a bullish or bearish regime becomes active. If pressure fades, the script can return to a neutral state.
This makes the indicator especially useful as a confirmation and filtering layer inside broader trend-following, pullback, or re-entry systems.
Core Logic
The script works in five steps:
A smoothed baseline is calculated from price.
The deviation between price and baseline is measured.
A volatility-adaptive drift is subtracted to ignore smaller, less meaningful movement.
Bullish and bearish pressure are accumulated separately.
Regime states are determined using:
bullish trigger threshold
bearish trigger threshold
neutral / hold threshold
This creates a more realistic three-state regime model instead of forcing the market into only bullish or bearish conditions.
Market States
The indicator classifies market behavior into:
Bullish Regime
bullish pressure is dominant and exceeds the activation threshold
Bearish Regime
bearish pressure is dominant and exceeds the activation threshold
Neutral Regime
neither side shows enough sustained pressure
useful for identifying indecisive or low-quality conditions
What the script is built for
This script is intended for traders who want:
a directional market regime filter
a bullish / bearish / neutral pressure model
an anti-chop confirmation layer
a way to avoid low-quality setups during weak market conditions
an additional regime tool for existing strategies
Features
CUSUM-inspired directional pressure model
Separate bullish and bearish pressure accumulation
Volatility-adaptive drift and thresholds
Smoothed baseline reference
Bullish, bearish, and neutral regime states
Pressure histogram visualization
Mirrored threshold display for easy comparison
Confirmed-bar logic for stable state changes
Useful as a confirmation filter inside larger systems
How to use it
A practical workflow is:
Use your main strategy to define direction and setup.
Use TradingMonster CUSUM Filter to confirm whether directional pressure is strong enough.
Allow longs only during bullish regime.
Allow shorts only during bearish regime.
Treat neutral conditions as caution or no-trade zones.
Interpretation
Cyan pressure shows bullish accumulation.
Magenta pressure shows bearish accumulation.
Background coloring highlights the active regime.
Neutral background indicates weak or unclear pressure conditions.
Thin mirrored lines are intentionally displayed for visual symmetry:
bullish pressure above zero
bearish pressure below zero
This mirrored display is visual only and helps compare pressure build-up more intuitively.
Best use cases
Trend-following systems
Pullback strategies
Re-entry models
Session-based intraday trading
Regime filtering
Chop reduction
Directional confirmation
Important note
This script is not designed to predict exact tops or bottoms and is not presented as a standalone profitable strategy.
It is best used as a market-context and pressure filter inside a broader trading framework.
Risk disclaimer
This script is for educational and analytical purposes only. It does not guarantee profits and should not be treated as financial advice. Always test thoroughly before using any indicator or strategy in live markets.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน