Sideways indicator (Bollinger Momentum)

Sideways indicator (Bollinger Momentum)

In the world of trading, identifying market sideways phases is crucial for adjusting investment strategies and minimizing risks. These phases, known as “Sideways” periods, are characterized by the absence of a clear trend, where prices fluctuate within a relatively narrow range without showing a defined direction. During these periods, trend-oriented strategies often lose effectiveness, making it necessary to use tools that help detect and capitalize on these market consolidation moments.

The Sideways indicator, which uses a combination of Bollinger Bands and Momentum measurement, is specifically designed to identify these sideways periods. By measuring the contraction or expansion of the Bollinger Bands and comparing it to their average, this indicator provides a clear and simple visualization of market volatility, helping traders detect possible consolidation phases and make more informed decisions.

Description of the Sideways Indicator

The Sideways indicator is a technical tool designed to identify periods when the market moves sideways, meaning without a clear upward or downward trend. This type of movement is common in financial markets and can be challenging for traders who use trend-based strategies.

The Sideways indicator combines two fundamental components of technical analysis:

  • Bollinger Bands: Bollinger Bands are a volatility indicator consisting of a simple moving average and two standard deviations above and below that average. These bands expand and contract based on market volatility. In the Sideways indicator, they are used to measure the distance between the upper and lower bands, which provides an indication of current volatility.
  • Momentum: Momentum is calculated as the difference between the upper and lower Bollinger Bands. Lower momentum indicates that the bands are closer together, suggesting a phase of low volatility and possible sideways movement. Conversely, higher momentum indicates an expansion of the bands, which may signal an increase in volatility and the possibility that the market is emerging from a sideways phase.

The Sideways indicator is visualized through a histogram, where positive and negative values are colored based on their relationship with the momentum moving average. This allows traders to quickly identify when the market is entering or exiting a sideways phase.

Calculation of the Indicator

The Sideways indicator is based on a series of technical calculations that combine Bollinger Bands with a measure of market momentum. Below are the key steps in its calculation:

1. Calculation of Bollinger Bands

Bollinger Bands are the first essential component of the indicator. These bands are calculated using a simple moving average and the standard deviation of prices. In the case of the Sideways indicator, a moving average length defined by the MALength parameter, which is set to 40 periods by default, is used.

  • Upper Band (BolUpper):
    BolUpper=BollingerUp[MALength](Close)

This formula calculates the upper band by adding two standard deviations to the value of the moving average of the closing prices.

  • Lower Band (BolLower):
    BolLower=BollingerDown[MALength](Close)

Similarly, the lower band is calculated by subtracting two standard deviations from the value of the moving average of the closing prices.

2. Calculation of Momentum

Market momentum, in this context, is defined as the difference between the upper and lower Bollinger Bands:

Moment=BolUpper−BolLower

This momentum value reflects the current market volatility. A low momentum value indicates that the bands are closer together, suggesting a phase of low volatility and possible sideways movement. A high value indicates an expansion of the bands, signaling an increase in volatility.

3. Simple Moving Average of Momentum

To smooth out momentum values and facilitate the identification of trends in volatility, a simple moving average is applied to the calculated momentum value:

MomentLine=Average[MALength](Moment)

This momentum average line acts as a reference threshold to determine whether volatility is increasing or decreasing relative to its recent average.

4. Histogram Color Definition

The histogram’s color is determined by comparing the current momentum value with the momentum moving average line:

  • If momentum is greater than or equal to the moving average (Moment >= MomentLine), the histogram is colored green, indicating a possible expansion in volatility.
  • If momentum is less than the moving average (Moment < MomentLine), the histogram is colored red, suggesting a possible contraction in volatility.

Interpretation of the Indicator

The Sideways indicator offers a visual representation of market volatility through a colored histogram and a momentum moving average line. The following details how to interpret the signals provided by this indicator:

1. The Momentum Histogram

The histogram is the main component of the Sideways indicator and represents the difference between the Bollinger Bands (Momentum). This histogram changes color based on the relationship between the current momentum and its moving average. The key interpretations are:

  • Green Histogram: When the current momentum (Moment) is equal to or higher than the momentum moving average line (MomentLine), the histogram is colored green. This indicates an expansion in market volatility, which could signal the end of a sideways period and the beginning of a new trend, either upward or downward. In such cases, traders should be prepared for potential breakouts in the price range.
  • Red Histogram: When the current momentum is lower than the momentum moving average, the histogram is colored red. This suggests a contraction in volatility, which is usually indicative of a consolidating or sideways market. In this scenario, prices may remain within a narrow range without a clear direction, and traders might opt for strategies that benefit from a lack of trend, such as selling options or range-bound strategies.

