Skip to content
All library documents

Configurable Candle-Size Text and Chart Object Management

Article MQL5 code base

Summary

This document describes a chart indicator that displays a bar’s size as the difference between two selected price fields, such as high and low or close and open. Users can choose the fields being compared, set text colors for bullish and bearish bars, adjust the text’s distance from the bar, and limit how many bars receive labels. Labels appear below bullish bars and above other bars.

The note also explains how the indicator names and tracks its chart objects. It removes those objects during initialization, recalculation after a data reset, and deinitialization, while clearing its stored name list when the bar count changes. This is intended to prevent stale objects and keep the number of displayed labels within the configured limit. The document offers implementation and display behavior, but no trading signal, performance evidence, or guidance for interpreting candle size as a forecast. The price-field difference is a measurement of bar range or movement, and its meaning depends on which fields are selected.

Key ideas

  • The indicator calculates a displayed value by subtracting one selected bar price field from another.
  • Users can configure text colors, placement offset, and the number of labeled bars.
  • Bullish bars receive labels below them, while other bars receive labels above.
  • The indicator tracks chart objects by bar time and deletes them during lifecycle and recalculation events.
  • The document explains display mechanics but provides no evidence that the measurement predicts prices.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.