Description The "Display MB on Bars" Pine Script indicator is designed to visually represent Market Breadth values and R4.5 scores on trading charts. This script enables traders to highlight and analyze key market behavior using pre-defined thresholds for MB scores and dynamically calculated R4.5 values. Additionally, it includes a moving average status table to assess price levels relative to the 10-day and 20-day moving averages.
Features: 1. COB Date Matching: Displays data corresponding to specific "COB dates" provided by the user. 2. MB Value Visualization: o Highlights bars with a background color based on MB values: Red if MB ≤ MB_Red (default: -1). Green if MB ≥ MB_Green (default: 3). 3. R4.5 Scores Display: o Creates a label on the chart with the MB and R4.5 values when conditions are met (e.g., R4.5 > 200 or specific MB thresholds). 4. Index Moving Average Comparison: o Calculates 10-day and 20-day moving averages for the selected symbol (default: NSE:NIFTYMIDSML400). o Shows the price position relative to these moving averages in a table.
How to Use: 1. Configure Inputs: o COB Dates: Enter a comma-separated list of dates in the format DD-MM-YYYY. o MB Values: Provide the corresponding MB scores for the COB dates. o R4.5 Values: Provide the R4.5 scores for the COB dates. o Set the thresholds for MB values (MB Red<= and MB Green>=). o Toggle features like MB, RS (R4.5), and the moving average status table. 2. Interpret the Output: o Observe background colors on the bars: Red: Indicates MB is less than or equal to the lower threshold. Green: Indicates MB exceeds the upper threshold. o Check labels above bars for R4.5 and MB values when conditions are met. o Refer to the status table on the top-right corner to understand price positions relative to 10-day and 20-day moving averages.
This script is especially useful for traders seeking insights into custom metrics like MB and R4.5, enabling quick identification of key patterns and trends in the market.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.