timeCycles
The Time Cycles tool plots vertical lines forward in time based on the distance between two anchors. Unlike cyclic lines that may alternate, time cycles simply project repeating time intervals, helping traders anticipate when significant events or reversals might occur.
Syntax
timeCycles(originPoint, targetPoint, styles?)
Parameters
originPoint (PricedData) · First anchor (time & price), starting the cycle projection.
targetPoint (PricedData) · Second anchor (time & price), defines the cycle length.
styles (TimeCyclesStyleOverrides) · Style and display options:
fillBackground(boolean) · Fill alternating zones between cycles.transparency(number) · Adjust fill transparency (0–100).showLabels(boolean) · Show cycle labels.line(LinesLevels without coeff) · Style of cycle dividers (linestyle,linewidth,color).background(RGBAColor | BaseColors) · Color for alternating background fill.
Return Value
(string) · The drawing ID of the created Time Cycles.
Example
Every 80 candles, we project time cycles using two anchors that define the interval.
//@version=1
init = () => {
indicator({ onMainPanel: true, format: 'inherit' });
};
onTick = () => {
if (index % 80 === 0) { // draw every 80 bars
// 1) Define anchors
const O = newPoint(time(120), closeC(120)); // starting cycle
const T = newPoint(time(80), closeC(80)); // interval
// 2) Style settings
const style = {
fillBackground: true,
transparency: 85,
showLabels: true,
line: { linestyle: 2, linewidth: 1, color: color.blue },
background: color.rgba(0, 0, 255, 0.15)
};
// 3) Draw time cycles
timeCycles(O, T, style);
}
};Tips
Works best when used on larger swings, so cycles project meaningful future intervals.
Try testing different anchor pairs to discover which interval matches market rhythm.
Combine with Fibonacci time ratios (0.618, 1, 1.618) to refine projections.
Warning
Avoid choosing anchors that are too close (e.g., 1–2 bars apart) — cycles will repeat too quickly and clutter the chart.
Good Practice
Keep your cycle style subtle so it doesn’t overpower price action.
Use multiple overlapping cycle sets (short-term and long-term) to find stronger timing signals.
Last updated