BBands %B Trendline Indicator for MT4 and MT5
TrueTL Bollinger Bands %B (BBands %B) Trendline indicator calculates the BBands %B values and draws trendlines in the indicator window. It detects trendline breakout and approach events, and provides optional arrows, vertical lines, alerts, multi-timeframe calculation, and EA-ready signal buffers.
The indicator is built for traders who want BBands %B trendline structure without drawing every line manually. Breakout and approach signals can be used visually, through alerts, or from an Expert Advisor.
Key features:
- Works in both MetaTrader 4 and MetaTrader 5.
- Finds and draws Bollinger Bands %B (BBands %B) trendlines automatically in the indicator window.
- Detects trendline breakout and approach events on the calculated indicator line.
- Calculates and plots
BBands %B (or dynamic)with configurable calculation inputs. - Multi-timeframe support with selectable interpolation modes.
- Works with normal candle charts and offline charts such as Renko or block charts.
- Triangle mode can keep the chart cleaner by drawing only two trendlines.
- 5 configurable signal slots. Each slot has its own iCustom buffer, arrow colors, and alert timing.
- Signal types include indicator direction/level events, trendline breakout, and approach-to-trendline events when supported by the selected indicator.
- Alerts can be sent by popup, push notification, email, sound, Telegram, CSV file, and chart pictogram.
- Force refresh and smart HTTP/cache modes help keep visual backtesting and repeated testing faster (more info).
- All trendline styles, signal arrows, indicator line styles, and the show/hide button are controlled from the Inputs tab.
EA and iCustom usage:
The indicator is ready for Expert Advisor integration through iCustom(). The non-signal buffers return the calculated BBands %B line values. The signal buffers return the five user-configurable signal slots, so an EA can read only the events you select in the inputs.
Signal slots are independent. For example, Signal 1 can watch a breakout or approach event, while Signal 2 and Signal 3 can watch different level, direction, or line events.
- Buffer 0:
BBands %B (or dynamic)value buffer. - Buffer 1:
Signal 1buffer. Returns1or-1based on the selected Signal 1 setting. - Buffer 2:
Signal 2buffer. Returns1or-1based on the selected Signal 2 setting. - Buffer 3:
Signal 3buffer. Returns1or-1based on the selected Signal 3 setting. - Buffer 4:
Signal 4buffer. Returns1or-1based on the selected Signal 4 setting. - Buffer 5:
Signal 5buffer. Returns1or-1based on the selected Signal 5 setting.
Indicator Inputs
- Version: shows the installed indicator version. If support asks for your version, this is the value to check.
- Username (without spaces, case sensitive): enter the username you received after purchase. After the first successful activation, you can usually leave it unchanged in other instances (about our ex4 protection).
- Auto refresh: controls when server-side trendline objects are refreshed. Available options are:
OffOn (auto refresh depending on the last closed bar)Force refresh (force refresh if chart scrolling)More info. - Smart HTTP request: controls how often the indicator sends calculation requests. Available options are:
Off - HTTP request on every barEstimate - skip if 99% sure no new objects (faster)Cache - build a cache file and reuse saved results if available (fastest)Cache reset - fully rebuild the cache file (this symbol + period + settings) - Signal scan lookback bars (0=off): controls how many recent bars are rescanned for live signal buffers and visual signal drawing.
0turns this scan off. - Bollinger Bands period: sets this calculation parameter for the BBands %B formula.
Default: 20 - Bollinger Bands deviation: sets the bollinger Bands deviation.
Default: 2.0 - Applied price: selects the price series used by the indicator calculation.
- BBands %B bar shift: shifts the indicator calculation by the selected number of bars. Most users should keep this at
0.Default: 0 - BBands %B timeframe: selects the timeframe used for the BBands %B calculation. It can use the current chart timeframe, fixed timeframes, or relative lower/higher timeframe presets.
- MTF on higher TF only: turns this option on or off.
Default: false - MTF Interpolation mode: controls how values from another timeframe are placed on the current chart. Available options are:
Off (step mode)Linear (average smoothing)Smooth (sine ease in-out)Weighted (closer bars have more weight)SMA (period = 2 × ratio) - Maximum bars to calculate: limits how many bars are calculated. A lower value can improve performance. A higher value gives more history.
Default: 2000 - Show in the indicator window: controls the label shown in the indicator window. Use
Allow multiple instancesif you want to run more than one copy on the same chart. Available options are:Only "TrueTL" (2 indicators doesn't work on same chart)Indicator name (2 indicators doesn't work on same chart)Indicator name + settingsIndicator name + settings + valuesIndicator name + values (2 indicators doesn't work on same chart) - Allow multiple instances (separate settings string): allows several BBands %B Trendline indicators on the same chart by giving each instance its own settings identity.
- Triangle mode (draw only 2 trendlines): draws only two trendlines. Use it when you want a simpler, cleaner view.
Levels Settings
- Show levels: shows or hides the indicator reference levels in the indicator window.
- Level: sets the reference level used for display, coloring, filters, and level-cross signals.
Default: 0 - Color of indicator levels: sets the color of the indicator level lines.
- Style and width of indicator levels: sets the style and width of the indicator level lines. Available options are:
Solid (width 1-5)Dash (width 1)Dot (width 1)DashDot (width 1)DashDotDot (width 1)
Trendline Settings
- Trendline showing mode: chooses which trendline objects remain visible. Available options are:
Show all trendlinesShow all trendlines without labelsShow only upward trendlinesShow only upward trendlines without labelsShow only downward trendlinesShow only downward trendlines without labels - Trendline color: sets the default trendline color.
- Trendline style/width (Off = hide): sets the line preset used for trendlines.
Offhides trendlines. Available options are:OffSolid (width 1-5)Dash (width 1)Dot (width 1)DashDot (width 1)DashDotDot (width 1) - Cut trendline endings at breakout: shortens trendlines at the breakout point, so the chart shows where the break happened more clearly.
- Draw trendlines in the background: places drawn objects behind candles and other chart drawings.
- Status notification corner: sets where chart-side status messages are shown.
Signal Settings
- Approach distance (BBands %B units): sets how close the indicator line must come to a drawn trendline before an approach signal can trigger.
Default: 0.01 - Vertical line on/off and size/style: draws an optional vertical line on signal bars and controls its style and width. Available options are:
OffSolid (width 1-5)DotDashDash-DotDash-Dot-Dot - Arrow on/off and size: draws signal arrows on the main chart and controls their size. Available options are:
OffSize 1-8 - Arrow distance from candle: controls how far arrows are placed from candles. ATR-based distance adapts to volatility. Point-based distance uses fixed point values. Available options are:
Close (1x ATR)Medium (2x ATR)Far (3x ATR)Close (20 points)Medium (50 points)Far (100 points) - Up arrow code (Wingdings): sets the Wingdings symbol for bullish/up signal arrows.
Default: 233 - Down arrow code (Wingdings): sets the Wingdings symbol for bearish/down signal arrows.
Default: 234 - Signal 1-5 Up color / Signal 1-5 Down color: assign separate bullish/up and bearish/down colors to each signal slot. This is useful when several signals are active at the same time.
Alert Settings
- Alert on new trendlines: sends an alert when a new trendline is detected. This works independently from the five signal slots.
- Alert for Signal 1-5: sets alert timing separately for each signal slot. Available options are:
OffAfter candle closedBefore candle is closingBoth - Trendline objects to alert for: selects which chart objects are monitored by trendline breakout and approach alerts. Available options are:
TrueTL drawn trendlines onlyAll trendlines and horizontal linesSelected trendline colors only - Trendline color filter (for ao_selected_colors): defines the monitored object color when alerts are set to selected colors.
- Alert interval limit (minutes, 0=no limit): prevents repeated alerts from firing too often.
0disables the interval limit. - Shortcut key to send test alert: lets you send a test alert from the chart with a keyboard shortcut. Available shortcut values are
Off,0-9, andA-Z. - Alert start time: sets the daily start time for alerts.
00:00to00:00means alerts are allowed all day. - Alert end time: sets the daily end time for alerts.
00:00to00:00means alerts are allowed all day. - Message identifier: adds a short label to alert messages. This is useful when several charts, symbols, or indicator instances are running.
- Alert via email: enables this MetaTrader alert channel.
- Alert via push notification: enables this MetaTrader alert channel.
- Alert via popup window: enables this MetaTrader alert channel.
- Alert with sound: enables this MetaTrader alert channel.
- Sound file: selects the sound file used by sound alerts.
Default: "Tick.wav" - Telegram Notifications: enables Telegram delivery.
- Token: sets the Telegram bot token.
- Chat ID: sets the destination Telegram chat ID.
- Pictogram alert: shows a chart-corner symbol that changes with the latest alert direction.
- Pictogram corner: sets the pictogram corner.
- Pictogram X: sets the pictogram horizontal position.
Default: 15 - Pictogram Y: sets the pictogram vertical position.
Default: 45 - Pictogram size (font): sets the pictogram font size.
Default: 24 - Pictogram symbol (Wingdings code): sets the Wingdings symbol used by the pictogram alert.
Default: 71 - Pictogram UP color: sets the bullish/up pictogram color.
- Pictogram DOWN color: sets the bearish/down pictogram color.
- Pictogram neutral color: sets the neutral pictogram color.
- Write alert to CSV file: writes alerts to a CSV file in the platform files folder for later review or external automation.
Color and Style Settings
- Color mode: controls how the indicator line colors are selected. Available options are:
Simple colorOnly directionDirection with levelsOnly levels - Draw Main line in histogram mode: displays the main line as a histogram instead of a line.
- Color 1-4 of Main line: set the possible color states for the main line. The active color depends on the selected Color mode.
- Style and width of Main line: selects the line style and width for the main line. Available options are:
Solid (width 1-5)Dash (width 1)Dot (width 1)DashDot (width 1)DashDotDot (width 1)
Show/Hide Button Settings
- Enable show/hide button: enables the chart button used to show or hide the indicator without removing it from the chart (more info).
- Shortcut for button: controls the keyboard shortcut for the show/hide button. Available shortcut values are
Off,0-9, andA-Z. - Apply for all TrueTL Indicators on the chart: controls whether the button affects only this instance or all TrueTL indicators on the chart.
- Adjust the corner of button: sets the button corner on the chart.
- Adjust the text of button: sets the button caption.
Default: "BB TL" - Adjust the text's font of button: sets the button font.
Default: "Corbel" - Adjust the text's size of button: sets the button text size.
Default: 9 - Adjust the text's color of button: sets the button text color.
- Adjust the background color of button: sets the button background color while visible.
- Adjust the background color of button when hidden: sets the button background color while hidden.
- Adjust the border color of button: sets the button border color.
- Adjust the coordinate X of button: sets the button X coordinate.
Default: 20 - Adjust the coordinate Y of button: sets the button Y coordinate.
Default: 40 - Adjust the width of button: sets the button width.
Default: 70 - Adjust the height of button: sets the button height.
Default: 20 - Button DPI scale (auto = Windows DPI): controls the button size on different displays. DPI scale can be automatic or fixed. Available options are:
Auto (Windows DPI)50%75%100%125%150%175%200%



