Pan Bands of Asymmetric Volatility
- Indicatori
- Heping Pan
- Versione: 1.10
- Attivazioni: 5
Pan Bands of Asymmetric Volatility
- A Research-Driven Volatility Framework
and Market Regime Switching Signal
Author: Heping Pan
Swingtum Prediction Pty Ltd, Australia
panhepingism@gmail.com
28/12/2025
Description
Move beyond conventional indicators. The Pan Bands of Asymmetric Volatility suite is not merely another technical tool—it is a trading application built upon a peer-reviewed, academically published financial research model [Heping Pan, (2012), "Yin-yang volatility in scale space of price-time: a core structure of financial market risk", China Finance Review International, Vol. 2 Iss: 4 pp. 377 – 405]. This foundation sets it apart, translating rigorous quantitative finance theory into practical market utility.
Traditional volatility measures, like Bollinger Bands®, are limited by their reliance on symmetric standard deviation. They fail to capture the fundamental asymmetry between upward and downward price movements, generate false signals at reversals, and exhibit inherent lag.
Our published research directly addresses these flaws by introducing a formalized Asymmetric Volatility (Yin-Yang Volatility) model. This indicator suite is the practical implementation of that model, offering traders a significant edge through a more accurate, responsive, and nuanced view of market dynamics.
Academic Rigor, Practical Execution
This package delivers the core indicator derived from the published methodology: PanBands.ex4: The primary implementation, plotting dynamic upper and lower asymmetric volatility bands alongside a moving average, and also the central midline, providing a clear equilibrium reference within the volatility framework. In addition, it also translates theory into actionable risk management, generating dedicated stop-loss levels derived directly from the asymmetric band structure.
Advanced, Research-Backed Market Regime Switching Signals:
Leveraging the Pan Bands output, the PanBandsRegime.ex4 indicator (which is available separately) applies a logical layer to generate essential market regime switching signals. It algorithmically identifies:
- The initiation and maturation of trending regimes.
- Early-stage deterioration and potential reversal points.
This provides a systematic, research-validated framework for contextualizing price action—a critical component for robust manual trading or automated strategy development.
Key Advantages of Pan Bands Indicators:
- Academically Validated: Based on a formal, peer-reviewed volatility model, not just heuristic modification.
- Asymmetry-Aware: Explicitly models the distinct nature of upward (Yang) and downward (Yin) volatility.
- Reduced Noise & Lag: Minimizes false expansions and improves responsiveness at critical market turns.
- Structured Toolkit: Progresses from core analysis to precise trade management and regime classification.
For the sophisticated trader seeking tools with substantive intellectual underpinnings, Pan Bands of Asymmetric Volatility represents a unique convergence of academic finance and practical trading technology. Implement a published research model directly on your charts.
Techincal Details:
Indicator PanBands calculates the band of Pan Yin-Yang Volatility of the price time series of the current time window. See Screenshot 1.
It takes 5 inputs:
- extern int BandsPeriod=48; // The width of the time window like in Bollinger Bands
- extern int BandsShift=0; // The time position of the output
- extern double BandsDeviations=2.0; // The multiplier (k) of the standard deviation
- extern int MA_Method=MODE_LWMA; // a method for moving average of the output
- extern int PriceComp=PRICE_CLOSE; // price component used for calculating moving average
- extern double SLRatio =0.25; // used for defining the initial stop loss levels, see output calculation
The meaning of the first two parameters BandsPeriod and Bandsshift are the same as in Bollinger Bands.
It generates 6 outputs:
- double PanMA[]; // The Moving Average
- double PanUB[]; // PanUpperBound
- double PanLB[]; // PanLowerBound
- double PanMid[]; // PanBandsMid
- double PanUSL // PanUpperStopLoss
- double PanLSL // PanLowerStopLoss
The outputs are calculated as follows:
- PanUpperBound = MA + k*YangVolatility
- PanLowerBound = MA – k*YinVolatility
- PanBandsMid = (PanUpperBound + PanLowerBound)/2
- PanUpperStopLoss = PanUpperBound + range*SLRatio
- PanLowerStopLoss = PanLowerBound – range*SLRatio
where range = PanUpperBound - PanLowerBound
Intuitively, the YinVolatility and YangVolatility refer to the downward and upward volatility of the prices respectively. For a full description, refer to a published journal paper: Heping Pan, (2012), "Yin-yang volatility in scale space of price-time: a core structure of financial market risk", China Finance Review International, Vol. 2 Iss: 4 pp. 377 – 405. This research paper is provided here. The exact formulas can be found in this research paper’s formulas (31)-(44).
Indicator PanBands is best to be understood in comparison with Bollinger Bands:
- BollingerUpperBound = MA + k*Volatility
- BollingerLowerBound = MA - k*Volatility
Screenshot 1 displays PanBands in comparison with Bollinger Bands. Here only the PanUpperBound and PanLowerBound and MA are displayed together with BollingerUpperBound and BollingerLowerBound. The differences are clear. For example, on area A, the market turns down as a significant reversal, the Bollinger upper bound still stretches up while the Pan upper bound quickly adapts to the change of the trend and it converges to the moving average (MA). On area B, the market breaks up, this break is quickly signaled by the break of the Pan upper bound,while Bollinger upper bound is still far away with too much lag.
Screenshot 2 displays PanMid - the midline of Pan Bands, which expresses the true center of the asymmetric volatility. Screenshot 3 displays PanUSL and Pan LSL - the upper and lower stoploss levels, which can be used as initial stoploss. Of course, how to use hese stoploss levels is up to the user in their manual trading or automated trading EA's.
Indicator PanBandsRegime (available separately)
Note: according to the regulation of MQL5.com, there can only be one .ex4 file for an indicator. Therefore, the indicator PanBandsRegime is made available separately. This indicator utilizes the proprietary calculation engine from PanBands built directly into its code. You do not need to install PanBands separately for this indicator to function.
Indicator PanBandsRegime determines the current market regime on the given time frame such as H1. Four types of market regime are distinguished: Up trend starts and keeps strong; Up trend is weakening and about to end; Down trend starts and keeps strong; Down trend is weakening and about to end. PanSwingtumRegime calculate sophisticated crossings of two PanBands with two different periods - a slow versus a fast one. The input parameters are
// Slow Pan Bands of YinYang Volatility
- extern int BandsPeriod1=96;
- extern int BandsShift1=0;
- extern double BandsDeviations1=3.0;
- extern int MAMethod1=MODE_LWMA;
- extern int PriceComp1=PRICE_CLOSE;
- extern double SLRatio = 0.25; // StopLoss levels are not used here
// Fast Pan Bands of YinYang Volatility
- extern int BandsPeriod2=48;
- extern int BandsShift2=0;
- extern double BandsDeviations2=3.0;
- extern int MAMethod2=MODE_LWMA;
- extern int PriceComp2=PRICE_CLOSE;
- extern double SLRatio = 025; // StopLoss levels are not used here
BandsPeriod1 and BandsPeriod2 are two key parameters that you may like to change value, while other parameters can be left untouched.
The output are two tradable signals:
- double goLong[]; // 100 means up trend is strong, 25 means trend is weakening
- double goShort[]; // -100 means down trend is strong, -25 means trend is weakening
See Screenshot 4.
In Screenshot 4,switch of market regime is shown with red and green vertical lines (only for illustration purpose, not the output of the indicator). The first red vertical line (the left) signals the market regime switches from up trend to down trend. The second red vertical line signals the weakening of down trend. Vice versa are the green vertical lines for signaling the new up trend.
----------------------------------------------------------------------------------------------------------------------------------------
Disclaimer for All the Trading Software of Swingtum Prediction Pty Ltd Australia
IMPORTANT NOTICE – PLEASE READ CAREFULLY
BY PURCHASING, DOWNLOADING, INSTALLING, OR USING THIS SOFTWARE (THE "SOFTWARE"), YOU (THE "USER") EXPLICITLY ACKNOWLEDGE, UNDERSTAND, AND UNCONDITIONALLY AGREE TO THE FOLLOWING TERMS. IF YOU DO NOT AGREE, YOU MUST IMMEDIATELY CEASE ALL USE OF THE SOFTWARE. NOTE THAT ALL SALEES ARE FINAL, NO REFUNDS WILL BE PROVIDED.
1. No Financial Advice & High Risk Warning
The Software is a technical tool for analysis and/or automated trading on the MetaTrader 4 (MT4) platform. It is provided for informational and educational purposes only. The Software and any accompanying materials DO NOT constitute financial advice, investment advice, trading advice, or any other type of advice. All trading decisions you make are your own sole responsibility. Trading foreign exchange (Forex), contracts for difference (CFDs), and other leveraged products carries a very high level of risk and may not be suitable for all investors. You can sustain losses that exceed your initial deposit. You should be aware of all risks associated with trading and seek independent advice from a qualified financial advisor if necessary.
2. No Guarantee of Performance or Profit
The developer, vendor, and all associated parties ("We," "Us," "Our") make no representations, warranties, or guarantees of any kind, express or implied, regarding the Software's performance, future profitability, or reliability. Past performance, whether simulated or real, is not indicative of future results. The User acknowledges that trading can result in the complete loss of their invested capital. We do not guarantee that the use of the Software will result in profits or will not result in losses.
3. User Assumes All Risk and Responsibility
The User accepts full, complete, and sole responsibility for any and all trades placed using the Software, including all losses, damages, and costs incurred. The User is solely responsible for understanding the functionality of the Software, configuring its settings (including stops, limits, lot sizes, and risk parameters), and monitoring its operation. The User agrees that they use the Software at their own risk.
4. Software "As Is"
The Software is provided on an "AS IS" and "AS AVAILABLE" basis without any warranty of any kind. We disclaim all warranties, including but not limited to, implied warranties of merchantability, fitness for a particular purpose, and non-infringement. We do not warrant that the Software will be error-free, uninterrupted, or compatible with all market conditions, brokers, or User hardware/software configurations.
5. Limitation of Liability
To the maximum extent permitted by applicable law, in no event shall We be liable for any direct, indirect, incidental, special, consequential, or punitive damages, or any loss of profits, revenue, data, or use, incurred by the User or any third party, arising from or related to the use or inability to use the Software, even if we have been advised of the possibility of such damages. Our total cumulative liability shall in no event exceed the purchase price paid by the User for the Software.
6. User's Representations
The User represents and warrants that they:
l Are of legal age in their jurisdiction to enter into this agreement.
l Have sufficient trading knowledge and experience to understand the risks involved.
l Have tested the Software on a demo account and understand its operation before any live use.
l Will use the Software in compliance with all applicable laws and regulations in their jurisdiction.
l Are solely responsible for ensuring their use of the Software complies with their broker's terms of service.
7. Third-Party Platforms & Market Risks
The Software operates on the MT4 platform and interacts with brokers' servers. We are not responsible for connectivity issues, execution delays, platform errors, broker insolvency, or any other issues originating from third-party platforms, brokers, or internet services. The User acknowledges the inherent risks of electronic trading, including slippage, requotes, and market gaps.
ACKNOWLEDGEMENT
BY USING THE SOFTWARE, YOU CONFIRM THAT YOU HAVE READ, UNDERSTOOD, AND IRREVOCABLY AGREE TO THIS DISCLAIMER. YOU ACKNOWLEDGE THAT YOU ARE THE SOLELY RESPONSIBLE PARTY FOR THE OUTCOMES OF YOUR TRADING ACTIVITIES.
Mr Heping Pan, the Author
Swingtum Prediction Pty Ltd, Australia
panhepingism@gmail.com
28 December 2025
