Skip to content
All library documents

Color-Coded Weekday Histogram for Trading Charts

Article MQL5 code base

Summary

This programming note describes a chart indicator that marks each day of the week with its own color in a separate-window histogram. It explains the two-buffer arrangement used by the platform’s color-histogram drawing style: one buffer holds histogram values and another selects the color index. A switch on the date’s weekday assigns the corresponding value and color index, while a declared palette maps indices to display colors.

The example teaches a basic way to encode calendar categories visually, which could help a trader inspect whether chart behavior differs across weekdays. It does not provide an analysis of weekday effects, a market-specific application, or evidence that weekday patterns are persistent or tradable. The displayed colors and buffer assignments are implementation details, not signal thresholds. Any strategy based on weekday behavior would need separate testing and controls for instrument, sample period, and transaction costs.

Key ideas

  • A separate-window histogram can visually assign a distinct color to each weekday.
  • The indicator uses one buffer for plotted values and another for color indices.
  • A palette maps integer color indices to the colors shown on the chart.
  • The example explains implementation but presents no evidence of a profitable weekday effect.
  • Any trading use would require separate analysis across markets and time periods.

Tags

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