cyclicLines
The Cyclic Lines tool draws a sequence of vertical lines spaced according to the distance between two anchors. Traders use it to project recurring time cycles, helping to anticipate moments when the market might reverse or accelerate.
Syntax
cyclicLines(originPoint, targetPoint, styles?)
Parameters
originPoint (PricedData) · The first anchor (time & price), where the cycle starts.
targetPoint (PricedData) · The second anchor (time & price), which sets the spacing for repeating cycles.
styles (CyclicLinesStyleOverrides) · Visual customization:
fillBackground(boolean) · Fill alternating cycle zones with color.transparency(number) · Transparency of the background (0–100).showLabels(boolean) · Show labels on cycle lines.line(LinesLevels without coeff) · Line style (linestyle,linewidth,color).background(RGBAColor | BaseColors) · Fill color for cycle zones.
Return Value
(string) · The drawing ID of the created Cyclic Lines.
Example
Every 60 candles, draw cyclic lines using two anchors to repeat vertical divisions forward in time.
//@version=1
init = () => {
indicator({ onMainPanel: true, format: 'inherit' });
};
onTick = () => {
if (index % 60 === 0) { // draw every 60 bars
// 1) Define two anchors
const O = newPoint(time(100), closeC(100));
const T = newPoint(time(60), closeC(60));
// 2) Style setup
const style = {
fillBackground: true,
transparency: 85,
showLabels: true,
line: { linestyle: 2, linewidth: 1, color: color.gray },
background: color.rgba(0, 128, 255, 0.15)
};
// 3) Draw cyclic lines
cyclicLines(O, T, style);
}
};Tips
Place anchors on swing highs/lows so cycles align with market rhythm.
Best used when markets show repeated time patterns.
Combine with oscillators to see if turning points match cycle hits.
Warning
Anchors that are too close will generate overly frequent lines, cluttering the chart.
Good Practice
Keep cycles styled with faint colors so they don’t overwhelm price action.
Compare multiple cycle lengths (short-term vs long-term) to find overlapping “hot zones.”
Last updated