All indicators

Time Based Vertical Lines

Sep 13, 2014

Static chart image
Time Based

The CM Time Based Vertical Lines indicator tool provides a visual way to plot recurring time-based markers on intraday charts to help traders identify session transitions and specific time intervals.

Usage

The Usage section describes how the script can be used to organize price action analysis based on time. Traders can use this tool to highlight specific moments in the trading day, such as:

  • Daily Change: Plot a line at midnight to clearly see where one trading day ends and the next begins on intraday timeframes.
  • Session Openings/Closings: Mark the start and end of London, New York, or Asian sessions.
  • Fixed Intervals: Set markers every 4 hours to analyze 4-hour price action trends on lower timeframes.
  • Custom Events: Identify specific recurring events, such as news releases or market fix times.

Users can toggle up to 6 different custom time lines, each with its own independent session setting.

Details

The script functions by checking if the current bar's time falls within a user-defined session string. It utilizes the time() function with a session parameter to determine when to trigger the visual background highlight. Although titled "Vertical Lines," the script uses the bgcolor() function to create vertical bands. To make these appear as thin vertical lines, users should set the session duration to match the chart's timeframe (e.g., a 1-minute window on a 1-minute chart).

Settings

Custom Lines 1-6

Each of the six customizable lines includes the following settings:

  • Show Custom X?: Toggles the visibility of the specific time marker on the chart.
  • Plot Vertical Line On Chart-Custom X: An internal index used for calculation logic.
  • Session (e.g., 1 - Midnight): Defines the time range for the marker using the HHMM-HHMM format.

Guidance Notes

  • Stocks Adjustment: Advice for adjusting session times (e.g., 0930) to align with equity market opens.
  • Timeframe Alignment: Recommendation to match the session start and end times to the chart's periodicity for the best visual result.

FAQ

How do I change the color of the lines?

You can adjust the colors and transparency of each marker by navigating to the "Style" tab in the indicator settings.

Why does the line look like a wide box?

The width of the marker is determined by the duration of the session input. For a thin line, ensure the start and end times in the session setting are close together (e.g., '0000-0001').

How can I access this indicator?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.