Deutsch 日本語
preview
The Parafrac V2 Oscillator: Integrating Parabolic SAR with Average True Range

The Parafrac V2 Oscillator: Integrating Parabolic SAR with Average True Range

MetaTrader 5Indicators |
4 331 1
Daniel Opoku
Daniel Opoku

Abstract

The proliferation of technical indicators often leads to chart congestion and analysis paralysis for traders. This article introduces the Parafrac V2 Oscillator, an evolved technical analysis tool engineered through the synthesis of the Parabolic SAR (Stop and Reverse) and the Average True Range (ATR) indicators. This new oscillator addresses a critical limitation observed in its predecessor, the Parafrac Oscillator, which combined Parabolic SAR with Fractal indicators, where extreme, single-bar price spikes could generate anomalous and misleading signals.

By substituting the Fractal component with the ATR, a well-established measure of market volatility, the Parafrac V2 provides a more robust and smoothed mechanism for identifying trend dynamics, potential reversal zones, and bullish/bearish divergences. This paper delineates the theoretical foundation of the composite indicators, justifies the methodological shift from Fractals to ATR, and provides a framework for traders to develop and calibrate proprietary trading signals based on this novel oscillator


Introduction

In the domain of technical analysis, the quest for a singular, reliable signal often compels market participants to employ a multitude of indicators concurrently to validate trading signals. This practice, while aimed at increasing confirmation, frequently results in interface clutter and interpretive complexity. A more elegant solution lies in the conceptual integration of multiple analytical techniques into a single, cohesive oscillator. Such a composite indicator can harness the synergistic properties of its components, potentially offering more nuanced and dependable signals.

The original Parafrac Oscillator represented an initial attempt into this methodology, merging the trend-following capabilities of the Parabolic SAR with the volatility identification of the Fractal indicator. While effective in many scenarios, empirical observation revealed a susceptibility to signal distortion caused by isolated, high-volatility price bars. To mitigate this noise, a cap was applied to the oscillator's output, constraining its range to between -10 and +10. The present research builds upon this foundation by proposing a more foundational enhancement: the replacement of the Fractal indicator with the ATR. This article explores the theoretical rationale for this substitution and examines its impact on the oscillator's signal generation profile, thereby introducing theParafrac V2 Oscillator.


Exploring the Component Indicators

The Parabolic SAR's mechanics have been extensively detailed in the article introducing the original Parafrac Oscillator. Therefore, this section will focus exclusively on the core component introduced in this revision: theAverage True Range indicator.

  • The Average True Range (ATR) Indicator

Developed by J. Welles Wilder Jr., the ATRis a pivotal technical analysis tool designed to quantify market volatility by decomposing the entire range of an asset's price movement over a specified period. Unlike oscillators that predict direction, the ATR is non-directional; its primary function is to measure the degree of price volatility, expressed in absolute terms. A high ATR value signifies a period of high volatility and large price movements, whereas a low ATR value indicates a period of low volatility and comparatively subdued price action.

The ATR indicator can be easily accessed from the trading platform. To locate it, open the indicator list, navigate to the Oscillator category, and then select ATR from the available options as shown in Figure 1.

atr1

Figure 1: Selecting ATR

The ATR features one primary input parameter as shown in Figure 2: the ATR Period. This numerical value determines the number of bars or candles used for the moving average calculation of the True Range. A lower period value (e.g., 7) will render theATR more sensitive to recent volatility shifts, resulting in a more responsive but potentially noisier output. Conversely, a higher period value (e.g., 21) will provide a smoother, more averaged measure of volatility that reacts more slowly to changing market conditions. 

The selection of this period is a critical step in calibrating the Parafrac V2 Oscillator, as it directly influences the volatility baseline against which the Parabolic SAR's position is normalized. The default period setting in most platforms is 14, which serves as a conventional and robust starting point for analysis.

atr_sett

Figure 2: ATR input parameter

In practice, the ATR is widely used to measure market volatility and to assist in setting appropriate stop-loss and take-profit levels. It does not indicate price direction but the degree of movement, making it a valuable tool for risk management and strategy refinement.

