fibSpiral
Syntax
Parameters
Return Value
Example
//@version=1
init = () => {
// Put drawings on the main price chart and inherit its price formatting
indicator({ onMainPanel: true, format: 'inherit' });
};
onTick = () => {
// Draw occasionally to avoid clutter
if (index % 70 === 0) { // ← change 70 for more/less frequency
// 1) Choose anchors
const base = newPoint(time(6), closeC(6)); // spiral center
const scale = newPoint(time(5), high(5)); // sets initial radius
// 2) Define style once (no coeffs for spiral)
const style = {
linestyle: 1, // dashed
linewidth: 5,
linecolor: color.red
};
// 3) Build the spiral
fibSpiral(base, scale, style);
}
};Result

Last updated