Skip to content
All library documents

Daily Pivot Points Using an Adjustable Hourly Close

Article MQL5 code base

Summary

This indicator calculates daily pivot points from a selected hourly bar’s close on the preceding trading day. Its adjustable UTC close time lets traders align the calculation with a chosen market session, such as the New York close, rather than relying on the broker’s or user’s local day boundary. It can also display weekly and monthly pivot levels and current-day midpoints.

The calculation treats Sunday data-feed bars specially so they align with Monday, using different day-of-week handling and hourly-bar offsets to locate the relevant closing bar. The stated limitation is that the indicator relies on available hourly history: once that history runs out, its arrays can contain incorrect values, although drawing is cut off before they appear on the chart. No trading performance evidence is provided, and the behavior may depend on each broker’s hourly history and feed conventions.

Key ideas

  • The indicator derives daily pivot levels from the prior session’s selected hourly close.
  • The close-time input can be adjusted to match a preferred market session.
  • Sunday bars are handled separately so they align with Monday calculations.
  • Weekly and monthly pivots and daily midpoints are optional display features.
  • Limited hourly history can produce incorrect values in the underlying arrays.

Tags

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