In the context of the Parafrac V2 Oscillator, the ATR is not employed in its traditional capacity as a mere volatility gauge for setting stop-loss distances. Instead, its role is analogous to that of the Fractal indicator in the original model: it serves as a dynamic measure of the prevailing price range. However, whereas Fractals identify specific pivot points, the ATR provides a smoothed, continuous reading of the average trading range.

This offers a significant advantage: it inherently filters out the noise of anomalous price spikes by averaging volatility over a lookback period, thus providing a more stable and reliable baseline for the oscillator's calculations. This inherent smoothing mechanism directly addresses the signal distortion issue noted in the original Parafrac design.


Engineering the Parafrac V2 Oscillator

The original Parafrac Oscillator utilized the Fractal indicator to establish a dynamic price range by measuring the distance between the most recent significant high and low pivots. This range was then used with the Parabolic SAR's value to generate an oscillator that fluctuated around a central axis.

The methodological advancement in the Parafrac V2 lies in its redefinition of this "range." Instead of relying on discrete pivot points identified by Fractals—which can be abruptly invalidated or can create sharp jumps in the range value—the V2 oscillator utilizes a volatility-normalized range derived from the ATR. This substitution fundamentally alters the oscillator's construction.

  • Mathematical Concept

The mathematical formulation of the Parafrac V2 Oscillator is defined separately for bullish and bearish conditions:

For an uptrend:

upAtr

For a downtrend:

DnAtr

where ATR ≠ 0, and the Parabolic SAR corresponds to either the candle’s open or close.

This normalization through ATR ensures consistency across multiple market instruments. 


Observation

1. Cross-Market Normalization

Since the oscillator is normalized, it produces comparable values across different instruments, as shown in Figure 3. For example, if Gold/USD pair records a value of ±5, a currency pair such as GBP/JPY will reflect similar levels, allowing traders the flexibility to design strategies that can be applied across asset classes.

parV2

Figure 3: Parafrac V2 Oscillator

It is observed that the Parafrac V2 Oscillator signals generally remain within the ±5 range. When values extend beyond this threshold, the market may be entering an overextended phase, indicating an increased likelihood of a potential reversal.

2. Effect of ATR Settings

  • A shorter ATR period (e.g., 20) responds faster to volatility, producing more frequent histogram fluctuations.
  • A longer ATR period (e.g., 100) smooths the histogram, filtering out short-term noise.

This adaptability makes the oscillator valuable for both short-term scalpers and long-term trend traders.

3. Parabolic SAR Gap Influence

The distance between price and the Parabolic SAR; known as the PSAR gap; also affects the oscillator:

  • If ATR > PSAR gap, the oscillator histogram declines.
  • If ATR < PSAR gap, the oscillator histogram increases.

Thus, the relationship between ATR and PSAR gap provides insight into market strength.

4. Normalized Range

In most observations, the oscillator fluctuates within a range of ±5. Unlike the original Parafrac Oscillator, which used ±10 as extreme levels, the Parafrac V2 refines this by setting reference levels at ±7. With default ATR settings, prices rarely exceed this range, though users can adjust the thresholds based on their strategy preferences.

comp1

Figure 4: Comparison between the original and the new V2

In Figure 4, the lower panel presents the original Parafrac Oscillator, while the upper panel showcases the enhanced Parafrac V2 Oscillator. The contrasting shapes of the two indicators highlight their distinct analytical outputs, each providing unique perspectives on market trends, divergences, and periods of overextension.

5. Reduced Spikes for Clearer Signals

One notable improvement in the Parafrac V2 is the reduction of sudden spikes often seen in the earlier version. This smoothing effect makes sequential signals easier to interpret, thereby enhancing trading decision-making.

comp2

Figure 5: Comparing Parafrac oscillator with spike and V2 

In Figure 5, the lower panel illustrates the original Parafrac Oscillator without the application of the ±10 threshold, while the upper panel displays the refined Parafrac V2 Oscillator. A key distinction becomes immediately apparent: the original version produces pronounced signal spikes, often triggered by abrupt price movements, whereas the V2 model exhibits a smoother response with no such anomalies. This demonstrates the effectiveness of the ATR-based modification in filtering out noise and delivering more stable and reliable signals for traders.


Expected Analytical Applications

