MA BBands Indicator

MA BBands Indicator

1. Introduction

The MA BBands indicator combines Simple Moving Averages (SMA) and Bollinger Bands to provide a comprehensive analysis of price movements. This hybrid approach helps identify overbought and oversold zones, as well as potential trend breakouts. Additionally, it includes buy and sell signals based on OsMA crossovers, making decision-making more precise.

2. Key Concepts

  • Simple Moving Average (SMA):
    The SMA is calculated by averaging prices over a defined number of periods. It provides a smoothed line that reflects the general market direction.
  • Bollinger Bands:
    These consist of a central line (moving average) and two outer lines that represent a standard deviation range of prices. Bollinger Bands help measure market volatility.
  • OsMA (Moving Average Oscillator):
    It measures the difference between the MACD and its signal line. OsMA sign changes indicate possible trend reversals.
  • Time Shifts:
    Shifts allow observing past values of moving averages and bands to analyze their recent behavior.

3. Indicator Configuration

  • MAPeriod (20): Period for the SMA.
  • BBPeriod (30): Period for the Bollinger Bands.
  • StdDev (1.5): Standard deviation factor for calculating the upper and lower bands.
  • MoveShift (22): Number of bars to shift the SMA.
  • OsMAFastPeriod (5) and OsMASlowPeriod (25): Parameters for calculating the OsMA.
  • shortMAPeriod (10): Period for the short SMA used for quick entry and exit signals.
  • ShowSignals (1): Parameter to enable/disable arrow signals display.

4. Indicator Logic

  • Moving Average Calculation:
    SMAs are calculated based on high and low prices, shifted according to the MoveShift value.
  • Shifted Bollinger Bands:
    An upper and lower range is derived based on a defined period and the standard deviation of prices. Then, a 7-bar shift is applied for more precise analysis.
  • OsMA Evaluation:
    The OsMA is used to confirm the trend direction based on its sign changes.
  • Reference Bands Selection:
    The upperBand and lowerBand lines dynamically adjust by selecting the most relevant value between the shifted SMA and Bollinger Bands, providing an adaptive framework for price evaluation.

5. Buy and Sell Signals

  • Sell Signal (Red Arrow):
    A sell signal is generated when:

    • The short SMA crosses above the upper band of the indicator.
    • The OsMA changes from positive to negative.
    • The current price closes above the upper band.
  • Buy Signal (Green Arrow):
    A buy signal is generated when:

    • The short SMA is below the lower band.
    • The OsMA changes from negative to positive.
    • The current price closes below the lower band.

6. Advantages of the MA BBands Indicator

  • Provides clear and easy-to-interpret visual signals to detect overbought and oversold zones.
  • Combines multiple technical approaches, improving signal accuracy and avoiding false breakouts.
  • Allows customization of periods and standard deviations to suit different trading styles.
  • The inclusion of the OsMA as a confirmation filter reduces market noise.

7. ProBuilder Code for the Indicator

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

avatar
Register or

Likes

avatar avatar avatar avatar
Related users ' posts
tradingpro salve io faccio spread trading e volevo sapere come impostare un profitto da chiudere in a...
Nicolas Per favore non fare domande generali, non correlate al post. Usa invece il forum.
Bard Incredible, that is the clearest depiction of the trend I've ever seen Nicolas. (I just chan...
Appsoluxions Hi Nicolas, do you have the MT4 version of the indicator? I am not sure if these kind of que...
Nicolas Hi, don't have one sorry. But you can still ask for private coding through our programming s...
Appsoluxions Cool. Thanks for the response.
GUCCI ONE Bonjour, Nicolas. Pourriez-vous m'aider à transformer cet indicateur en screener, svp ? Merci
Nicolas disponible ici: https://www.prorealcode.com/topic/divergences-screener/
julien1978 hello to all, i recently discovered this indicator. would it be possible to add the detectio...
Xusto Hello, Fully Agree, I will update it with your advice. Btw Can would you like share you co...
Niklas johansson hägglund do you now if it's possible to use this strategy with this code in tradingview also?
Alexander9 This code for metastock ?, can for amibroker . Thanks
AGTrader Interesante, muy visual Doc. Felicidades!!!
Andraxx simplemente impresionante Dom...te sigo en youtube. Me ha gustado tu canal. Gracias por comp...
rama I want to use this indicator in trading system, it says zig zag is obsolete and not supported
Nicolas Right, due to its repainting behavior, the zigzag is not allowed in automated trading with r...
rama I noticed it changes as time progress, I am 7 as the average, how many period it wont chang...
mangiaragni Buongiorno io non riesco a visualizzare nessun tipo di volume , mi torna sempre una linea dr...
Nicolas Assicurati che lo strumento che stai guardando abbia dei volumi! È il caso?
Leo Does it opens pending orders?... maybe they were not trigger.
Mattzi Dont know, all i can see is that it opened an order yesterday in backtest but not live. Th...
Jean-Christophe Hello Leo, when running the strategy from 29/12/2015 to 31/08/2018 on ProRealTime Premium, I...
Gordon101 Hi when I added your Guppy indicator to my chart it went below the chart beside the oscilla...
Nicolas Add it on the price by using the wrench located on the left upper side of your price chart.
Gordon101 Thanks Nicolas, worked a treat.
Rafa And the PriceMAPeriod? aren´t the same?
Nicolas The PriceMAPeriod is the period to make the average of all the last X medianprice found.
Rafa Thanks a lot Nicolás. Have a nice day
Toto le Heros Thanks Nicolas. I read somewhere that in the calculation, we should round the value of the A...
Nicolas aADX = round(adx[10])
ak5hay2 Works like crazy on bitcoin. Use different timeframes. Thanks a lot Doc!!!
richyowen Hi, great code thanks. Very new to this forum. Is there a way to add a 100point target on an...
lisamitch50 Morning all, Just backtested on quite a few instruments, worked well on backtesting, but tel...
juanj This gets me thinking about creating a strategy on the 5min timeframe that only takes trades...
GraHal I noted above does okay on DAX 10 min with even a reduction to 30 of the Stop Loss. I've s...
Kris75 Hi Grahal, What about making the same great work you did with the snipet on google doc but...
LancerX This catch my attention, tried to load in pro order but not coming through. What variables n...
macdopa Hello ALE. Is there any way to help us develop or program an algo-strategy for automatic tr...
Giuseppe68 Ciao, sono nuovo e poco esperto, volevo chiedere perchè il ProBacktest lo esegue correttamen...
swapping merci gabri, on va le mettre à l'essai ;)
Alai-n Merci pour ce travail...
patmaba merci Alai-n. C'est ma première participation sur prorealcode, merci pour à toi pour ton co...
longtrade Can this be converted to a screener?
Nicolas Your picture is too small, but for sure the problem is about the fact you are still using v1...
Rory Dryden Thanks. This looks useful.
Edelmiro Un millón... de gracias... me gustaría más, poder ofrecer euros; pero va a ser que no puedo,...

Top