PINE LIBRARY
Pattern

Library "Pattern"
Pattern object definitions and functions. Easily draw and keep track of patterns, legs, and points.
Supported pattern types (as of Version 1):
Type Leg validation # legs
"xabcd" Direction 3 or 4 (point D not required)
"zigzag" Direction >= 2
"free" None >= 2
erase_label(this)
Delete the point label
Parameters:
this: Point
Returns: Void
draw_label(this, position, clr, transp, txt_clr, txt, tooltip, size)
Draw the point label
Parameters:
this: Point
position
clr
transp
txt_clr
txt
tooltip
size
Returns: line
leg_init(a, b, prev, next, line)
Initialize a pattern leg
Parameters:
a: Point A (required)
b: Point B (required)
prev: Previous leg
next: Next leg
line: Line
Returns: New instance of leg object
erase(this)
Delete the pattern leg
Parameters:
this: Leg
Returns: Void
erase(this)
Parameters:
this
draw(this, clr, style, transp, width)
Draw the pattern leg
Parameters:
this: Leg
clr: Color
style: Style ("solid", "dotted", "dashed", "arrowleft", "arrowright")
transp: Transparency
width: Width
Returns: line
draw(this, clr, style, transp, width)
Parameters:
this
clr
style
transp
width
leg_getLineTerms(this)
Get the slope and y-intercept of a leg
Parameters:
this: Leg
Returns: [slope, y-intercept]
leg_getPrice(this, index)
Get the price (Y) at a given bar index (X) within the leg
Parameters:
this: Leg
index: Bar index
Returns: Price (float)
pattern_init(legs, tp, name, subType, pid)
Initialize a pattern object from a given set of legs
Parameters:
legs: Array of pattern legs (required)
tp: Pattern type ("zigzag", "xabcd", or "free". dft = "free")
name: Pattern name
subType: Pattern subtype
pid: Pattern Identifier string
Returns: New instance of pattern object, if one was successfully created
pattern_init(points, tp, name, subType, pid)
Initialize a pattern object from a given set of points
Parameters:
points
tp: Pattern type ("zigzag", "xabcd", or "free". dft = "free")
name: Pattern name
subType: Pattern subtype
pid: Pattern Identifier string
Returns: New instance of pattern object, if one was successfully created
point
A point on the chart (x,y)
Fields:
x: Bar index (x coordinate)
y
label
leg
A pattern leg (point A to point B)
Fields:
a: Point A
b
deltaX
deltaY
prev
next
retrace
line
pattern
A pattern (set of at least 2 connected legs)
Fields:
legs
type
subType
name
pid
Pattern object definitions and functions. Easily draw and keep track of patterns, legs, and points.
Supported pattern types (as of Version 1):
Type Leg validation # legs
"xabcd" Direction 3 or 4 (point D not required)
"zigzag" Direction >= 2
"free" None >= 2
erase_label(this)
Delete the point label
Parameters:
this: Point
Returns: Void
draw_label(this, position, clr, transp, txt_clr, txt, tooltip, size)
Draw the point label
Parameters:
this: Point
position
clr
transp
txt_clr
txt
tooltip
size
Returns: line
leg_init(a, b, prev, next, line)
Initialize a pattern leg
Parameters:
a: Point A (required)
b: Point B (required)
prev: Previous leg
next: Next leg
line: Line
Returns: New instance of leg object
erase(this)
Delete the pattern leg
Parameters:
this: Leg
Returns: Void
erase(this)
Parameters:
this
draw(this, clr, style, transp, width)
Draw the pattern leg
Parameters:
this: Leg
clr: Color
style: Style ("solid", "dotted", "dashed", "arrowleft", "arrowright")
transp: Transparency
width: Width
Returns: line
draw(this, clr, style, transp, width)
Parameters:
this
clr
style
transp
width
leg_getLineTerms(this)
Get the slope and y-intercept of a leg
Parameters:
this: Leg
Returns: [slope, y-intercept]
leg_getPrice(this, index)
Get the price (Y) at a given bar index (X) within the leg
Parameters:
this: Leg
index: Bar index
Returns: Price (float)
pattern_init(legs, tp, name, subType, pid)
Initialize a pattern object from a given set of legs
Parameters:
legs: Array of pattern legs (required)
tp: Pattern type ("zigzag", "xabcd", or "free". dft = "free")
name: Pattern name
subType: Pattern subtype
pid: Pattern Identifier string
Returns: New instance of pattern object, if one was successfully created
pattern_init(points, tp, name, subType, pid)
Initialize a pattern object from a given set of points
Parameters:
points
tp: Pattern type ("zigzag", "xabcd", or "free". dft = "free")
name: Pattern name
subType: Pattern subtype
pid: Pattern Identifier string
Returns: New instance of pattern object, if one was successfully created
point
A point on the chart (x,y)
Fields:
x: Bar index (x coordinate)
y
label
leg
A pattern leg (point A to point B)
Fields:
a: Point A
b
deltaX
deltaY
prev
next
retrace
line
pattern
A pattern (set of at least 2 connected legs)
Fields:
legs
type
subType
name
pid
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.