CCI_OBOS_With_Confirmation
Download scriptThis script is a specialized technical analysis tool designed for the MetaTrader 5 platform. Its primary purpose is to identify specific price action shifts—specifically "Break of Structure" (BOS) moments—while using an additional momentum indicator to confirm whether these moves are valid or potentially false signals.
Here is a breakdown of the logic used by the script:
Core Components and Logic
The tool operates by synthesizing three distinct types of market data:
1. Trend and Volatility Context The script calculates moving averages and standard deviation values. It uses these to establish a "baseline" for the market. By comparing current price action against these baselines, the script determines how much the market is deviating from its normal trend.
2. The "Break of Structure" (BOS) Detection The main goal of the script is to detect when the market breaks through established price boundaries. It tracks these levels and looks for specific "shifts." When the price moves significantly enough to break a previous high or low, the script flags it as a potential trend change.
3. Momentum Confirmation (CCI) To prevent the user from entering trades based on "fake" breakouts (where the price touches a level but immediately falls back), the script incorporates the Commodity Channel Index (CCI). It checks if the momentum is moving in the same direction as the price break.
- Bullish Signals: Triggered when the price breaks upward and the CCI shows confirming upward momentum.
- Bearish Signals: Triggered when the price breaks downward and the CCI confirms a downward shift.
Visual Indicators on the Chart
The script provides three distinct visual cues to help the user interpret the data:
- Custom Candlesticks: If enabled, the script can overlay its own "colored" candles. These change color based on whether the current price action is successfully moving in the direction of the detected trend or if it is showing signs of weakness.
- Directional Arrows: The script plots clear arrows (Green for Bullish, Red for Bearish) to pinpoint the exact moment a confirmed Break of Structure occurs.
- Dynamic Coloring: By analyzing the relationship between price movement and the underlying momentum, the script applies specific color profiles to the chart to represent different states of market "health" (e.g., strong trend, weak trend, or neutral consolidation).
Summary for the User
Essentially, this tool acts as a filter. It looks for big structural moves in the price but refuses to give a signal unless the underlying momentum (CCI) agrees with the move. It aims to provide a cleaner trading environment by highlighting only high-probability trend shifts while visually marking the strength of those trends through dynamic candle coloring.
ÿþ/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
/ / | C C I _ O B O S _ W i t h _ C o n f i r m a t i o n . m q 5 |
/ / | C o p y r i g h t 2 0 1 8 , M e t a Q u o t e s S o f t w a r e C o r p . |
/ / | h t t p s : / / m q l 5 . c o m |
/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
# p r o p e r t y c o p y r i g h t "