The Parafrac V2 Oscillator is designed for versatility in technical analysis. Its applications are anticipated to include:

  • Trend Identification: Values persistently above a zero-line threshold may confirm a strong bullish trend, while sustained negative values may confirm a bearish trend.

The trend momentum can be defined by the user according to the chosen timeframe by setting thresholds. For example, when analyzing USDJPY on the H4 chart, a sharp change in direction combined with either of the first two histograms crossing above +2.5 signals a buy, while crossing below –2.5 signals a sell. This approach provides users with flexibility to determine which threshold should serve as their basis for identifying trends.

trd1

Figure 6: Trend identification

  • Divergence Analysis: A paramount application is the identification of divergences between the oscillator and price action. For instance, a security making a new high while the Parafrac V2 forms a lower high (bearish divergence) can signal waning bullish momentum and a potential trend reversal.

div1

Figure 7: Divergence between price and the oscillator

  • Overbought/Oversold Conditions: While not its primary function, extreme readings near the capped levels of +7 or -7 could indicate overextended market conditions ripe for a mean reversion, particularly when corroborated by price action signals. The user can define threshold levels for overbought and oversold conditions, depending on the characteristics of the security being analyzed.

ovrbgt1

Figure 8: overbought condition

Traders are encouraged to develop their own systematic rules based on this indicator. A potential trading system could involve entering a long position upon the oscillator crossing above a specific threshold from oversold territory, and conversely, entering a short position upon a cross below a threshold from overbought territory. The precise calibration of these thresholds and the incorporation of additional filters (e.g., volume, trend alignment) should be optimized through rigorous back-testing on the target asset.


Code Structure

Although we have developed both MetaTrader 4 and MetaTrader 5 versions of the Parafrac V2 Oscillator, the following discussion highlights selected segments of the code using the MetaTrader 5 structure for illustration purposes.

// Input parameters
input double pstep = 0.02;
input double pMax = 0.2;
input int AtrPeriod = 7;

The input parameters enable traders to customize the indicator by defining their own preferred values, allowing flexibility in adapting the Parafrac V2 Oscillator to different trading strategies and market conditions.

   // Set indicator buffers
   SetIndexBuffer(0, UpBuffer, INDICATOR_DATA);
   SetIndexBuffer(1, DownBuffer, INDICATOR_DATA);
   
   // Set empty values
   PlotIndexSetDouble(0, PLOT_EMPTY_VALUE, 0.0);
   PlotIndexSetDouble(1, PLOT_EMPTY_VALUE, 0.0);
   
   // Initialize buffers
   ArrayInitialize(UpBuffer, 0.0);
   ArrayInitialize(DownBuffer, 0.0);
   
   // Create indicator handles
   sarHandle = iSAR(_Symbol, _Period, pstep, pMax);
   if(sarHandle == INVALID_HANDLE)
   {
      Print("Error creating SAR handle");
      return(INIT_FAILED);
   }
   
   atrHandle = iATR(_Symbol, _Period, AtrPeriod);
   if(atrHandle == INVALID_HANDLE)
   {
      Print("Error creating ATR handle");
      return(INIT_FAILED);
   }

This section of the code:

  • set the indicator buffer
  • set empty values
  • initialize buffers
  • create the indicator handles 

This code sets up the data storage (buffers) for the Parafrac V2 Oscillator, initializes them, and then creates links to MetaTrader 5’s built-in Parabolic SAR and ATR indicators. These will later be used in calculations to generate the oscillator’s values.

   for(int i = pStart; i < rates_total; i++)
   {
      // Skip if data is not valid
      if(sarArray[i] == EMPTY_VALUE || atrArray[i] == EMPTY_VALUE || atrArray[i] == 0)
      {
         UpBuffer[i] = 0;
         DownBuffer[i] = 0;
         continue;
      }
      
      // Determine trend and compute histogram value
      if(close[i] > sarArray[i])  // Uptrend condition
      {
         double diff = (high[i] - sarArray[i]) / atrArray[i];
         UpBuffer[i] = diff;
         DownBuffer[i] = 0;
      }
      else if(close[i] < sarArray[i]) // Downtrend condition
      {
         double diff = (low[i]-sarArray[i]) / atrArray[i];
         DownBuffer[i] = diff; // Negative value for downtrend
         UpBuffer[i] = 0;
      }
      else // If Close equals SAR, no value is plotted
      {
         UpBuffer[i] = 0;
         DownBuffer[i] = 0;
      }
   }

