Crab Harmonic Pattern [TradingFinder] Harmonic Chart patterns🔵 Introduction
The Crab pattern is recognized as a reversal pattern in technical analysis, utilizing Fibonacci numbers and percentages for chart analysis. This pattern can predict suitable price reversal areas on charts using Fibonacci ratios.
The structure of the Crab pattern can manifest in both bullish and bearish forms on the chart. By analyzing this structure, traders can identify points where the price direction changes, which are essential for making informed trading decisions.
The pattern's structure is visually represented on charts as shown below. To gain a deeper understanding of the Crab pattern's functionality, it is beneficial to become familiar with its various harmonic forms.
🟣 Types of Crab Patterns
The Crab pattern is categorized into two types based on its structure: bullish and bearish. The bullish Crab is denoted by the letter M, while the bearish Crab is indicated by the letter W in technical analysis.
Typically, a bullish Crab pattern signals a potential price increase, whereas a bearish Crab pattern suggests a potential price decrease on the chart.
The direction of price movement depends significantly on the price's position within the chart. By identifying whether the pattern is bullish or bearish, traders can determine the likely direction of the price reversal.
Bullish Crab :
Bearish Crab :
🔵 How to Use
When trading using the Crab pattern, crucial parameters include the end time of the correction and the point at which the chart reaches its peak. Generally, the best time to buy is when the chart nears the end of its correction, and the best time to sell is when it approaches the peak price.
As we discussed, the end of the price correction and the time to reach the peak are measured using Fibonacci ratios. By analyzing these levels, traders can estimate the end of the correction in the chart waves and select a buying position for their stock or asset upon reaching that ratio.
🟣 Bullish Crab Pattern
In this pattern, the stock price is expected to rise at the pattern's completion, transitioning into an upward trend. The bullish Crab pattern usually begins with an upward trend, followed by a price correction, after which the stock resumes its upward movement.
If a deeper correction occurs, the price will change direction at some point on the chart and rise again towards its target price. Price corrections play a critical role in this pattern, as it aims to identify entry and exit points using Fibonacci ratios, allowing traders to make purchases at the end of the corrections.
When the price movement lines are connected on the chart, the bullish Crab pattern resembles the letter M.
🟣 Bearish Crab Pattern
In this pattern, the stock price is expected to decline at the pattern's completion, leading to a strong downward trend. The bearish Crab pattern typically starts with a price correction in a downward trend and, after several fluctuations, reaches a peak where the direction changes downward, resulting in a significant price drop.
This pattern uses Fibonacci ratios to identify points where the price movement is likely to change direction, enabling traders to exit their positions at the chart's peak. When the price movement lines are connected on the chart, the bearish Crab pattern resembles the letter W.
🔵 Setting
🟣 Logical Setting
ZigZag Pivot Period : You can adjust the period so that the harmonic patterns are adjusted according to the pivot period you want. This factor is the most important parameter in pattern recognition.
Show Valid Format : If this parameter is on "On" mode, only patterns will be displayed that they have exact format and no noise can be seen in them. If "Off" is, the patterns displayed that maybe are noisy and do not exactly correspond to the original pattern.
Show Formation Last Pivot Confirm : if Turned on, you can see this ability of patterns when their last pivot is formed. If this feature is off, it will see the patterns as soon as they are formed. The advantage of this option being clear is less formation of fielded patterns, and it is accompanied by the latest pattern seeing and a sharp reduction in reward to risk.
Period of Formation Last Pivot : Using this parameter you can determine that the last pivot is based on Pivot period.
🟣 Genaral Setting
Show : Enter "On" to display the template and "Off" to not display the template.
Color : Enter the desired color to draw the pattern in this parameter.
LineWidth : You can enter the number 1 or numbers higher than one to adjust the thickness of the drawing lines. This number must be an integer and increases with increasing thickness.
LabelSize : You can adjust the size of the labels by using the "size.auto", "size.tiny", "size.smal", "size.normal", "size.large" or "size.huge" entries.
🟣 Alert Setting
Alert : On / Off
Message Frequency : This string parameter defines the announcement frequency. Choices include: "All" (activates the alert every time the function is called), "Once Per Bar" (activates the alert only on the first call within the bar), and "Once Per Bar Close" (the alert is activated only by a call at the last script execution of the real-time bar upon closing). The default setting is "Once per Bar".
Show Alert Time by Time Zone : The date, hour, and minute you receive in alert messages can be based on any time zone you choose. For example, if you want New York time, you should enter "UTC-4". This input is set to the time zone "UTC" by default.
Drawingtools
lib_plot_composite_objectsLibrary "lib_plot_composite_objects"
library building on top of lib_plot_objects for composite objects such as Triangles and Polygons. heavily using chart.points
method tostring(this, date_format)
Namespace types: Triangle
Parameters:
this (Triangle)
date_format (simple string)
method tostring(this, date_format)
Namespace types: TriangleFill
Parameters:
this (TriangleFill)
date_format (simple string)
method tostring(this, date_format)
Namespace types: Polygon
Parameters:
this (Polygon)
date_format (simple string)
method tostring(this, date_format)
Namespace types: PolygonFill
Parameters:
this (PolygonFill)
date_format (simple string)
method tostring(this, date_format)
Namespace types: Triangle
Parameters:
this (Triangle )
date_format (simple string)
method tostring(this, date_format)
Namespace types: Polygon
Parameters:
this (Polygon )
date_format (simple string)
method tostring(this, date_format)
Namespace types: TriangleFill
Parameters:
this (TriangleFill )
date_format (simple string)
method tostring(this, date_format)
Namespace types: PolygonFill
Parameters:
this (PolygonFill )
date_format (simple string)
method create_triangle(this, b, c, args)
Namespace types: chart.point
Parameters:
this (chart.point)
b (chart.point)
c (chart.point)
args (LineArgs type from robbatt/lib_plot_objects/32)
method create_triangle(this, c)
Namespace types: D.Line
Parameters:
this (Line type from robbatt/lib_plot_objects/32)
c (chart.point)
method create_polygon(points, args)
Namespace types: chart.point
Parameters:
points (chart.point )
args (LineArgs type from robbatt/lib_plot_objects/32)
method create_polygon(start, others, args)
Namespace types: chart.point
Parameters:
start (chart.point)
others (chart.point )
args (LineArgs type from robbatt/lib_plot_objects/32)
method create_fill(this, fill_color)
Namespace types: Triangle
Parameters:
this (Triangle)
fill_color (color)
method create_fill(this, fill_color)
Namespace types: Polygon
Parameters:
this (Polygon)
fill_color (color)
method create_center_label(this, txt, args, tooltip)
Namespace types: Triangle
Parameters:
this (Triangle)
txt (string)
args (LabelArgs type from robbatt/lib_plot_objects/32)
tooltip (string)
method create_label(this, txt, args, tooltip)
Namespace types: Polygon
Parameters:
this (Polygon)
txt (string)
args (LabelArgs type from robbatt/lib_plot_objects/32)
tooltip (string)
method nz(this, default)
Namespace types: Triangle
Parameters:
this (Triangle)
default (Triangle)
method nz(this, default)
Namespace types: TriangleFill
Parameters:
this (TriangleFill)
default (TriangleFill)
method nz(this, default)
Namespace types: Polygon
Parameters:
this (Polygon)
default (Polygon)
method nz(this, default)
Namespace types: PolygonFill
Parameters:
this (PolygonFill)
default (PolygonFill)
method enqueue(id, item, max)
Namespace types: Triangle
Parameters:
id (Triangle )
item (Triangle)
max (int)
method enqueue(id, item, max)
Namespace types: Polygon
Parameters:
id (Polygon )
item (Polygon)
max (int)
method enqueue(id, item, max)
Namespace types: TriangleFill
Parameters:
id (TriangleFill )
item (TriangleFill)
max (int)
method enqueue(id, item, max)
Namespace types: PolygonFill
Parameters:
id (PolygonFill )
item (PolygonFill)
max (int)
method update(this, a, b, c)
Namespace types: Triangle
Parameters:
this (Triangle)
a (chart.point)
b (chart.point)
c (chart.point)
method update(this, points)
Namespace types: Polygon
Parameters:
this (Polygon)
points (chart.point )
method delete(this)
Namespace types: Triangle
Parameters:
this (Triangle)
method delete(this)
Namespace types: TriangleFill
Parameters:
this (TriangleFill)
method delete(this)
Namespace types: Polygon
Parameters:
this (Polygon)
method delete(this)
Namespace types: PolygonFill
Parameters:
this (PolygonFill)
method delete(this)
Namespace types: Triangle
Parameters:
this (Triangle )
method delete(this)
Namespace types: TriangleFill
Parameters:
this (TriangleFill )
method delete(this)
Namespace types: Polygon
Parameters:
this (Polygon )
method delete(this)
Namespace types: PolygonFill
Parameters:
this (PolygonFill )
method draw(this, ab_args_override, ac_args_override, bc_args_override)
Namespace types: Triangle
Parameters:
this (Triangle)
ab_args_override (LineArgs type from robbatt/lib_plot_objects/32)
ac_args_override (LineArgs type from robbatt/lib_plot_objects/32)
bc_args_override (LineArgs type from robbatt/lib_plot_objects/32)
method draw(this)
Namespace types: Polygon
Parameters:
this (Polygon)
method draw(this)
Namespace types: TriangleFill
Parameters:
this (TriangleFill)
method draw(this)
Namespace types: PolygonFill
Parameters:
this (PolygonFill)
method draw(this)
Namespace types: Triangle
Parameters:
this (Triangle )
method draw(this)
Namespace types: TriangleFill
Parameters:
this (TriangleFill )
method draw(this)
Namespace types: Polygon
Parameters:
this (Polygon )
method draw(this)
Namespace types: PolygonFill
Parameters:
this (PolygonFill )
method apply_style(this, args)
Namespace types: Triangle
Parameters:
this (Triangle)
args (LineArgs type from robbatt/lib_plot_objects/32)
method apply_style(this, args)
Namespace types: Polygon
Parameters:
this (Polygon)
args (LineArgs type from robbatt/lib_plot_objects/32)
method apply_style(this, args)
Namespace types: Triangle
Parameters:
this (Triangle )
args (LineArgs type from robbatt/lib_plot_objects/32)
method apply_style(this, args)
Namespace types: Polygon
Parameters:
this (Polygon )
args (LineArgs type from robbatt/lib_plot_objects/32)
Triangle
Fields:
a (chart.point) : first Corner
b (chart.point) : second Corner
c (chart.point) : third Corner
args (LineArgs type from robbatt/lib_plot_objects/32) : Wrapper for reusable arguments for line.new()
ab (Line type from robbatt/lib_plot_objects/32)
ac (Line type from robbatt/lib_plot_objects/32)
bc (Line type from robbatt/lib_plot_objects/32)
TriangleFill
Fields:
triangle (Triangle) : The Triangle object
plot (LineFill type from robbatt/lib_plot_objects/32) : The linefill object to be added and plotted via draw()
Polygon
Fields:
points (chart.point ) : array of points that make up the Polygon
center (chart.point) : Center point of the Polygon, can be used for a label and will be center for PolygonFill
args (LineArgs type from robbatt/lib_plot_objects/32) : Wrapper for reusable arguments for line.new()
plot (Line type from robbatt/lib_plot_objects/32) : An array of Lines that form Polygon Border
PolygonFill
Fields:
poly (Polygon) : the Polygon
fill_color (series color) : The color used to fill the space between the lines.
plot (TriangleFill )
lib_zigLibrary "lib_zig"
Object oriented implementation of ZigZag
method tostring(this, date_format)
Namespace types: Zigzag
Parameters:
this (Zigzag)
date_format (simple string)
method update(this)
Namespace types: Zigzag
Parameters:
this (Zigzag)
method draw(this, colors)
Namespace types: Zigzag
Parameters:
this (Zigzag)
colors (PivotColors type from robbatt/lib_pivot/19)
Zigzag
Fields:
max_pivots (series__integer)
hldata (|robbatt/lib_pivot/19;HLData|#OBJ)
pivots (array__|robbatt/lib_pivot/19;Pivot|#OBJ)
lib_plot_objectsLibrary "lib_plot_objects"
library wrapping basic builtin object constructors, to be able to do calculations with points/lines/boxes/triangles/polygons via libraries and on securities. inspired by Trendoscope's ( and ) with added update mechanism to not have to recreate objects on every iteration for continously drawn items, automated xloc selection for coordinates, compatibility check for Points, added Triangle and Polygon types, object reflection via tostring to valid json (logging via webhook)
method assert_same_xloc(a, b, test)
checks two points for compatibility, i.e. having the same xloc
Namespace types: Point
Parameters:
a (Point)
b (Point)
test (Test type from robbatt/lib_unit/6)
method assert_same_xloc(a, b, test)
checks two lines for compatibility, i.e. having the same xloc
Namespace types: Line
Parameters:
a (Line)
b (Line)
test (Test type from robbatt/lib_unit/6)
method or_default(args)
checks args oject for being na, if so, provide a default instead
Namespace types: LineArgs
Parameters:
args (LineArgs)
method or_default(args)
checks args oject for being na, if so, provide a default instead
Namespace types: LabelArgs
Parameters:
args (LabelArgs)
method or_default(args)
checks args oject for being na, if so, provide a default instead
Namespace types: BoxArgs
Parameters:
args (BoxArgs)
method or_default(args)
checks args oject for being na, if so, provide a default instead
Namespace types: BoxTextArgs
Parameters:
args (BoxTextArgs)
method x(point, xloc)
automatically returns the correct x coordinate, based on the point's set xloc
Namespace types: Point
Parameters:
point (Point)
xloc (string)
method tostring(this, date_format)
converts object to json representation
Namespace types: Point
Parameters:
this (Point)
date_format (string)
method tostring(this, date_format)
converts object to json representation
Namespace types: Point
Parameters:
this (Point )
date_format (string)
method tostring(this)
converts object to json representation
Namespace types: LineArgs
Parameters:
this (LineArgs)
method tostring(this, date_format)
converts object to json representation
Namespace types: Line
Parameters:
this (Line)
date_format (string)
method tostring(this)
Namespace types: LabelArgs
Parameters:
this (LabelArgs)
method tostring(this, date_format)
Namespace types: Label
Parameters:
this (Label)
date_format (string)
method tostring(this, date_format)
Namespace types: LineFill
Parameters:
this (LineFill)
date_format (string)
method tostring(this)
Namespace types: BoxArgs
Parameters:
this (BoxArgs)
method tostring(this)
Namespace types: BoxTextArgs
Parameters:
this (BoxTextArgs)
method tostring(this, date_format)
Namespace types: Box
Parameters:
this (Box)
date_format (string)
method tostring(this, date_format)
Namespace types: Triangle
Parameters:
this (Triangle)
date_format (string)
method tostring(this, date_format)
Namespace types: TriangleFill
Parameters:
this (TriangleFill)
date_format (string)
method tostring(this, date_format)
Namespace types: Polygon
Parameters:
this (Polygon)
date_format (string)
method tostring(this, date_format)
Namespace types: PolygonFill
Parameters:
this (PolygonFill)
date_format (string)
method tostring(this, date_format)
Namespace types: Line
Parameters:
this (Line )
date_format (string)
method tostring(this, date_format)
Namespace types: Box
Parameters:
this (Box )
date_format (string)
method tostring(this, date_format)
Namespace types: Triangle
Parameters:
this (Triangle )
date_format (string)
method tostring(this, date_format)
Namespace types: Polygon
Parameters:
this (Polygon )
date_format (string)
method tostring(this, date_format)
Namespace types: PolygonFill
Parameters:
this (PolygonFill )
date_format (string)
method create_center(points)
Namespace types: Point
Parameters:
points (Point )
method create_center(this, other)
Namespace types: Point
Parameters:
this (Point)
other (Point)
method create_center(this)
Namespace types: Line
Parameters:
this (Line)
method create_line(this, other, args)
Namespace types: Point
Parameters:
this (Point)
other (Point)
args (LineArgs)
method create_triangle(this, b, c, args)
Namespace types: Point
Parameters:
this (Point)
b (Point)
c (Point)
args (LineArgs)
method create_triangle(this, c)
Namespace types: Line
Parameters:
this (Line)
c (Point)
method create_box(this, other, txt, args, text_args)
Namespace types: Point
Parameters:
this (Point)
other (Point)
txt (string)
args (BoxArgs)
text_args (BoxTextArgs)
method create_box(this, txt, args, text_args)
Namespace types: Line
Parameters:
this (Line)
txt (string)
args (BoxArgs)
text_args (BoxTextArgs)
method create_polygon(points, args)
Namespace types: Point
Parameters:
points (Point )
args (LineArgs)
method create_polygon(start, others, args)
Namespace types: Point
Parameters:
start (Point)
others (Point )
args (LineArgs)
method create_fill(this, other, fill_color)
Namespace types: Line
Parameters:
this (Line)
other (Line)
fill_color (color)
method create_fill(this, fill_color)
Namespace types: Triangle
Parameters:
this (Triangle)
fill_color (color)
method create_fill(this, fill_color)
Namespace types: Polygon
Parameters:
this (Polygon)
fill_color (color)
method create_label(this, txt, args, tooltip)
Namespace types: Point
Parameters:
this (Point)
txt (string)
args (LabelArgs)
tooltip (string)
method create_label(this, txt, args, tooltip)
Namespace types: Line
Parameters:
this (Line)
txt (string)
args (LabelArgs)
tooltip (string)
method create_label(this, txt, args, tooltip)
Namespace types: Box
Parameters:
this (Box)
txt (string)
args (LabelArgs)
tooltip (string)
method create_label(this, txt, args, tooltip)
Namespace types: Triangle
Parameters:
this (Triangle)
txt (string)
args (LabelArgs)
tooltip (string)
method create_label(this, txt, args, tooltip)
Namespace types: Polygon
Parameters:
this (Polygon)
txt (string)
args (LabelArgs)
tooltip (string)
method update(this, bar_time, bar_idx, price)
Namespace types: Point
Parameters:
this (Point)
bar_time (int)
bar_idx (int)
price (float)
method update(this, update)
Namespace types: Point
Parameters:
this (Point)
update (Point)
method update(this, point)
Namespace types: Label
Parameters:
this (Label)
point (Point)
method update(this, start, end)
Namespace types: Line
Parameters:
this (Line)
start (Point)
end (Point)
method update(this, left_top, right_bottom)
Namespace types: Box
Parameters:
this (Box)
left_top (Point)
right_bottom (Point)
method update(this, a, b, c)
Namespace types: Triangle
Parameters:
this (Triangle)
a (Point)
b (Point)
c (Point)
method update(this, points)
Namespace types: Polygon
Parameters:
this (Polygon)
points (Point )
method delete(this)
Namespace types: Line
Parameters:
this (Line)
method delete(this)
Namespace types: Label
Parameters:
this (Label)
method delete(this)
Namespace types: LineFill
Parameters:
this (LineFill)
method delete(this)
Namespace types: Box
Parameters:
this (Box)
method delete(this)
Namespace types: TriangleFill
Parameters:
this (TriangleFill)
method delete(this)
Namespace types: Triangle
Parameters:
this (Triangle)
method delete(this)
Namespace types: Polygon
Parameters:
this (Polygon)
method delete(this)
Namespace types: PolygonFill
Parameters:
this (PolygonFill)
method delete(this)
Namespace types: Line
Parameters:
this (Line )
method delete(this)
Namespace types: Label
Parameters:
this (Label )
method delete(this)
Namespace types: LineFill
Parameters:
this (LineFill )
method delete(this)
Namespace types: Box
Parameters:
this (Box )
method delete(this)
Namespace types: TriangleFill
Parameters:
this (TriangleFill )
method delete(this)
Namespace types: Polygon
Parameters:
this (Polygon )
method delete(this)
Namespace types: Triangle
Parameters:
this (Triangle )
method delete(this)
Namespace types: PolygonFill
Parameters:
this (PolygonFill )
method draw(this)
Namespace types: Label
Parameters:
this (Label)
method draw(this)
Namespace types: Line
Parameters:
this (Line)
method draw(this)
Namespace types: Box
Parameters:
this (Box)
method draw(this)
Namespace types: Triangle
Parameters:
this (Triangle)
method draw(this)
Namespace types: Polygon
Parameters:
this (Polygon)
method draw(this)
Namespace types: LineFill
Parameters:
this (LineFill)
method draw(this)
Namespace types: TriangleFill
Parameters:
this (TriangleFill)
method draw(this)
Namespace types: PolygonFill
Parameters:
this (PolygonFill)
Point
Fields:
bar_time (series int) : time based x coordinate
bar_idx (series int) : bar index based x coordinate
price (series float) : price based y coordinate
xloc (series string) : To select if x coordinate is represented by bar_idx or bar_time. Possible values: xloc.bar_index and xloc.bar_time. Default is xloc.bar_index.
LabelArgs
Fields:
text_color (series color) : Text color.
bg_color (series color) : Color of the label border and arrow.
text_font_family (series string) : The font family of the text. Optional. The default value is font.family_default. Possible values: font.family_default, font.family_monospace.
yloc (series string) : Possible values are yloc.price, yloc.abovebar, yloc.belowbar. If yloc=yloc.price, y argument specifies the price of the label position. If yloc=yloc.abovebar, label is located above bar. If yloc=yloc.belowbar, label is located below bar. Default is yloc.price.
style (series string) : Label style. Possible values: label.style_none, label.style_xcross, label.style_cross, label.style_triangleup, label.style_triangledown, label.style_flag, label.style_circle, label.style_arrowup, label.style_arrowdown, label.style_label_up, label.style_label_down, label.style_label_left, label.style_label_right, label.style_label_lower_left, label.style_label_lower_right, label.style_label_upper_left, label.style_label_upper_right, label.style_label_center, label.style_square, label.style_diamond, label.style_text_outline. Default is label.style_label_down.
size (series string) : Label size. Possible values: size.auto, size.tiny, size.small, size.normal, size.large, size.huge. Default value is size.normal.
text_align (series string) : Label text alignment. Possible values: text.align_left, text.align_center, text.align_right. Default value is text.align_center.
Label
Fields:
point (Point) : The Label coordinates
txt (series string) : Label text. Default is empty string.
args (LabelArgs) : Wrapper for reusable arguments for label.new()
tooltip (series string) : Hover to see tooltip label.
plot (series label) : The label object to be added and plotted via draw()
LineArgs
Fields:
line_color (series color) : Line color.
style (series string) : Line style. Possible values: line.style_solid, line.style_dotted, line.style_dashed, line.style_arrow_left, line.style_arrow_right, line.style_arrow_both.
width (series int) : Line width in pixels.
extend (series string) : f extend=extend.none, draws segment starting at point (x1, y1) and ending at point (x2, y2). If extend is equal to extend.right or extend.left, draws a ray starting at point (x1, y1) or (x2, y2), respectively. If extend=extend.both, draws a straight line that goes through these points. Default value is extend.none.
Line
Fields:
start (Point) : starting point of the line
end (Point)
args (LineArgs) : Wrapper for reusable arguments for line.new()
plot (series line) : The line object to be added and plotted via draw()
LineFill
Fields:
a (Line) : The first Line object
b (Line) : The second Line object
fill_color (series color) : The color used to fill the space between the lines.
plot (series linefill) : The linefill object to be added and plotted via draw()
BoxArgs
Fields:
border_color (series color) : Color of the four borders. Optional. The default is color.blue.
border_width (series int) : Width of the four borders, in pixels. Optional. The default is 1 pixel.
border_style (series string) : Style of the four borders. Possible values: line.style_solid, line.style_dotted, line.style_dashed. Optional. The default value is line.style_solid.
bg_color (series color) : Background color of the box. Optional. The default is color.blue.
extend (series string) : When extend.none is used, the horizontal borders start at the left border and end at the right border. With extend.left or extend.right, the horizontal borders are extended indefinitely to the left or right of the box, respectively. With extend.both, the horizontal borders are extended on both sides. Optional. The default value is extend.none.
BoxTextArgs
Fields:
text_color (series color) : The color of the text. Optional. The default is color.black.
text_size (series string) : The size of the text. An optional parameter, the default value is size.auto. Possible values: size.auto, size.tiny, size.small, size.normal, size.large, size.huge.
text_halign (series string) : The horizontal alignment of the box's text. Optional. The default value is text.align_center. Possible values: text.align_left, text.align_center, text.align_right.
text_valign (series string) : The vertical alignment of the box's text. Optional. The default value is text.align_center. Possible values: text.align_top, text.align_center, text.align_bottom.
text_wrap (series string) : Defines whether the text is presented in a single line, extending past the width of the box if necessary, or wrapped so every line is no wider than the box itself (and clipped by the bottom border of the box if the height of the resulting wrapped text is higher than the height of the box). Optional. The default value is text.wrap_none. Possible values: text.wrap_none, text.wrap_auto.
text_font_family (series string) : The font family of the text. Optional. The default value is font.family_default. Possible values: font.family_default, font.family_monospace.
Box
Fields:
left_top (Point) : top-left corner of the box
right_bottom (Point) : bottom-right corner of the box
txt (series string) : The text to be displayed inside the box. Optional. The default is empty string.
args (BoxArgs) : Wrapper for reusable arguments for box.new()
text_args (BoxTextArgs)
plot (series box) : The box object to be added and plotted via draw()
Triangle
Fields:
a (Point) : first Corner
b (Point) : second Corner
c (Point) : third Corner
args (LineArgs) : Wrapper for reusable arguments for line.new()
plot_ab (series line) : The line object to be added and plotted via draw()
plot_ac (series line) : The line object to be added and plotted via draw()
plot_bc (series line) : The line object to be added and plotted via draw()
TriangleFill
Fields:
triangle (Triangle) : The Triangle object
fill_color (series color) : The color used to fill the space between the lines.
plot (series linefill) : The linefill object to be added and plotted via draw()
Polygon
Fields:
points (Point ) : array of points that make up the Polygon
center (Point) : Center point of the Polygon, can be used for a label and will be center for PolygonFill
args (LineArgs) : Wrapper for reusable arguments for line.new()
plot (line ) : An array of Lines that form Polygon Border
PolygonFill
Fields:
poly (Polygon) : the Polygon
fill_color (series color) : The color used to fill the space between the lines.
plot_segments (line ) : An array of helper lines to create linefills
plot_fills (linefill ) : An array of linefills that cover the Polygon surface
lib_drawing_compositesLibrary "lib_drawing_composites"
methods to draw and manage composite obejects. Based on Trendoscope's added Triangle and Polygon composite objects, fixed tostring method output to be actual json
method tostring(this, format_date, format, tz, pretty)
Converts lib_drawing_types/LineProperties object to a json string representation
Namespace types: D.Point
Parameters:
this (Point type from HeWhoMustNotBeNamed/DrawingTypes/2) : lib_drawing_types/LineProperties object
format_date (simple bool)
format (simple string)
tz (simple string)
pretty (simple bool) : if true adds a line feed after every property and a space before properties (default: true)
Returns: string representation of lib_drawing_types/LineProperties
method tostring(this, pretty)
Converts lib_drawing_types/LabelProperties object to a json string representation
Namespace types: D.LineProperties
Parameters:
this (LineProperties type from HeWhoMustNotBeNamed/DrawingTypes/2) : lib_drawing_types/LabelProperties object
pretty (simple bool) : if true adds a line feed after every property and a space before properties (default: true)
Returns: string representation of lib_drawing_types/LabelProperties
method tostring(this, format_date, format, tz, pretty)
Converts lib_drawing_types/BoxProperties object to a json string representation
Namespace types: D.Line
Parameters:
this (Line type from HeWhoMustNotBeNamed/DrawingTypes/2) : lib_drawing_types/BoxProperties object
format_date (simple bool)
format (simple string)
tz (simple string)
pretty (simple bool) : if true adds a line feed after every property and a space before properties (default: true)
Returns: string representation of lib_drawing_types/BoxProperties
method tostring(this, pretty)
Converts lib_drawing_types/BoxText object to a json string representation
Namespace types: D.LabelProperties
Parameters:
this (LabelProperties type from HeWhoMustNotBeNamed/DrawingTypes/2) : lib_drawing_types/BoxText object
pretty (simple bool) : if true adds a line feed after every property and a space before properties (default: true)
Returns: string representation of lib_drawing_types/BoxText
method tostring(this, format_date, format, tz, pretty)
Converts lib_drawing_types/TriangleProperties object to a json string representation
Namespace types: D.Label
Parameters:
this (Label type from HeWhoMustNotBeNamed/DrawingTypes/2) : lib_drawing_types/TriangleProperties object
format_date (simple bool)
format (simple string)
tz (simple string)
pretty (simple bool) : if true adds a line feed after every property and a space before properties (default: true)
Returns: string representation of lib_drawing_types/TriangleProperties
method tostring(this, format_date, format, tz, pretty)
Namespace types: D.Linefill
Parameters:
this (Linefill type from HeWhoMustNotBeNamed/DrawingTypes/2)
format_date (simple bool)
format (simple string)
tz (simple string)
pretty (simple bool)
method tostring(this, pretty)
Namespace types: D.BoxProperties
Parameters:
this (BoxProperties type from HeWhoMustNotBeNamed/DrawingTypes/2)
pretty (simple bool)
method tostring(this, pretty)
Namespace types: D.BoxText
Parameters:
this (BoxText type from HeWhoMustNotBeNamed/DrawingTypes/2)
pretty (simple bool)
method tostring(this, format_date, format, tz, pretty)
Namespace types: D.Box
Parameters:
this (Box type from HeWhoMustNotBeNamed/DrawingTypes/2)
format_date (simple bool)
format (simple string)
tz (simple string)
pretty (simple bool)
method tostring(this, pretty)
Namespace types: DC.TriangleProperties
Parameters:
this (TriangleProperties type from robbatt/lib_drawing_composite_types/1)
pretty (simple bool)
method tostring(this, format_date, format, tz, pretty)
Namespace types: DC.Triangle
Parameters:
this (Triangle type from robbatt/lib_drawing_composite_types/1)
format_date (simple bool)
format (simple string)
tz (simple string)
pretty (simple bool)
method tostring(this, format_date, format, tz, pretty)
Namespace types: DC.Trianglefill
Parameters:
this (Trianglefill type from robbatt/lib_drawing_composite_types/1)
format_date (simple bool)
format (simple string)
tz (simple string)
pretty (simple bool)
method tostring(this, format_date, format, tz, pretty)
Namespace types: DC.Polygon
Parameters:
this (Polygon type from robbatt/lib_drawing_composite_types/1)
format_date (simple bool)
format (simple string)
tz (simple string)
pretty (simple bool)
method tostring(this, format_date, format, tz, pretty)
Namespace types: DC.Polygonfill
Parameters:
this (Polygonfill type from robbatt/lib_drawing_composite_types/1)
format_date (simple bool)
format (simple string)
tz (simple string)
pretty (simple bool)
method delete(this)
Namespace types: DC.Trianglefill
Parameters:
this (Trianglefill type from robbatt/lib_drawing_composite_types/1)
method delete(this)
Namespace types: DC.Triangle
Parameters:
this (Triangle type from robbatt/lib_drawing_composite_types/1)
method delete(this)
Namespace types: DC.Triangle
Parameters:
this (Triangle type from robbatt/lib_drawing_composite_types/1)
method delete(this)
Namespace types: DC.Trianglefill
Parameters:
this (Trianglefill type from robbatt/lib_drawing_composite_types/1)
method delete(this)
Namespace types: DC.Polygon
Parameters:
this (Polygon type from robbatt/lib_drawing_composite_types/1)
method delete(this)
Namespace types: DC.Polygonfill
Parameters:
this (Polygonfill type from robbatt/lib_drawing_composite_types/1)
method delete(this)
Namespace types: DC.Polygon
Parameters:
this (Polygon type from robbatt/lib_drawing_composite_types/1)
method delete(this)
Namespace types: DC.Polygonfill
Parameters:
this (Polygonfill type from robbatt/lib_drawing_composite_types/1)
method clear(this)
Namespace types: DC.Triangle
Parameters:
this (Triangle type from robbatt/lib_drawing_composite_types/1)
method clear(this)
Namespace types: DC.Trianglefill
Parameters:
this (Trianglefill type from robbatt/lib_drawing_composite_types/1)
method clear(this)
Namespace types: DC.Polygon
Parameters:
this (Polygon type from robbatt/lib_drawing_composite_types/1)
method clear(this)
Namespace types: DC.Polygonfill
Parameters:
this (Polygonfill type from robbatt/lib_drawing_composite_types/1)
method draw(this, is_polygon_section)
Namespace types: DC.Triangle
Parameters:
this (Triangle type from robbatt/lib_drawing_composite_types/1)
is_polygon_section (bool)
method draw(this)
Namespace types: DC.Trianglefill
Parameters:
this (Trianglefill type from robbatt/lib_drawing_composite_types/1)
method draw(this, is_polygon)
Namespace types: DC.Triangle
Parameters:
this (Triangle type from robbatt/lib_drawing_composite_types/1)
is_polygon (bool)
method draw(this)
Namespace types: DC.Polygon
Parameters:
this (Polygon type from robbatt/lib_drawing_composite_types/1)
method draw(this)
Namespace types: DC.Trianglefill
Parameters:
this (Trianglefill type from robbatt/lib_drawing_composite_types/1)
method draw(this)
Namespace types: DC.Polygonfill
Parameters:
this (Polygonfill type from robbatt/lib_drawing_composite_types/1)
method draw(this)
Namespace types: DC.Polygon
Parameters:
this (Polygon type from robbatt/lib_drawing_composite_types/1)
method draw(this)
Namespace types: DC.Polygonfill
Parameters:
this (Polygonfill type from robbatt/lib_drawing_composite_types/1)
method createCenter(this, other)
Namespace types: D.Point
Parameters:
this (Point type from HeWhoMustNotBeNamed/DrawingTypes/2)
other (Point type from HeWhoMustNotBeNamed/DrawingTypes/2)
method createCenter(this)
Namespace types: D.Point
Parameters:
this (Point type from HeWhoMustNotBeNamed/DrawingTypes/2)
method createCenter(this, other1, other2)
Namespace types: D.Point
Parameters:
this (Point type from HeWhoMustNotBeNamed/DrawingTypes/2)
other1 (Point type from HeWhoMustNotBeNamed/DrawingTypes/2)
other2 (Point type from HeWhoMustNotBeNamed/DrawingTypes/2)
method createLabel(this, labeltext, tooltip, properties)
Namespace types: D.Line
Parameters:
this (Line type from HeWhoMustNotBeNamed/DrawingTypes/2)
labeltext (string)
tooltip (string)
properties (LabelProperties type from HeWhoMustNotBeNamed/DrawingTypes/2)
method createLabel(this, labeltext, tooltip, properties)
Namespace types: DC.Triangle
Parameters:
this (Triangle type from robbatt/lib_drawing_composite_types/1)
labeltext (string)
tooltip (string)
properties (LabelProperties type from HeWhoMustNotBeNamed/DrawingTypes/2)
method createTriangle(this, p2, p3, properties)
Namespace types: D.Point
Parameters:
this (Point type from HeWhoMustNotBeNamed/DrawingTypes/2)
p2 (Point type from HeWhoMustNotBeNamed/DrawingTypes/2)
p3 (Point type from HeWhoMustNotBeNamed/DrawingTypes/2)
properties (TriangleProperties type from robbatt/lib_drawing_composite_types/1)
method createTrianglefill(this, fill_color, transparency)
Namespace types: DC.Triangle
Parameters:
this (Triangle type from robbatt/lib_drawing_composite_types/1)
fill_color (color)
transparency (int)
method createPolygonfill(this, fill_color, transparency)
Namespace types: DC.Polygon
Parameters:
this (Polygon type from robbatt/lib_drawing_composite_types/1)
fill_color (color)
transparency (int)
method createPolygon(points, properties)
Namespace types: D.Point
Parameters:
points (Point type from HeWhoMustNotBeNamed/DrawingTypes/2)
properties (TriangleProperties type from robbatt/lib_drawing_composite_types/1)
lib_drawing_composite_typesLibrary "lib_drawing_composite_types"
User Defined Types for basic drawing structure. Other types and methods will be built on these. (added type Triangle and Polygon to )
TriangleProperties
TriangleProperties object
Fields:
border_color (series color) : Box border color. Default is color.blue
fill_color (series color) : Fill color
fill_transparency (series int)
border_width (series int) : Box border width. Default is 1
border_style (series string) : Box border style. Default is line.style_solid
xloc (series string) : defines if drawing needs to be done based on bar index or time. default is xloc.bar_index
Triangle
Triangle object
Fields:
p1 (Point type from HeWhoMustNotBeNamed/DrawingTypes/2) : point one
p2 (Point type from HeWhoMustNotBeNamed/DrawingTypes/2) : point two
p3 (Point type from HeWhoMustNotBeNamed/DrawingTypes/2) : point three
properties (TriangleProperties) : Triangle properties
l12 (series line) : line object created
l23 (series line) : line object created
l31 (series line) : line object created
Trianglefill
Trianglefill object
Fields:
triangle (Triangle) : to create a linefill for
fill_color (series color) : Fill color
transparency (series int) : Fill transparency range from 0 to 100
object (series linefill) : linefill object created
Polygon
Polygon object
Fields:
center (Point type from HeWhoMustNotBeNamed/DrawingTypes/2) : Point that triangles are using as common center
triangles (Triangle ) : an array of triangles that form the Polygon
Polygonfill
Polygonfill object
Fields:
_polygon (Polygon) : to create a fill for
_fills (Trianglefill ) : an array of Trianglefill objects that match the array of triangles in _polygon
Manual Harmonic Patterns - With interactive inputsThis script is a drawing tool which allows users to draw XABCD on the chart and script will tell whether there is any harmonic patterns on the drawings made. The script is based on interactive inputs and requires users to chose XABCD points.
Please note
This is not a scanner and it will not scan historical bars for harmonic patterns. This needs to be used rather as drawing tool instead.
Script will not check if selected pivots are correct. It assumes users to know how to select the right XABCD based on pivot high/lows. Bullish pattern will have X, B and D as pivot lows and A,C as pivot highs. Similarly bearish patterns will have X, B, D as pivot highs and A, C as pivot lows.
Script will not check for overflow conditions. For example, if price crosses, XB or BD line, then pattern is considered to be invalid. But, this check cannot be made in this script and we require users to be aware of this condition and select input accordingly.
Order of inputs should be in ascending order. X pivot should come before A and then, B, C, D and F. This again is users responsibility to select pivots in right order.
What happens after selecting XABCD?
If selected pattern is valid harmonic pattern, it will
Draw XABCD lines and labels
Fill harmonic triangles
Show PRZ box which shoes the name of valid patterns.
If it is not valid harmonic pattern, then users will see blank XABCD line without any PRZ or filled harmonic triangles.
Example:
1. When it is valid pattern
2. When it is not valid pattern
Auto Fib Speed Resistance Fans by DGTFibonacci Speed and Resistance Fan is an analytical drawing tool used to indicate the support and resistance levels of an existing trend and the price level at which possible changes in the trend may occur.
A Fibonacci Speed Resistance Fan consists of a trend line drawn between two extreme points - a trough and opposing peak or a peak and opposing trough - on which a set of sequential speed resistance lines are drawn above (which represents time) and below (which represents price). These lines are drawn based on time/price percentages of the distance between the beginning and the end of the trend line.
Speed resistance lines not only help to measure trend corrections but also measure the speed of a trend (the rate at which a trendline ascends or descends)
Traders can use the lines of the Fibonacci Speed and Resistance Fan to predict key points of resistance or support, at which they might expect price trends to reverse. Once a trader identifies patterns within a chart, they can use those patterns to predict future price movements and future levels of support and resistance. Traders use the predictions to time their trades. Key support and resistance levels tend to occur frequently at the 61.8-percent level on both uptrends and downtrends.
Please check for further details in the education post that I will share shortly after this publication :
Nobody appears to know whether Fibonacci tools work because markets exhibit some form of natural pattern or because many investors use Fibonacci ratios to predict price movements, making them a self-fulfilling prophecy.
█ Study OPTIONS
Auto Fibonacci Speed and Resistance Fan , the main aim of the study
- Pivot threshold can be adjusted via “Deviation” and “Depth” input options
- Historical Fans option will allow plotting of Speed and Resistance Fans on previous pivot high/lows
- Ability to set ALERTs for the Speed and Resistance Levels
- Price Grid Lines if extended it will result with Fib Retracement levels
- All lines, line levels are customizable, default values are set exactly to the same with the available Fib Speed and Resistance Fan drawing tool
Zig Zag – Derived from build-in Auto Fib Retracement with some customization options.
Example Usages :
Disclaimer :
Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely
The script is for informational and educational purposes only. Use of the script does not constitute professional and/or financial advice. You alone have the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd TradingView user liable for any possible claim for damages arising from any decision you make based on use of the script