2. The Momentum Moving Average Line (MomentLine)

The momentum moving average line acts as a dynamic threshold that helps traders differentiate between phases of expanding and contracting volatility:

  • Above the MomentLine: If the histogram is above the MomentLine, it suggests that the market is experiencing increasing volatility, which could anticipate a change in price direction or a breakout from a sideways range.
  • Below the MomentLine: If the histogram is below the MomentLine, it suggests that the market is experiencing decreasing volatility, reinforcing the idea that the market may be in a sideways phase.

Practical Examples

To better understand how to use the Sideways indicator, consider the following scenarios:

  • Volatility Expansion Scenario: Suppose the market has been in a narrow range for several sessions, and suddenly, the Sideways indicator histogram starts to turn green, crossing above the MomentLine. This may be a signal that the market is about to break out of the range, offering an opportunity to trade in the direction of the breakout.
  • Volatility Contraction Scenario: In another case, after a strong price movement, the Sideways histogram turns red and falls below the MomentLine. This could indicate that the market is entering a consolidation phase, suggesting that trend-based trading strategies may not be effective at this time.

Indicator Configuration

The Sideways indicator allows some flexibility in its configuration to adapt to different market conditions and trading styles. Below are the key parameters that can be adjusted and how they affect the indicator’s behavior:

1. Moving Average Length (MALength)

  • Parameter: MALength
  • Default value: 40
  • Description: This parameter defines the number of periods used to calculate the simple moving average applied to both the Bollinger Bands and the momentum. By modifying the moving average length, you can adjust the indicator’s sensitivity to changes in volatility.
    • Longer Length: Increasing the MALength value will make the moving average, and therefore the indicator overall, less sensitive to short-term fluctuations, smoothing the histogram. This is useful in markets with erratic movements, where a more stable and reliable signal for volatility changes is desired.
    • Shorter Length: Reducing the MALength value increases the indicator’s sensitivity, making it more responsive to rapid changes in volatility. This adjustment is more suitable for markets where trends change quickly and the trader wants to capture early volatility movements.

2. Histogram Color Adjustment

Although the predefined colors for the histogram are green for volatility expansion and red for contraction, these colors can be modified in the code to suit user preferences.

  • Green Histogram (Expansion):
    • r=0, g=255, b=0 (Default value, green)
  • Red Histogram (Contraction):
    • r=255, g=0, b=0 (Default value, red)

Changing these values allows you to customize the indicator’s appearance on the chart, facilitating integration with other indicators that the trader may be using.

3. Application in Different Timeframes

The Sideways indicator is versatile and can be applied across various timeframes, from intraday charts to long-term charts. However, it is important to adjust the MALength parameter according to the timeframe:

  • Intraday Charts (5 min, 15 min, etc.): For shorter periods, it is recommended to reduce the MALength to better capture the rapid changes in volatility that are common in these timeframes.
  • Daily or Weekly Charts: In longer timeframes, a higher MALength can be more effective in identifying prolonged sideways periods or significant volatility expansions.

4. Configuration Recommendations

  • High Volatility Markets: Use a shorter MALength to capture rapid expansions and contractions in volatility.
  • Stable or Low Volatility Markets: A longer MALength for more stable signals and to avoid market noise.

Conclusion

The Sideways indicator is a valuable tool for traders who want to identify periods of market lateralization and adjust their strategies accordingly. By combining Bollinger Bands with momentum measurement, the indicator offers a clear representation of market volatility, helping traders anticipate possible breakouts from sideways ranges or prolonged consolidations.

The flexibility of the indicator, through the adjustment of the MALength parameter, allows it to be adapted to different timeframes and market conditions, making it a useful component in any trading strategy. Additionally, the colored histogram visualization facilitates quick interpretation of market conditions, enabling traders to make informed decisions in real time.

Final Tips

  • Complement with Other Indicators: Although the Sideways indicator is effective in identifying lateralization phases, its predictive power can be enhanced when used in combination with other indicators, such as oscillators or volume indicators, to confirm signals.
  • Adaptability: Experimenting with different MALength settings according to the specific asset and timeframe can significantly improve the indicator’s effectiveness.
  • Caution in Volatile Markets: In highly volatile markets, it is recommended to use more sensitive settings to capture rapid changes, but always with a careful approach to avoid false signals.