This loop fills the indicator’s buffers by comparing Close price  with Parabolic SAR. It calculates how far price is from SAR, normalized by ATR (market volatility). The result is:

  • UpBuffer -- positive oscillator bars during uptrend.
  • DownBuffer -- negative oscillator bars during downtrend.
  • 0 values  -- no signal when SAR and price overlap or data is invalid.


Conclusion

The Parafrac V2 Oscillator represents a logical and theoretically sound evolution of the composite indicator concept. By replacing the Fractal indicator with the ATR, this new tool directly addressesthe noise and spike-sensitivity issues of its predecessor. By incorporating the ATR, the oscillator gains a built-in volatility-adjustment mechanism, producing signals that are not only more robust and smoothed but also context-sensitive to changing market conditions.

This article has outlined the rationale for this methodological shift and proposed a framework for its application. Future research will involve rigorous empirical testing to quantitatively compare the performance characteristics—including sensitivity, accuracy, and profitability—of the Parafrac V2 against the original oscillator and other common technical indicators across various asset classes and market environments. The Parafrac V2 provides traders with a sophisticated tool to simplify their analytical process while enhancing the quality of the signals generated.

Last comments | Go to discussion (1)
Conor Mcnamara
Conor Mcnamara | 18 Sep 2025 at 15:57

This might provide some clarity for re-entry in manual trading, but the trend changes are nothing new in comparison to the original parabolic sar trend change, therefore it will not be good in thin markets.

I think it's better if you color the histogram grey on weakened volatility in the trend. I attached a code edit.

Developing A Custom Account Performace Matrix Indicator Developing A Custom Account Performace Matrix Indicator
This indicator acts as a discipline enforcer by tracking account equity, profit/loss, and drawdown in real-time while displaying a performance dashboard. It can help traders stay consistent, avoid overtrading, and comply with prop-firm challenge rules.
From Novice to Expert: Implementation of Fibonacci Strategies in Post-NFP Market Trading From Novice to Expert: Implementation of Fibonacci Strategies in Post-NFP Market Trading
In financial markets, the laws of retracement remain among the most undeniable forces. It is a rule of thumb that price will always retrace—whether in large moves or even within the smallest tick patterns, which often appear as a zigzag. However, the retracement pattern itself is never fixed; it remains uncertain and subject to anticipation. This uncertainty explains why traders rely on multiple Fibonacci levels, each carrying a certain probability of influence. In this discussion, we introduce a refined strategy that applies Fibonacci techniques to address the challenges of trading shortly after major economic event announcements. By combining retracement principles with event-driven market behavior, we aim to uncover more reliable entry and exit opportunities. Join to explore the full discussion and see how Fibonacci can be adapted to post-event trading.
Pipelines in MQL5 Pipelines in MQL5
In this piece, we look at a key data preparation step for machine learning that is gaining rapid significance. Data Preprocessing Pipelines. These in essence are a streamlined sequence of data transformation steps that prepare raw data before it is fed to a model. As uninteresting as this may initially seem to the uninducted, this ‘data standardization’ not only saves on training time and execution costs, but it goes a long way in ensuring better generalization. In this article we are focusing on some SCIKIT-LEARN preprocessing functions, and while we are not exploiting the MQL5 Wizard, we will return to it in coming articles.
Price Action Analysis Toolkit Development (Part 40): Market DNA Passport Price Action Analysis Toolkit Development (Part 40): Market DNA Passport
This article explores the unique identity of each currency pair through the lens of its historical price action. Inspired by the concept of genetic DNA, which encodes the distinct blueprint of every living being, we apply a similar framework to the markets, treating price action as the “DNA” of each pair. By breaking down structural behaviors such as volatility, swings, retracements, spikes, and session characteristics, the tool reveals the underlying profile that distinguishes one pair from another. This approach provides more profound insight into market behavior and equips traders with a structured way to align strategies with the natural tendencies of each instrument.