xabcdPattern
Syntax
Parameters
Return Value
Example
//@version=1
init = () => {
indicator({ onMainPanel: true, format: 'inherit' });
};
onTick = () => {
if (index % 200 === 0) { // draw every 200 bars
// 1) Define five anchors
const X = newPoint(time(100), low(100));
const A = newPoint(time(80), high(80));
const B = newPoint(time(60), low(60));
const C = newPoint(time(40), high(40));
const D = newPoint(time(20), low(20));
// 2) Style the pattern
const style = {
fillBackground: true,
transparency: 80,
showLabels: true,
line: { linestyle: 0, linewidth: 2, color: color.blue },
background: color.rgba(0, 128, 255, 0.2)
};
// 3) Draw the pattern
xabcdPattern(X, A, B, C, D, style);
}
};Result

Last updated