Using the Sideways indicator with a clear understanding of its fundamentals and configurations can provide traders with a crucial edge in identifying market movements that might otherwise go unnoticed.

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Jean2139 • 224 days ago #

    Bonjour Yvan,
    Merci pour ton indicateur que je trouve très intéressant.
    Je suppose que tu l’as tester sur différents instruments et différentes périodes : peux-tu me préciser sur quelles périodes cet indicateur s’est révéler le plus efficace?
    Merci

  2. Suffi • 207 days ago #

    Hier eine kleine Korrektur:
    //—–Inputs—————————————–//
    MALength = Periode //Periode als Variable eingefügt

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Jean-Pierre Poulain When I buy and when I sell ?
Nicolas The featured image of the post do not deserve the indicator you are right, I attached other ...
Nicolas It is described in the post already :) The BUY/SELL signals are quite similar of what you ca...
Nicolas We do not offer free assistance for TOS. However, you can send demand for private paid codin...
phanz Hi community. May I know how you use this indicator please? Is it on the zero cross over? ...
sydney43025 Hello, I'm digging up this topic because I uploaded the code on a PRT v11.1 but the indicato...
David Balance thanks for sharing this excellent indicator.  Here are some thoughts.  please ad...
reb Hello Marc your strat seems very intersting, will take a look Reb
897148 What exactly is meant by Total price? Is r1 =28 in your example the no of days for "Total P...
finplus Thanks for the job. Which variables do you suggest for timeframe 1 hour? 
Maz Depends massively on your market and the volatility. I suggest using the variable optimizer ...
1Randy This a great momentum filter! I would like to see volume momentum incorporated into the indi...
otty82  THX looks good!
century nice one , thank you
arvindrao01 Hey! Does anyone have a pinescript (tradingview) code for this?
imokdesign Hi Everybody, when I look at the strategy I felt the need to implement a Moneymanagement-Sy...
Inertia newlevel then multiplier=multiplier+1 oldlevel=newlevel newlevel=strategyprofit+startequi...
Inertia Hi Bjoern, I was playing around with your code this morning (EUR/USD 5'). Thank you to the...
Nicolas An answer to a query that has been posted in the squeeze indicator: https://www.prorealcode....
Jodal Bonjour Nicolas, Merci pour cet indicateur! Est-ce possible de configurer une alerte pou...
Nicolas Merci pour le post dans le forum en respectant les règles de publication énoncées dans le ca...
Dron De lo mejorcito
Swingforfortune
8 years ago
gatarayihajp Hi swingforfortune, Thanks a lot about your interesting posting. Let ask you to explain mor...
Swingforfortune Hello. Basically they are a twist of the MACD histogram and can be used as such. They visua...
gatarayihajp Hi again Thanks for the explanation. Have a good day
CavalierDeCesDames Bonjour Nicolas, Thanks for your use full job. I tried this indicator on a shorter timefram...
Nicolas You are welcome. I'm glad you like it.
Bolbo It does not appear over the price indicator on V11. Thanks in advance.
bearbull As per PhilipSchultz question above, has anybody managed to add code for when it turns blue,...
Ybr35 Bonjour Nicolas, lorsque je lance l'indicateur, il m'est indiqué que je dois définir les var...
Nicolas L'idéal est de télécharger le fichier itf joint sur cette page et de l'importer dans la plat...
Nicolas All conditions under parenthesis for the c1 to c4 conditions should be inverted. 
tomus Can you give an example of the overbought codes please? Thanks.
ams123 Frank Merci Nicholas -:)
Wilko And not only readable.... makes it much easier to iterate different entry/exit-conditions, d...
IGOSNELL Hi Interesting strategy, when I used $ M-R Dif EURUSD M15 Long if does not enter any positi...
ilvillans HI, I modified the system, from good results but from this error: Replace the variables wit...
Nicolas Merci dans ce cas d'ouvrir un sujet dans le forum ProScreener svp.
Andrea Hi Nicolas, thx for your code. Please i need your help to understand this part of your code:...
Nicolas the MA200 is ascending since 20 periods.
gabri
8 years ago
Marcel Thank you for this one. I played around with this indicator with Bollinger Bands around it i...
Regan2020 Hi, has anybody update the above code to enable on a 15m or 5m TF?
gigi64 ik heb de code op mijn pro realtime gezet , en bij indicator staat hij erbij maar komt niet ...
gigi64 I have put the code on my pro realtime, and it is on the indicator, but it does not appear o...
supertiti Thanks you so much Lucassen
dreif123 hi, copied the above code, not working on 10.3 the system says "return can only be used at ...
LUCASSEN Hallo , i have no problem , and i have the same versie 10.3, maybe you can ask Nicolas, tha...
Nicolas Rien, il faut l'appliquer sur la charte. Soit le mettre sur le graphique du prix, à l'aide d...
signorini Merci pour votre réponse. Je l'applique sur la charte, j'utilise la petite clé pour effacer ...
signorini Je vous remercie, Nicolas. C'est fixé. Très bon week-end.

Top