Parallel Projections [theEccentricTrader]█   OVERVIEW 
This indicator automatically projects parallel trendlines or channels, from a single point of origin. In the example above I have applied the indicator twice to the 1D SPXUSD. The five upper lines (green) are projected at an angle of -5 from the 1-month swing high anchor point with a projection ratio of -72. And the seven lower lines (blue) are projected at an angle of 10 with a projection ratio of 36 from the 1-week swing low anchor point. 
█   CONCEPTS 
 Green and Red Candles 
• A green candle is one that closes with a high price equal to or above the price it opened.
• A red candle is one that closes with a low price that is lower than the price it opened.
 Swing Highs and Swing Lows 
• A swing high is a green candle or series of consecutive green candles followed by a single red candle to complete the swing and form the peak.
• A swing low is a red candle or series of consecutive red candles followed by a single green candle to complete the swing and form the trough.
 Peak and Trough Prices (Basic) 
• The peak price of a complete swing high is the high price of either the red candle that completes the swing high or the high price of the preceding green candle, depending on which is higher.
• The trough price of a complete swing low is the low price of either the green candle that completes the swing low or the low price of the preceding red candle, depending on which is lower.
 Historic Peaks and Troughs 
The current, or most recent, peak and trough occurrences are referred to as occurrence zero. Previous peak and trough occurrences are referred to as historic and ordered numerically from right to left, with the most recent historic peak and trough occurrences being occurrence one.
 Support and Resistance 
• Support refers to a price level where the demand for an asset is strong enough to prevent the price from falling further.
• Resistance refers to a price level where the supply of an asset is strong enough to prevent the price from rising further.
Support and resistance levels are important because they can help traders identify where the price of an asset might pause or reverse its direction, offering potential entry and exit points. For example, a trader might look to buy an asset when it approaches a support level , with the expectation that the price will bounce back up. Alternatively, a trader might look to sell an asset when it approaches a resistance level , with the expectation that the price will drop back down.
It's important to note that support and resistance levels are not always relevant, and the price of an asset can also break through these levels and continue moving in the same direction.
 Trendlines 
Trendlines are straight lines that are drawn between two or more points on a price chart. These lines are used as dynamic support and resistance levels for making strategic decisions and predictions about future price movements. For example traders will look for price movements along, and reactions to, trendlines in the form of rejections or breakouts/downs.
█   FEATURES 
 Inputs 
• Anchor Point Type
• Swing High/Low Occurrence
• HTF Resolution
• Highest High/Lowest Low Lookback
• Angle Degree
• Projection Ratio
• Number Lines
• Line Color
 Anchor Point Types 
• Swing High
• Swing Low
• Swing High (HTF)
• Swing Low (HTF)
• Highest High
• Lowest Low
• Intraday Highest High (intraday charts only)
• Intraday Lowest Low (intraday charts only)
 Swing High/Swing Low Occurrence 
This input is used to determine which historic peak or trough to reference for swing high or swing low anchor point types. 
 HTF Resolution 
This input is used to determine which higher timeframe to reference for swing high (HTF) or swing low (HTF) anchor point types. 
 Highest High/Lowest Low Lookback 
This input is used to determine the lookback length for highest high or lowest low anchor point types.
 Intraday Highest High/Lowest Low Lookback 
When using intraday highest high or lowest low anchor point types, the lookback length is calculated automatically based on number of bars since the daily candle opened. 
 Angle Degree 
This input is used to determine the angle of the trendlines. The output is expressed in terms of point or pips, depending on the symbol type, which is then passed through the built in math.todegrees() function. Positive numbers will project the lines upwards while negative numbers will project the lines downwards. Depending on the market and timeframe, the impact input values will have on the visible gaps between the lines will vary greatly. For example, an input of 10 will have a far greater impact on the gaps between the lines when viewed from the 1-minute timeframe than it would on the 1-day timeframe. The input is a float and as such the value passed through can go into as many decimal places as the user requires. 
It is also worth mentioning that as more lines are added the gaps between the lines, that are closest to the anchor point, will get tighter as they make their way up the y-axis. Although the gaps between the lines will stay constant at the x2 plot, i.e. a distance of 10 points between them, they will gradually get tighter and tighter at the point of origin as the slope of the lines get steeper. 
 Projection Ratio 
This input is used to determine the distance between the parallels, expressed in terms of point or pips. Positive numbers will project the lines upwards while negative numbers will project the lines downwards. Depending on the market and timeframe, the impact input values will have on the visible gaps between the lines will vary greatly. For example, an input of 10 will have a far greater impact on the gaps between the lines when viewed from the 1-minute timeframe than it would on the 1-day timeframe. The input is a float and as such the value passed through can go into as many decimal places as the user requires. 
 Number Lines 
This input is used to determine the number of lines to be drawn on the chart, maximum is 500.
█   LIMITATIONS 
All green and red candle calculations are based on differences between open and close prices, as such I have made no attempt to account for green candles that gap lower and close below the close price of the preceding candle, or red candles that gap higher and close above the close price of the preceding candle. This may cause some unexpected behaviour on some markets and timeframes. I can only recommend using 24-hour markets, if and where possible, as there are far fewer gaps and, generally, more data to work with.
If the lines do not draw or you see a study error saying that the script references too many candles in history, this is most likely because the higher timeframe anchor point is not present on the current timeframe. This problem usually occurs when referencing a higher timeframe, such as the 1-month, from a much lower timeframe, such as the 1-minute. How far you can lookback for higher timeframe anchor points on the current timeframe will also be limited by your Trading View subscription plan. Premium users get 20,000 candles worth of data, pro+ and pro users get 10,000, and basic users get 5,000. 
█   RAMBLINGS 
It is my current thesis that the indicator will work best when used in conjunction with my  Wavemeter  indicator, which can be used to set the angle and projection ratio. For example, the average wave height or amplitude could be used as the value for the angle and projection ratio inputs. Or some factor or multiple of such an average. I think this makes sense as it allows for objectivity when applying the indicator across different markets and timeframes with different energies and vibrations.  
 “If you want to find the secrets of the universe, think in terms of energy, frequency and vibration.” 
― Nikola Tesla
Piyasa Geometrisi
Fan Projections [theEccentricTrader]█   OVERVIEW 
This indicator automatically projects trendlines in the shape of a fan, from a single point of origin. In the example above I have applied the indicator twice to the 1D SPXUSD. The seven upper lines (green) are projected at an angle of -5 from the 1-month swing high anchor point. And the five lower lines (blue) are projected at an angle of 10 from the 1-week swing low anchor point. 
█   CONCEPTS 
 Green and Red Candles 
• A green candle is one that closes with a high price equal to or above the price it opened.
• A red candle is one that closes with a low price that is lower than the price it opened.
 Swing Highs and Swing Lows 
• A swing high is a green candle or series of consecutive green candles followed by a single red candle to complete the swing and form the peak.
• A swing low is a red candle or series of consecutive red candles followed by a single green candle to complete the swing and form the trough.
 Peak and Trough Prices (Basic) 
• The peak price of a complete swing high is the high price of either the red candle that completes the swing high or the high price of the preceding green candle, depending on which is higher.
• The trough price of a complete swing low is the low price of either the green candle that completes the swing low or the low price of the preceding red candle, depending on which is lower.
 Historic Peaks and Troughs 
The current, or most recent, peak and trough occurrences are referred to as occurrence zero. Previous peak and trough occurrences are referred to as historic and ordered numerically from right to left, with the most recent historic peak and trough occurrences being occurrence one.
 Support and Resistance 
• Support refers to a price level where the demand for an asset is strong enough to prevent the price from falling further.
• Resistance refers to a price level where the supply of an asset is strong enough to prevent the price from rising further.
Support and resistance levels are important because they can help traders identify where the price of an asset might pause or reverse its direction, offering potential entry and exit points. For example, a trader might look to buy an asset when it approaches a support level , with the expectation that the price will bounce back up. Alternatively, a trader might look to sell an asset when it approaches a resistance level , with the expectation that the price will drop back down.
It's important to note that support and resistance levels are not always relevant, and the price of an asset can also break through these levels and continue moving in the same direction.
 Trendlines 
Trendlines are straight lines that are drawn between two or more points on a price chart. These lines are used as dynamic support and resistance levels for making strategic decisions and predictions about future price movements. For example traders will look for price movements along, and reactions to, trendlines in the form of rejections or breakouts/downs.
█   FEATURES 
 Inputs 
• Anchor Point Type
• Swing High/Low Occurrence
• HTF Resolution
• Highest High/Lowest Low Lookback
• Angle Degree
• Number Lines
• Line Color
 Anchor Point Types 
• Swing High
• Swing Low
• Swing High (HTF)
• Swing Low (HTF)
• Highest High
• Lowest Low
• Intraday Highest High (intraday charts only)
• Intraday Lowest Low (intraday charts only)
 Swing High/Swing Low Occurrence 
This input is used to determine which historic peak or trough to reference for swing high or swing low anchor point types. 
 HTF Resolution 
This input is used to determine which higher timeframe to reference for swing high (HTF) or swing low (HTF) anchor point types. 
 Highest High/Lowest Low Lookback 
This input is used to determine the lookback length for highest high or lowest low anchor point types.
 Intraday Highest High/Lowest Low Lookback 
When using intraday highest high or lowest low anchor point types, the lookback length is calculated automatically based on number of bars since the daily candle opened. 
 Angle Degree 
This input is used to determine the angle of the trendlines. The output is expressed in terms of point or pips, depending on the symbol type, which is then passed through the built in math.todegrees() function. Positive numbers will project the lines upwards while negative numbers will project the lines downwards. Depending on the market and timeframe, the impact input values will have on the visible gaps between the lines will vary greatly. For example, an input of 10 will have a far greater impact on the gaps between the lines when viewed from the 1-minute timeframe than it would on the 1-day timeframe. The input is a float and as such the value passed through can go into as many decimal places as the user requires. 
It is also worth mentioning that as more lines are added the gaps between the lines, that are closest to the anchor point, will get tighter as they make their way up the y-axis. Although the gaps between the lines will stay constant at the x2 plot, i.e. a distance of 10 points between them, they will gradually get tighter and tighter at the point of origin as the slope of the lines get steeper. 
 Number Lines 
This input is used to determine the number of lines to be drawn on the chart, maximum is 500.
█   LIMITATIONS 
All green and red candle calculations are based on differences between open and close prices, as such I have made no attempt to account for green candles that gap lower and close below the close price of the preceding candle, or red candles that gap higher and close above the close price of the preceding candle. This may cause some unexpected behaviour on some markets and timeframes. I can only recommend using 24-hour markets, if and where possible, as there are far fewer gaps and, generally, more data to work with.
If the lines do not draw or you see a study error saying that the script references too many candles in history, this is most likely because the higher timeframe anchor point is not present on the current timeframe. This problem usually occurs when referencing a higher timeframe, such as the 1-month, from a much lower timeframe, such as the 1-minute. How far you can lookback for higher timeframe anchor points on the current timeframe will also be limited by your Trading View subscription plan. Premium users get 20,000 candles worth of data, pro+ and pro users get 10,000, and basic users get 5,000. 
█   RAMBLINGS 
It is my current thesis that the indicator will work best when used in conjunction with my  Wavemeter  indicator, which can be used to set the angle. For example, the average wave height or amplitude could be used as the value for the angle input. Or some factor or multiple of such an average. I think this makes sense as it allows for objectivity when applying the indicator across different markets and timeframes with different energies and vibrations.  
 “If you want to find the secrets of the universe, think in terms of energy, frequency and vibration.” 
― Nikola Tesla
LineWrapperLibrary   "LineWrapper" 
Wrapper Type for Line. Useful when you want to store the line details without drawing them. Can also be used in scnearios where you collect lines to be drawn and draw together towards the end.
 draw(this) 
  draws line as per the wrapper object contents
  Parameters:
     this : (series Line) Line object.
  Returns: current Line object
 draw(this) 
  draws lines as per the wrapper object array
  Parameters:
     this : (series array) Array of Line object.
  Returns: current Array of Line objects
 update(this) 
  updates or redraws line as per the wrapper object contents
  Parameters:
     this : (series Line) Line object.
  Returns: current Line object
 update(this) 
  updates or redraws lines as per the wrapper object array
  Parameters:
     this : (series array) Array of Line object.
  Returns: current Array of Line objects
 get_price(this, bar) 
  get line price based on bar
  Parameters:
     this : (series Line) Line object.
     bar : (series/int) bar at which line price need to be calculated
  Returns: line price at given bar.
 get_x1(this) 
  Returns UNIX time or bar index (depending on the last xloc value set) of the first point of the line.
  Parameters:
     this : (series Line) Line object.
  Returns: UNIX timestamp (in milliseconds) or bar index.
 get_x2(this) 
  Returns UNIX time or bar index (depending on the last xloc value set) of the second point of the line.
  Parameters:
     this : (series Line) Line object.
  Returns: UNIX timestamp (in milliseconds) or bar index.
 get_y1(this) 
  Returns price of the first point of the line.
  Parameters:
     this : (series Line) Line object.
  Returns: Price value.
 get_y2(this) 
  Returns price of the second point of the line.
  Parameters:
     this : (series Line) Line object.
  Returns: Price value.
 set_x1(this, x, draw, update) 
  Sets bar index or bar time (depending on the xloc) of the first point.
  Parameters:
     this : (series Line) Line object.
     x : (series int) Bar index or bar time. Note that objects positioned using xloc.bar_index cannot be drawn further than 500 bars into the future.
     draw : (series bool) draw line after setting attribute
     update : (series bool) update line instead of redraw. Only valid if draw is set.
  Returns: Current Line object
 set_x2(this, x, draw, update) 
  Sets bar index or bar time (depending on the xloc) of the second point.
  Parameters:
     this : (series Line) Line object.
     x : (series int) Bar index or bar time. Note that objects positioned using xloc.bar_index cannot be drawn further than 500 bars into the future.
     draw : (series bool) draw line after setting attribute
     update : (series bool) update line instead of redraw. Only valid if draw is set.
  Returns: Current Line object
 set_y1(this, y, draw, update) 
  Sets price of the first point
  Parameters:
     this : (series Line) Line object.
     y : (series int/float) Price.
     draw : (series bool) draw line after setting attribute
     update : (series bool) update line instead of redraw. Only valid if draw is set.
  Returns: Current Line object
 set_y2(this, y, draw, update) 
  Sets price of the second point
  Parameters:
     this : (series Line) Line object.
     y : (series int/float) Price.
     draw : (series bool) draw line after setting attribute
     update : (series bool) update line instead of redraw. Only valid if draw is set.
  Returns: Current Line object
 set_color(this, color, draw, update) 
  Sets the line color
  Parameters:
     this : (series Line) Line object.
     color : (series color) New line color
     draw : (series bool) draw line after setting attribute
     update : (series bool) update line instead of redraw. Only valid if draw is set.
  Returns: Current Line object
 set_extend(this, extend, draw, update) 
  Sets extending type of this line object. If 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.
  Parameters:
     this : (series Line) Line object.
     extend : (series string) New extending type.
     draw : (series bool) draw line after setting attribute
     update : (series bool) update line instead of redraw. Only valid if draw is set.
  Returns: Current Line object
 set_style(this, style, draw, update) 
  Sets the line style
  Parameters:
     this : (series Line) Line object.
     style : (series string) New line style.
     draw : (series bool) draw line after setting attribute
     update : (series bool) update line instead of redraw. Only valid if draw is set.
  Returns: Current Line object
 set_width(this, width, draw, update) 
  Sets the line width.
  Parameters:
     this : (series Line) Line object.
     width : (series int) New line width in pixels.
     draw : (series bool) draw line after setting attribute
     update : (series bool) update line instead of redraw. Only valid if draw is set.
  Returns: Current Line object
 set_xloc(this, x1, x2, xloc, draw, update) 
  Sets x-location and new bar index/time values.
  Parameters:
     this : (series Line) Line object.
     x1 : (series int) Bar index or bar time of the first point.
     x2 : (series int) Bar index or bar time of the second point.
     xloc : (series string) New x-location value. 
     draw : (series bool) draw line after setting attribute
     update : (series bool) update line instead of redraw. Only valid if draw is set.
  Returns: Current Line object
 set_xy1(this, x, y, draw, update) 
  Sets bar index/time and price of the first point.
  Parameters:
     this : (series Line) Line object.
     x : (series int) Bar index or bar time. Note that objects positioned using xloc.bar_index cannot be drawn further than 500 bars into the future.
     y : (series int/float) Price.
     draw : (series bool) draw line after setting attribute
     update : (series bool) update line instead of redraw. Only valid if draw is set.
  Returns: Current Line object
 set_xy2(this, x, y, draw, update) 
  Sets bar index/time and price of the second point
  Parameters:
     this : (series Line) Line object.
     x : (series int) Bar index or bar time. Note that objects positioned using xloc.bar_index cannot be drawn further than 500 bars into the future.
     y : (series int/float) Price.
     draw : (series bool) draw line after setting attribute
     update : (series bool) update line instead of redraw. Only valid if draw is set.
  Returns: Current Line object
 delete(this) 
  Deletes the underlying line drawing object
  Parameters:
     this : (series Line) Line object.
  Returns: Current Line object
 Line 
  Line Wrapper object
  Fields:
     x1 : (series int) Bar index (if xloc = xloc.bar_index) or bar UNIX time (if xloc = xloc.bar_time) of the first point of the line. Note that objects positioned using xloc.bar_index cannot be drawn further than 500 bars into the future.
     y1 : (series int/float) Price of the first point of the line.
     x2 : (series int) Bar index (if xloc = xloc.bar_index) or bar UNIX time (if xloc = xloc.bar_time) of the second point of the line. Note that objects positioned using xloc.bar_index cannot be drawn further than 500 bars into the future.
     y2 : (series int/float) Price of the second point of the line.
     xloc : (series string) See description of x1 argument. Possible values: xloc.bar_index and xloc.bar_time. Default is xloc.bar_index.
     extend : (series string) If 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.
     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.
     obj : line object
Vector2FunctionClipLibrary   "Vector2FunctionClip" 
Sutherland-Hodgman polygon clipping algorithm.
reference:
.
rosettacode.org
.
 clip(source, reference) 
  Perform Clip operation on a vector with another.
  Parameters:
     source : array . Source polygon to be clipped.
     reference : array . Reference polygon to clip source.
  Returns: array.
Segment2Library   "Segment2" 
Structure representation of a directed straight line in two dimensions from origin to target vectors.
.
reference:
graphics.stanford.edu
.
 new(origin, target) 
  Generate a new segment.
  Parameters:
     origin : Vector2 . Origin of the segment.
     target : Vector2 . Target of the segment.
  Returns: Segment2.
 new(origin_x, origin_y, target_x, target_y) 
  Generate a new segment.
  Parameters:
     origin_x : float . Origin of the segment x coordinate.
     origin_y : float . Origin of the segment y coordinate.
     target_x : float . Target of the segment x coordinate.
     target_y : float . Target of the segment y coordinate.
  Returns: Segment2.
 copy(this) 
  Copy a segment.
  Parameters:
     this : Vector2 . Segment to copy.
  Returns: Segment2.
 length_squared(this) 
  Squared length of the normalized segment vector. For comparing vectors this is computationaly lighter.
  Parameters:
     this : Segment2 . Sorce segment.
  Returns: float.
 length(this) 
  Length of the normalized segment vector.
  Parameters:
     this : Segment2 . Sorce segment.
  Returns: float.
 opposite(this) 
  Reverse the direction of the segment.
  Parameters:
     this : Segment2 . Source segment.
  Returns: Segment2.
 is_degenerate(this) 
  Segment is degenerate when origin and target are equal.
  Parameters:
     this : Segment2 . Source segment.
  Returns: bool.
 is_horizontal(this) 
  Segment is horizontal?.
  Parameters:
     this : Segment2 . Source segment.
  Returns: bool.
 is_horizontal(this, precision) 
  Segment is horizontal?.
  Parameters:
     this : Segment2 . Source segment.
     precision : float    . Limit of precision.
  Returns: bool.
 is_vertical(this) 
  Segment is vertical?.
  Parameters:
     this : Segment2 . Source segment.
  Returns: bool.
 is_vertical(this, precision) 
  Segment is vertical?.
  Parameters:
     this : Segment2 . Source segment.
     precision : float    . Limit of precision.
  Returns: bool.
 equals(this, other) 
  Tests two segments for equality (share same origin and target).
  Parameters:
     this : Segment2 . Source segment.
     other : Segment2 . Target segment.
  Returns: bool.
 nearest_to_point(this, point) 
  Find the nearest point in a segment to another point.
  Parameters:
     this : Segment2 . Source segment.
     point : Vector2 . Point to aproximate.
  Returns: Vector2.
 intersection(this, other) 
  Find the intersection vector of 2 lines.
  Parameters:
     this : Segment2 . Segment A.
     other : Segment2 . Segment B.
  Returns: Vector2.Vector2 Object.
 extend(this, at_origin, at_target) 
  Extend a segment by the percent ratio provided.
  Parameters:
     this : Segment2 . Source segment.
     at_origin : float    . Percent ratio to extend at origin vector.
     at_target : float    . Percent ratio to extend at target vector.
  Returns: Segment2.
 to_string(this) 
  Translate segment to string format `( (x,y), (x,y) )`.
  Parameters:
     this : Segment2 . Source segment.
  Returns: string.
 to_string(this, format) 
  Translate segment to string format `((x,y), (x,y))`.
  Parameters:
     this : Segment2 . Source segment.
     format : string . Format string to apply.
  Returns: string.
 to_array(this) 
  Translate segment to array format.
  Parameters:
     this : Segment2 . Source segment.
  Returns: array.
Vector2DrawQuadLibrary   "Vector2DrawQuad" 
functions to handle vector2 Quad drawing operations.
 new(a, b, c, d, xloc, bg_color, line_color, line_style, line_width) 
  Draws a quadrilateral with background fill.
  Parameters:
     a : v2     . Vector2 object, in the form `(x, y)`.
     b : v2     . Vector2 object, in the form `(x, y)`.
     c : v2     . Vector2 object, in the form `(x, y)`.
     d : v2     . Vector2 object, in the form `(x, y)`.
     xloc : string . Type of axis unit, bar_index or time.
     bg_color : color  . Color of the background.
     line_color : color  . Color of the line.
     line_style : string . Style of the line.
     line_width : int    . Width of the line.
  Returns: Quad object.
 copy(this) 
  Copy a existing quad object.
  Parameters:
     this : Quad . Source quad.
  Returns: Quad.
 set_position_a(this, x, y) 
  Set the position of corner `a` (modifies source quad).
  Parameters:
     this : Quad . Source quad.
     x : int      . Value at the x axis.
     y : float    . Value at the y axis.
  Returns: Source Quad.
 set_position_a(this, position) 
  Set the position of corner `a` (modifies source quad).
  Parameters:
     this : Quad . Source quad.
     position : Vector2  . New position.
  Returns: Source Quad.
 set_position_b(this, x, y) 
  Set the position of corner `b` (modifies source quad).
  Parameters:
     this : Quad . Source quad.
     x : int      . Value at the x axis.
     y : float    . Value at the y axis.
  Returns: Source Quad.
 set_position_b(this, position) 
  Set the position of corner `b` (modifies source quad).
  Parameters:
     this : Quad . Source quad.
     position : Vector2  . New position.
  Returns: Source Quad.
 set_position_c(this, x, y) 
  Set the position of corner `c` (modifies source quad).
  Parameters:
     this : Quad . Source quad.
     x : int      . Value at the x axis.
     y : float    . Value at the y axis.
  Returns: Source Quad.
 set_position_c(this, position) 
  Set the position of corner `c` (modifies source quad).
  Parameters:
     this : Quad . Source quad.
     position : Vector2  . New position.
  Returns: Source Quad.
 set_position_d(this, x, y) 
  Set the position of corner `d` (modifies source quad).
  Parameters:
     this : Quad  . Source quad.
     x : int   . Value at the x axis.
     y : float . Value at the y axis.
  Returns: Source Quad.
 set_position_d(this, position) 
  Set the position of corner `d` (modifies source quad).
  Parameters:
     this : Quad    . Source quad.
     position : Vector2 . New position.
  Returns: Source Quad.
 set_style(this, bg_color, line_color, line_style, line_width) 
  Update quad style options (modifies Source quad).
  Parameters:
     this : Quad   . Source quad.
     bg_color : color  . Color of the background.
     line_color : color  . Color of the line.
     line_style : string . Style of the line.
     line_width : int    . Width of the line.
  Returns: Source Quad.
 set_bg_color(this, bg_color) 
  Update quad style options (modifies Source quad).
  Parameters:
     this : Quad  . Source quad.
     bg_color : color . Color of the background.
  Returns: Source Quad.
 set_line_color(this, line_color) 
  Update quad style options (modifies Source quad).
  Parameters:
     this : Quad  . Source quad.
     line_color : color . Color of the line.
  Returns: Source Quad.
 set_line_style(this, line_style) 
  Update quad style options (modifies Source quad).
  Parameters:
     this : Quad   . Source quad.
     line_style : string . Style of the line.
  Returns: Source Quad.
 set_line_width(this, line_width) 
  Update quad style options (modifies Source quad).
  Parameters:
     this : Quad . Source quad.
     line_width : int      . Width of the line.
  Returns: Source Quad.
 move(this, x, y) 
  Move quad by provided amount (modifies source quad).
  Parameters:
     this : Quad  . Source quad.
     x : float . Amount to move the vertices of the quad in the x axis.
     y : float . Amount to move the vertices of the quad in the y axis.
  Returns: Source Quad.
 move(this, amount) 
  Move quad by provided amount (modifies source quad).
  Parameters:
     this : Quad    . Source quad.
     amount : Vector2 . Amount to move the vertices of the quad in the x and y axis.
  Returns: Source Quad.
 rotate_around(this, center, angle) 
  Rotate source quad around a center (modifies source quad).
  Parameters:
     this : Quad    . Source quad.
     center : Vector2 . Center coordinates of the rotation.
     angle : float   . Value of angle in degrees.
  Returns: Source Quad.
 rotate_around(this, center_x, center_y, angle) 
  Rotate source quad around a center (modifies source quad).
  Parameters:
     this : Quad  . Source quad.
     center_x : int   . Center coordinates of the rotation.
     center_y : float . Center coordinates of the rotation.
     angle : float . Value of angle in degrees.
  Returns: Source Quad.
Vector2DrawTriangleLibrary   "Vector2DrawTriangle" 
Functions to draw a triangle and manipulate its properties.
 new(a, b, c, xloc, bg_color, line_color, line_style, line_width) 
  Draws a triangle with background fill using line prototype.
  Parameters:
     a : v2     . Vector2 object, in the form `(x, y)`.
     b : v2     . Vector2 object, in the form `(x, y)`.
     c : v2     . Vector2 object, in the form `(x, y)`.
     xloc : string . Type of axis unit, bar_index or time.
     bg_color : color  . Color of the background.
     line_color : color  . Color of the line.
     line_style : string . Style of the line.
     line_width : int    . Width of the line.
  Returns: Triangle object.
 copy(this) 
  Copy a existing triangle object.
  Parameters:
     this : Triangle . Source triangle.
  Returns: Triangle.
 set_position_a(this, x, y) 
  Set the position of corner `a` (modifies source triangle).
  Parameters:
     this : Triangle . Source triangle.
     x : int      . Value at the x axis.
     y : float    . Value at the y axis.
  Returns: Source Triangle.
 set_position_a(this, position) 
  Set the position of corner `a` (modifies source triangle).
  Parameters:
     this : Triangle . Source triangle.
     position : Vector2  . New position.
  Returns: Source Triangle.
 set_position_b(this, x, y) 
  Set the position of corner `b` (modifies source triangle).
  Parameters:
     this : Triangle . Source triangle.
     x : int      . Value at the x axis.
     y : float    . Value at the y axis.
  Returns: Source Triangle.
 set_position_b(this, position) 
  Set the position of corner `b` (modifies source triangle).
  Parameters:
     this : Triangle . Source triangle.
     position : Vector2  . New position.
  Returns: Source Triangle.
 set_position_c(this, x, y) 
  Set the position of corner `c` (modifies source triangle).
  Parameters:
     this : Triangle . Source triangle.
     x : int      . Value at the x axis.
     y : float    . Value at the y axis.
  Returns: Source Triangle.
 set_position_c(this, position) 
  Set the position of corner `c` (modifies source triangle).
  Parameters:
     this : Triangle . Source triangle.
     position : Vector2  . New position.
  Returns: Source Triangle.
 set_style(this, bg_color, line_color, line_style, line_width) 
  Update triangle style options (modifies Source triangle).
  Parameters:
     this : Triangle . Source triangle.
     bg_color : color    . Color of the background.
     line_color : color    . Color of the line.
     line_style : string   . Style of the line.
     line_width : int      . Width of the line.
  Returns: Source Triangle.
 set_bg_color(this, bg_color) 
  Update triangle style options (modifies Source triangle).
  Parameters:
     this : Triangle . Source triangle.
     bg_color : color    . Color of the background.
  Returns: Source Triangle.
 set_line_color(this, line_color) 
  Update triangle style options (modifies Source triangle).
  Parameters:
     this : Triangle . Source triangle.
     line_color : color    . Color of the line.
  Returns: Source Triangle.
 set_line_style(this, line_style) 
  Update triangle style options (modifies Source triangle).
  Parameters:
     this : Triangle . Source triangle.
     line_style : string   . Style of the line.
  Returns: Source Triangle.
 set_line_width(this, line_width) 
  Update triangle style options (modifies Source triangle).
  Parameters:
     this : Triangle . Source triangle.
     line_width : int      . Width of the line.
  Returns: Source Triangle.
 move(this, x, y) 
  Move triangle by provided amount (modifies source triangle).
  Parameters:
     this : Triangle . Source triangle.
     x : float    . Amount to move the vertices of the triangle in the x axis.
     y : float    . Amount to move the vertices of the triangle in the y axis.
  Returns: Source Triangle.
 move(this, amount) 
  Move triangle by provided amount (modifies source triangle).
  Parameters:
     this : Triangle . Source triangle.
     amount : Vector2  . Amount to move the vertices of the triangle in the x and y axis.
  Returns: Source Triangle.
 rotate_around(this, center, angle) 
  Rotate source triangle around a center (modifies source triangle).
  Parameters:
     this : Triangle . Source triangle.
     center : Vector2  . Center coordinates of the rotation.
     angle : float    . Value of angle in degrees.
  Returns: Source Triangle.
 rotate_around(this, center_x, center_y, angle) 
  Rotate source triangle around a center (modifies source triangle).
  Parameters:
     this : Triangle . Source triangle.
     center_x : int      . Center coordinates of the rotation.
     center_y : float    . Center coordinates of the rotation.
     angle : float    . Value of angle in degrees.
  Returns: Source Triangle.
CommonTypesDrawingLibrary   "CommonTypesDrawing" 
Provides a common library source for common types of used graphical drawing structures.
Includes: `Triangle, Quad, Polygon`
 Triangle 
  Representation of a triangle using lines and linefill.
  Fields:
     ab : Edge of point a to b.
     bc : Edge of point b to c.
     ca : Edge of point c to a.
     fill : Fill of the object.
     solid : Check if polygon should have a fill.
 Quad 
  Representation of a quadrilateral using lines and linefill.
  Fields:
     ab : Edge of point a to b.
     bc : Edge of point b to c.
     cd : Edge of point c to d.
     da : Edge of point d to a.
     fill : Fill of the object.
     solid : Check if polygon should have a fill.
 Polygon 
  Representation of a polygon using lines and linefill.
  Fields:
     edges : List of edges in the polygon.
     fills : Fills of the object.
     closed : Check if polygon line should connect last vertice to first.
     solid : Check if polygon should have a fill.
Vector2DrawLineLibrary   "Vector2DrawLine" 
Extends line type with methods for Vector2 and Segment2.
 new(origin, target, xloc, extend, color, style, width) 
  Draws a line using Segment type to hold its coordinate properties..
  Parameters:
     origin : Vector2 . Origin vector of the line.
     target : Vector2 . Target vector of the line.
     xloc : string
     extend : string
     color : color
     style : string
     width : int
  Returns: line object
 new(segment, xloc, extend, color, style, width) 
  Draws a line using Segment type to hold its coordinate properties..
  Parameters:
     segment : Segment2 . Segment with positional coordinates.
     xloc : string
     extend : string
     color : color
     style : string
     width : int
  Returns: line object
 rotate_around(this, center, angle) 
  Instance method to rotate line around center vector (modifies input line).
  Parameters:
     this : line    . Line object.
     center : Vector2 . Center of rotation.
     angle : float   . Rotation angle in degrees.
  Returns: line. Rotated line object.
PitchforkMethodsLibrary   "PitchforkMethods" 
Methods associated with Pitchfork and Pitchfork Drawing. Depends on the library PitchforkTypes for Pitchfork/PitchforkDrawing objects which in turn use DrawingTypes for basic objects Point/Line/LineProperties. Also depends on DrawingMethods for related methods
 tostring(this) 
  Converts PitchforkTypes/Fork object to string representation
  Parameters:
     this : PitchforkTypes/Fork object
  Returns: string representation of PitchforkTypes/Fork
 tostring(this) 
  Converts Array of PitchforkTypes/Fork object to string representation
  Parameters:
     this : Array of PitchforkTypes/Fork object
  Returns: string representation of PitchforkTypes/Fork array
 tostring(this, sortKeys, sortOrder) 
  Converts PitchforkTypes/PitchforkProperties object to string representation
  Parameters:
     this : PitchforkTypes/PitchforkProperties object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
  Returns: string representation of PitchforkTypes/PitchforkProperties
 tostring(this, sortKeys, sortOrder) 
  Converts PitchforkTypes/PitchforkDrawingProperties object to string representation
  Parameters:
     this : PitchforkTypes/PitchforkDrawingProperties object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
  Returns: string representation of PitchforkTypes/PitchforkDrawingProperties
 tostring(this, sortKeys, sortOrder) 
  Converts PitchforkTypes/Pitchfork object to string representation
  Parameters:
     this : PitchforkTypes/Pitchfork object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
  Returns: string representation of PitchforkTypes/Pitchfork
 createDrawing(this) 
  Creates PitchforkTypes/PitchforkDrawing from PitchforkTypes/Pitchfork object
  Parameters:
     this : PitchforkTypes/Pitchfork object
  Returns: PitchforkTypes/PitchforkDrawing object created
 createDrawing(this) 
  Creates PitchforkTypes/PitchforkDrawing array from PitchforkTypes/Pitchfork array of objects
  Parameters:
     this : array of PitchforkTypes/Pitchfork object
  Returns: array of PitchforkTypes/PitchforkDrawing object created
 draw(this) 
  draws from PitchforkTypes/PitchforkDrawing object
  Parameters:
     this : PitchforkTypes/PitchforkDrawing object
  Returns: PitchforkTypes/PitchforkDrawing object drawn
 delete(this) 
  deletes PitchforkTypes/PitchforkDrawing object
  Parameters:
     this : PitchforkTypes/PitchforkDrawing object
  Returns: PitchforkTypes/PitchforkDrawing object deleted
 delete(this) 
  deletes underlying drawing of PitchforkTypes/Pitchfork object
  Parameters:
     this : PitchforkTypes/Pitchfork object
  Returns: PitchforkTypes/Pitchfork object deleted
 delete(this) 
  deletes array of PitchforkTypes/PitchforkDrawing objects
  Parameters:
     this : Array of PitchforkTypes/PitchforkDrawing object
  Returns: Array of PitchforkTypes/PitchforkDrawing object deleted
 delete(this) 
  deletes underlying drawing in array of PitchforkTypes/Pitchfork objects
  Parameters:
     this : Array of PitchforkTypes/Pitchfork object
  Returns: Array of PitchforkTypes/Pitchfork object deleted
 clear(this) 
  deletes array of PitchforkTypes/PitchforkDrawing objects and clears the array
  Parameters:
     this : Array of PitchforkTypes/PitchforkDrawing object
  Returns: void
 clear(this) 
  deletes array of PitchforkTypes/Pitchfork objects and clears the array
  Parameters:
     this : Array of Pitchfork/Pitchfork object
  Returns: void
PitchforkTypesLibrary   "PitchforkTypes" 
User Defined Types to be used for Pitchfork and Drawing elements of Pitchfork. Depends on DrawingTypes for Point, Line, and LineProperties objects
 PitchforkDrawingProperties 
  Pitchfork Drawing Properties object
  Fields:
     extend : If set to true, forks are extended towards right. Default is true
     fill : Fill forklines with transparent color. Default is true
     fillTransparency : Transparency at which fills are made. Only considered when fill is set. Default is 80
     forceCommonColor : Force use of common color for forks and fills. Default is false
     commonColor : common fill color. Used only if ratio specific fill colors are not available or if forceCommonColor is set to true.
 PitchforkDrawing 
  Pitchfork drawing components
  Fields:
     medianLine : Median line of the pitchfork
     baseLine : Base line of the pitchfork
     forkLines : fork lines of the pitchfork
     linefills : Linefills between forks
 Fork 
  Fork object property
  Fields:
     ratio : Fork ratio
     forkColor : color of fork. Default is blue
     include : flag to include the fork in drawing. Default is true
 PitchforkProperties 
  Pitchfork Properties
  Fields:
     forks : Array of Fork objects
     type : Pitchfork type. Supported values are "regular", "schiff", "mschiff", Default is regular
     inside : Flag to identify if to draw inside fork. If set to true, inside fork will be drawn
 Pitchfork 
  Pitchfork object
  Fields:
     a : Pivot Point A of pitchfork
     b : Pivot Point B of pitchfork
     c : Pivot Point C of pitchfork
     properties : PitchforkProperties object which determines type and composition of pitchfork
     dProperties : Drawing properties for pitchfork
     lProperties : Common line properties for Pitchfork lines
     drawing : PitchforkDrawing object
ZigzagMethodsLibrary   "ZigzagMethods" 
Object oriented implementation of Zigzag methods. Please refer to ZigzagTypes library for User defined types used in this library
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts ZigzagTypes/Pivot object to string representation
  Parameters:
     this : ZigzagTypes/Pivot
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of ZigzagTypes/Pivot
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts Array of Pivot objects to string representation
  Parameters:
     this : Pivot object array
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of Pivot object array
 tostring(this) 
  Converts ZigzagFlags object to string representation
  Parameters:
     this : ZigzagFlags object
  Returns: string representation of ZigzagFlags
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts ZigzagTypes/Zigzag object to string representation
  Parameters:
     this : ZigzagTypes/Zigzagobject
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of ZigzagTypes/Zigzag
 calculate(this, ohlc, indicators, indicatorNames) 
  Calculate zigzag based on input values and indicator values
  Parameters:
     this : Zigzag object
     ohlc : Array containing OHLC values. Can also have custom values for which zigzag to be calculated
     indicators : Array of indicator values
     indicatorNames : Array of indicator names for which values are present. Size of indicators array should be equal to that of indicatorNames
  Returns: current Zigzag object
 calculate(this) 
  Calculate zigzag based on properties embedded within Zigzag object
  Parameters:
     this : Zigzag object
  Returns: current Zigzag object
 nextlevel(this) 
  Calculate Next Level Zigzag based on the current calculated zigzag object
  Parameters:
     this : Zigzag object
  Returns: Next Level Zigzag object
 clear(this) 
  Clears zigzag drawings array
  Parameters:
     this : array
  Returns: void
 drawfresh(this) 
  draws fresh zigzag based on properties embedded in ZigzagDrawing object
  Parameters:
     this : ZigzagDrawing object
  Returns: ZigzagDrawing object
 drawcontinuous(this) 
  draws zigzag based on the zigzagmatrix input
  Parameters:
     this : ZigzagDrawing object
  Returns: 
ZigzagTypesLibrary   "ZigzagTypes" 
Zigzag related user defined types. Depends on DrawingTypes library for basic types
 Indicator 
  Indicator is collection of indicator values applied on high, low and close
  Fields:
     indicatorHigh : Indicator Value applied on High
     indicatorLow : Indicator Value applied on Low
 PivotCandle 
  PivotCandle represents data of the candle which forms either pivot High or pivot low or both
  Fields:
     _high : High price of candle forming the pivot
     _low : Low price of candle forming the pivot
     length : Pivot length
     pHighBar : represents number of bar back the pivot High occurred.
     pLowBar : represents number of bar back the pivot Low occurred.
     pHigh : Pivot High Price
     pLow : Pivot Low Price
     indicators : Array of Indicators - allows to add multiple
 Pivot 
  Pivot refers to zigzag pivot. Each pivot can contain various data
  Fields:
     point : pivot point coordinates
     dir : direction of the pivot. Valid values are 1, -1, 2, -2
     level : is used for multi level zigzags. For single level, it will always be 0
     ratio : Price Ratio based on previous two pivots
     indicatorNames : Names of the indicators applied on zigzag
     indicatorValues : Values of the indicators applied on zigzag
     indicatorRatios : Ratios of the indicators applied on zigzag based on previous 2 pivots
 ZigzagFlags 
  Flags required for drawing zigzag. Only used internally in zigzag calculation. Should not set the values explicitly
  Fields:
     newPivot : true if the calculation resulted in new pivot
     doublePivot : true if the calculation resulted in two pivots on same bar
     updateLastPivot : true if new pivot calculated replaces the old one.
 Zigzag 
  Zigzag object which contains whole zigzag calculation parameters and pivots
  Fields:
     length : Zigzag length. Default value is 5
     numberOfPivots : max number of pivots to hold in the calculation. Default value is 20
     offset : Bar offset to be considered for calculation of zigzag. Default is 0 - which means calculation is done based on the latest bar.
     level : Zigzag calculation level - used in multi level recursive zigzags
     zigzagPivots : array which holds the last n pivots calculated. 
     flags : ZigzagFlags object which is required for continuous drawing of zigzag lines.
 ZigzagObject 
  Zigzag Drawing Object
  Fields:
     zigzagLine : Line joining two pivots
     zigzagLabel : Label which can be used for drawing the values, ratios, directions etc.
 ZigzagProperties 
  Object which holds properties of zigzag drawing. To be used along with ZigzagDrawing
  Fields:
     lineColor : Zigzag line color. Default is color.blue
     lineWidth : Zigzag line width. Default is 1
     lineStyle : Zigzag line style. Default is line.style_solid. 
     showLabel : If set, the drawing will show labels on each pivot. Default is false
     textColor : Text color of the labels. Only applicable if showLabel is set to true.
     maxObjects : Max number of zigzag lines to display. Default is 300
     xloc : Time/Bar reference to be used for zigzag drawing. Default is Time - xloc.bar_time.
 ZigzagDrawing 
  Object which holds complete zigzag drawing objects and properties.
  Fields:
     properties : ZigzagProperties object which is used for setting the display styles of zigzag
     drawings : array which contains lines and labels of zigzag drawing.
     zigzag : Zigzag object which holds the calculations.
DrawingMethodsLibrary   "DrawingMethods" 
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/Point object to string representation
  Parameters:
     this : DrawingTypes/Point object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/Point
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/LineProperties object to string representation
  Parameters:
     this : DrawingTypes/LineProperties object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/LineProperties
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/Line object to string representation
  Parameters:
     this : DrawingTypes/Line object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/Line
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/LabelProperties object to string representation
  Parameters:
     this : DrawingTypes/LabelProperties object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/LabelProperties
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/Label object to string representation
  Parameters:
     this : DrawingTypes/Label object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/Label
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/Linefill object to string representation
  Parameters:
     this : DrawingTypes/Linefill object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/Linefill
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/BoxProperties object to string representation
  Parameters:
     this : DrawingTypes/BoxProperties object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/BoxProperties
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/BoxText object to string representation
  Parameters:
     this : DrawingTypes/BoxText object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/BoxText
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/Box object to string representation
  Parameters:
     this : DrawingTypes/Box object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/Box
 delete(this) 
  Deletes line from DrawingTypes/Line object
  Parameters:
     this : DrawingTypes/Line object
  Returns: Line object deleted
 delete(this) 
  Deletes label from DrawingTypes/Label object
  Parameters:
     this : DrawingTypes/Label object
  Returns: Label object deleted
 delete(this) 
  Deletes Linefill from DrawingTypes/Linefill object
  Parameters:
     this : DrawingTypes/Linefill object
  Returns: Linefill object deleted
 delete(this) 
  Deletes box from DrawingTypes/Box object
  Parameters:
     this : DrawingTypes/Box object
  Returns: DrawingTypes/Box object deleted
 delete(this) 
  Deletes lines from array of DrawingTypes/Line objects
  Parameters:
     this : Array of DrawingTypes/Line objects
  Returns: Array of DrawingTypes/Line objects
 delete(this) 
  Deletes labels from array of DrawingTypes/Label objects
  Parameters:
     this : Array of DrawingTypes/Label objects
  Returns: Array of DrawingTypes/Label objects
 delete(this) 
  Deletes linefill from array of DrawingTypes/Linefill objects
  Parameters:
     this : Array of DrawingTypes/Linefill objects
  Returns: Array of DrawingTypes/Linefill objects
 delete(this) 
  Deletes boxes from array of DrawingTypes/Box objects
  Parameters:
     this : Array of DrawingTypes/Box objects
  Returns: Array of DrawingTypes/Box objects
 clear(this) 
  clear items from array of DrawingTypes/Line while deleting underlying objects
  Parameters:
     this : array
  Returns: void
 clear(this) 
  clear items from array of DrawingTypes/Label while deleting underlying objects
  Parameters:
     this : array
  Returns: void
 clear(this) 
  clear items from array of DrawingTypes/Linefill while deleting underlying objects
  Parameters:
     this : array
  Returns: void
 clear(this) 
  clear items from array of DrawingTypes/Box while deleting underlying objects
  Parameters:
     this : array
  Returns: void
 draw(this) 
  Creates line from DrawingTypes/Line object
  Parameters:
     this : DrawingTypes/Line object
  Returns: line created from DrawingTypes/Line object
 draw(this) 
  Creates lines from array of DrawingTypes/Line objects
  Parameters:
     this : Array of DrawingTypes/Line objects
  Returns: Array of DrawingTypes/Line objects
 draw(this) 
  Creates label from DrawingTypes/Label object
  Parameters:
     this : DrawingTypes/Label object
  Returns: label created from DrawingTypes/Label object
 draw(this) 
  Creates labels from array of DrawingTypes/Label objects
  Parameters:
     this : Array of DrawingTypes/Label objects
  Returns: Array of DrawingTypes/Label objects
 draw(this) 
  Creates linefill object from DrawingTypes/Linefill
  Parameters:
     this : DrawingTypes/Linefill objects
  Returns: linefill object created
 draw(this) 
  Creates linefill objects from array of DrawingTypes/Linefill objects
  Parameters:
     this : Array of DrawingTypes/Linefill objects
  Returns: Array of DrawingTypes/Linefill used for creating linefills
 draw(this) 
  Creates box from DrawingTypes/Box object
  Parameters:
     this : DrawingTypes/Box object
  Returns: box created from DrawingTypes/Box object
 draw(this) 
  Creates labels from array of DrawingTypes/Label objects
  Parameters:
     this : Array of DrawingTypes/Label objects
  Returns: Array of DrawingTypes/Label objects
 createLabel(this, lblText, tooltip, properties) 
  Creates DrawingTypes/Label object from DrawingTypes/Point
  Parameters:
     this : DrawingTypes/Point object
     lblText : Label text
     tooltip : Tooltip text. Default is na
     properties : DrawingTypes/LabelProperties object. Default is na - meaning default values are used.
  Returns: DrawingTypes/Label object
 createLine(this, other, properties) 
  Creates DrawingTypes/Line object from one DrawingTypes/Point to other
  Parameters:
     this : First DrawingTypes/Point object
     other : Second DrawingTypes/Point object
     properties : DrawingTypes/LineProperties object. Default set to na - meaning default values are used.
  Returns: DrawingTypes/Line object
 createLinefill(this, other, fillColor, transparency) 
  Creates DrawingTypes/Linefill object from DrawingTypes/Line object to other DrawingTypes/Line object
  Parameters:
     this : First DrawingTypes/Line object
     other : Other DrawingTypes/Line object
     fillColor : fill color of linefill. Default is color.blue
     transparency : fill transparency for linefill. Default is 80
  Returns: Array of DrawingTypes/Linefill object
 createBox(this, other, properties, textProperties) 
  Creates DrawingTypes/Box object from one DrawingTypes/Point to other
  Parameters:
     this : First DrawingTypes/Point object
     other : Second DrawingTypes/Point object
     properties : DrawingTypes/BoxProperties object. Default set to na - meaning default values are used.
     textProperties : DrawingTypes/BoxText object. Default is na - meaning no text will be drawn
  Returns: DrawingTypes/Box object
 createBox(this, properties, textProperties) 
  Creates DrawingTypes/Box object from DrawingTypes/Line as diagonal line
  Parameters:
     this : Diagonal DrawingTypes/PoLineint object
     properties : DrawingTypes/BoxProperties object. Default set to na - meaning default values are used.
     textProperties : DrawingTypes/BoxText object. Default is na - meaning no text will be drawn
  Returns: DrawingTypes/Box object
DrawingTypesLibrary   "DrawingTypes" 
User Defined Types for basic drawing structure. Other types and methods will be built on these.
 Point 
  Point refers to point on chart
  Fields:
     price : pivot price
     bar : pivot bar
     bartime : pivot bar time
 LineProperties 
  Properties of line object
  Fields:
     xloc : X Reference - can be either xloc.bar_index or xloc.bar_time. Default is xloc.bar_index
     extend : Property which sets line to extend towards either right or left or both. Valid values are extend.right, extend.left, extend.both, extend.none. Default is extend.none
     color : Line color
     style : Line style, valid values are line.style_solid, line.style_dashed, line.style_dotted, line.style_arrow_left, line.style_arrow_right, line.style_arrow_both. Default is line.style_solid
     width : Line width. Default is 1
 Line 
  Line object created from points
  Fields:
     start : Starting point of the line
     end : Ending point of the line
     properties : LineProperties object which defines the style of line
     object : Derived line object
 LabelProperties 
  Properties of label object
  Fields:
     xloc : X Reference - can be either xloc.bar_index or xloc.bar_time. Default is xloc.bar_index
     yloc : Y reference - can be yloc.price, yloc.abovebar, yloc.belowbar. Default is yloc.price
     color : Label fill color
     style : Label style as defined in www.tradingview.com Default is label.style_none
     textcolor : text color. Default is color.black
     size : Label text size. Default is size.normal. Other values are size.auto, size.tiny, size.small, size.normal, size.large, size.huge
     textalign : Label text alignment. Default if text.align_center. Other allowed values - text.align_right, text.align_left, text.align_top, text.align_bottom
     text_font_family : The font family of the text. Default value is font.family_default. Other available option is font.family_monospace
 Label 
  Label object
  Fields:
     point : Point where label is drawn
     lblText : label text
     tooltip : Tooltip text. Default is na
     properties : LabelProperties object
     object : Pine label object
 Linefill 
  Linefill object
  Fields:
     line1 : First line to create linefill
     line2 : Second line to create linefill
     fillColor : Fill color
     transparency : Fill transparency range from 0 to 100
     object : linefill object created from wrapper
 BoxProperties 
  BoxProperties object
  Fields:
     border_color : Box border color. Default is color.blue
     bgcolor : box background color
     border_width : Box border width. Default is 1
     border_style : Box border style. Default is line.style_solid
     extend : Extend property of box. default is extend.none
     xloc : defines if drawing needs to be done based on bar index or time. default is xloc.bar_index
 BoxText 
  Box Text properties.
  Fields:
     boxText : Text to be printed on the box
     text_size : Text size. Default is size.auto
     text_color : Box text color. Default is color.yellow. 
     text_halign : horizontal align style - default is text.align_center
     text_valign : vertical align style - default is text.align_center
     text_wrap : text wrap style - default is text.wrap_auto
     text_font_family : Text font. Default is
 Box 
  Box object
  Fields:
     p1 : Diagonal point one
     p2 : Diagonal point two
     properties : Box properties
     textProperties : Box text properties
     object : Box object created
Wave Generator Library (WGL)Library   "WaveGenerator" 
Wave Generator Library
 max(source) 
  max
  Parameters:
     source : is the input to take the maximum.
  Returns: foat
 min(source) 
  min
  Parameters:
     source : is the input to take the minimum.
  Returns: foat
 min_max(src, height) 
  min_max
  Parameters:
     src : is the input for the min/max
     height 
  Returns: float
 sine_wave(_wave_height, _wave_duration, _phase_shift, _phase_shift_2) 
  sine_wave
  Parameters:
     _wave_height : Maximum output level
     _wave_duration : Wave length
     _phase_shift : Number of harmonics
     _phase_shift_2 
  Returns: float
 triangle_wave(_wave_height, _wave_duration, _num_harmonics, _phase_shift) 
  triangle_wave
  Parameters:
     _wave_height : Maximum output level
     _wave_duration : Wave length
     _num_harmonics : Number of harmonics
     _phase_shift : Phase shift
  Returns: float
 saw_wave(_wave_height, _wave_duration, _num_harmonics, _phase_shift) 
  saw_wave
  Parameters:
     _wave_height : Maximum output level
     _wave_duration : Wave length
     _num_harmonics : Number of harmonics
     _phase_shift : Phase shift
  Returns: float
 ramp_saw_wave(_wave_height, _wave_duration, _num_harmonics, _phase_shift) 
  ramp_saw_wave
  Parameters:
     _wave_height : Maximum output level
     _wave_duration : Wave length
     _num_harmonics : Number of harmonics
     _phase_shift : Phase shift
  Returns: float
 square_wave(_wave_height, _wave_duration, _num_harmonics, _phase_shift) 
  square_wave
  Parameters:
     _wave_height : Maximum output level
     _wave_duration : Wave length
     _num_harmonics : Number of harmonics
     _phase_shift : Phase shift
  Returns: float
 wave_select(style, _wave_height, _wave_duration, _num_harmonics, _phase_shift) 
  wave_select
@peram style Select the style of wave. "Sine", "Triangle", "Saw", "Ramp Saw", "Square"
  Parameters:
     style 
     _wave_height : Maximum output level
     _wave_duration : Wave length
     _num_harmonics : Number of harmonics
     _phase_shift : Phase shift
  Returns: float
CommonTypesMathLibrary   "CommonTypesMath" 
Provides a common library source for common types of useful mathematical structures.
Includes: `complex, Vector2, Vector3, Vector4, Quaternion, Segment2, Segment3, Pole, Plane, M32, M44`
 complex 
  Representation of a Complex Number, a complex number `z` is a number in the form `z = x + yi`,
  Fields:
     re : Real part of the complex number.
     im : Imaginary part of the complex number.
 Vector2 
  Representation of a two dimentional vector with components `(x:float,y:float)`.
  Fields:
     x : Coordinate `x` of the vector.
     y : Coordinate `y` of the vector.
 Vector3 
  Representation of a three dimentional vector with components `(x:float,y:float,z:float)`.
  Fields:
     x : Coordinate `x` of the vector.
     y : Coordinate `y` of the vector.
     z : Coordinate `z` of the vector.
 Vector4 
  Representation of a four dimentional vector with components `(x:float,y:float,z:float,w:float)`.
  Fields:
     x : Coordinate `x` of the vector.
     y : Coordinate `y` of the vector.
     z : Coordinate `z` of the vector.
     w : Coordinate `w` of the vector.
 Quaternion 
  Representation of a four dimentional vector with components `(x:float,y:float,z:float,w:float)`.
  Fields:
     x : Coordinate `x` of the vector.
     y : Coordinate `y` of the vector.
     z : Coordinate `z` of the vector.
     w : Coordinate `w` of the vector, specifies the rotation component.
 Segment2 
  Representation of a line in two dimentional space.
  Fields:
     origin : Origin coordinates.
     target : Target coordinates.
 Segment3 
  Representation of a line in three dimentional space.
  Fields:
     origin : Origin coordinates.
     target : Target coordinates.
 Pole 
  Representation of polar coordinates `(radius:float,angle:float)`.
  Fields:
     radius : Radius of the pole.
     angle : Angle in radians of the pole.
 Plane 
  Representation of a 3D plane.
  Fields:
     normal : Normal vector of the plane.
     distance : Distance of the plane along its normal from the origin.
 M32 
  Representation of a 3x2 matrix.
  Fields:
     m11 : First element of the first row.
     m12 : Second element of the first row.
     m21 : First element of the second row.
     m22 : Second element of the second row.
     m31 : First element of the third row.
     m32 : Second element of the third row.
 M44 
  Representation of a 4x4 matrix.
  Fields:
     m11 : First element of the first row.
     m12 : Second element of the first row.
     m13 : Third element of the first row.
     m14 : fourth element of the first row.
     m21 : First element of the second row.
     m22 : Second element of the second row.
     m23 : Third element of the second row.
     m24 : fourth element of the second row.
     m31 : First element of the third row.
     m32 : Second element of the third row.
     m33 : Third element of the third row.
     m34 : fourth element of the third row.
     m41 : First element of the fourth row.
     m42 : Second element of the fourth row.
     m43 : Third element of the fourth row.
     m44 : fourth element of the fourth row.
BasicVisibleChartBasic library for the visible range chart; with functions to allow plotting Fibs from body high/low as well as wick high/low
-Thanks to code from @PineCoders Visible Chart library (PineCoders/VisibleChart/4), which is a much more comprehensive library than this, but which does not include some functions that I find useful:
-Added the following exportable functions: highest/lowest body, highest/lowest close, highest/lowest open. These allow one to anchor fibs from bodies rather than wicks
-Added a Fib Box function in the example code
The above chart shows the example code plotting a Fib range drawn from bodies and a highlighted retracement zone  (61.8 % - 78.6% )
~~All Exportable Functions~~
 barIsVisible() 
 highestClose() 
 highestOpen() 
 highestBody() 
 lowestClose() 
 lowestOpen() 
 lowestBody() 
 high() 
 highBarTime() 
 low() 
 lowBarTime() 
 open() 
 close() 
eHarmonicpatternsLogScaleLibrary   "eHarmonicpatternsLogScale" 
Library provides functions to scan harmonic patterns both or normal and log scale
 getSupportedPatterns() 
 get_prz_range(x, a, b, c, patternArray, errorPercent, start_adj, end_adj, logScale) 
  Provides PRZ range based on BCD and XAD ranges
  Parameters:
     x : X coordinate value
     a : A coordinate value
     b : B coordinate value
     c : C coordinate value
     patternArray : Pattern flags for which PRZ range needs to be calculated
     errorPercent : Error threshold
     start_adj : - Adjustments for entry levels
     end_adj : - Adjustments for stop levels
     logScale : - calculate on log scale. Default is false
  Returns:   Start and end of consolidated PRZ range
 get_prz_range_xad(x, a, b, c, patternArray, errorPercent, start_adj, end_adj, logScale) 
  Provides PRZ range based on XAD range only
  Parameters:
     x : X coordinate value
     a : A coordinate value
     b : B coordinate value
     c : C coordinate value
     patternArray : Pattern flags for which PRZ range needs to be calculated
     errorPercent : Error threshold
     start_adj : - Adjustments for entry levels
     end_adj : - Adjustments for stop levels
     logScale : - calculate on log scale. Default is false
  Returns:   Start and end of consolidated PRZ range
 get_projection_range(x, a, b, c, patternArray, errorPercent, start_adj, end_adj, logScale) 
  Provides Projection range based on BCD and XAD ranges
  Parameters:
     x : X coordinate value
     a : A coordinate value
     b : B coordinate value
     c : C coordinate value
     patternArray : Pattern flags for which PRZ range needs to be calculated
     errorPercent : Error threshold
     start_adj : - Adjustments for entry levels
     end_adj : - Adjustments for stop levels
     logScale : - calculate on log scale. Default is false
  Returns:   Array containing start and end ranges
 isHarmonicPattern(x, a, b, c, d, flags, defaultEnabled, errorPercent, logScale) 
  Checks for harmonic patterns
  Parameters:
     x : X coordinate value
     a : A coordinate value
     b : B coordinate value
     c : C coordinate value
     d : D coordinate value
     flags : flags to check patterns. Send empty array to enable all 
     defaultEnabled 
     errorPercent : Error threshold
     logScale : - calculate on log scale. Default is false
  Returns:   Array of boolean values which says whether valid pattern exist and array of corresponding pattern names
 isHarmonicProjection(x, a, b, c, flags, defaultEnabled, errorPercent, logScale) 
  Checks for harmonic pattern projection
  Parameters:
     x : X coordinate value
     a : A coordinate value
     b : B coordinate value
     c : C coordinate value
     flags : flags to check patterns. Send empty array to enable all 
     defaultEnabled 
     errorPercent : Error threshold
     logScale : - calculate on log scale. Default is false
  Returns:   Array of boolean values which says whether valid pattern exist and array of corresponding pattern names.
FibRatiosLibrary   "FibRatios" 
Library with calculation logic for fib retracement, extension and ratios
 retracement(a, b, ratio, logScale, precision) 
  Calculates the retracement for points a, b with given ratio and scale
  Parameters:
     a : Starting point a
     b : Second point b
     ratio : Ratio for which we need to calculate retracement c
     logScale : Flag to get calculations in log scale. Default is false
     precision : rounding precision. If set to netagive number, round_to_mintick is applied. Default is -1
  Returns: retracement point c for points a,b with given ratio and scale
 retracementRatio(a, b, c, logScale, precision) 
  Calculates the retracement ratio for points a, b, c with given scale
  Parameters:
     a : Starting point a
     b : Second point b
     c : Retracement point. c should be placed between a and b
     logScale : Flag to get calculations in log scale. Default is false
     precision : rounding precision. If set to netagive number, round_to_mintick is applied. Default is 3
  Returns: retracement ratio for points a,b,c on given scale
 extension(a, b, c, ratio, logScale, precision) 
  Calculates the extensions for points a, b, c with given ratio and scale
  Parameters:
     a : Starting point a
     b : Second point b
     c : Retracement point. c should be placed between a and b
     ratio : Ratio for which we need to calculate extension d
     logScale : Flag to get calculations in log scale. Default is false
     precision : rounding precision. If set to netagive number, round_to_mintick is applied. Default is -1
  Returns: extensoin point d for points a,b,c with given ratio and scale
 extensionRatio(a, b, c, d, logScale, precision) 
  Calculates the extension ratio for points a, b, c, d with given scale
  Parameters:
     a : Starting point a
     b : Second point b
     c : Retracement point. c should be placed between a and b
     d : Extension point. d should be placed beyond a, c. But, can be with b,c or beyond b
     logScale : Flag to get calculations in log scale. Default is false
     precision : rounding precision. If set to netagive number, round_to_mintick is applied. Default is 3
  Returns: extension ratio for points a,b,c,d on given scale
PatternLibrary   "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:  
 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
BpaLibrary   "Bpa" 
TODO: library of Brooks Price Action concepts
 isBreakoutBar(atr, high, low, close, open, tail, size) 
  TODO: check if the bar is a breakout based on the specified conditions
  Parameters:
     atr : TODO: atr value
     high : TODO: high price
     low : TODO: low price
     close : TODO: close price 
     open : TODO: open price
     tail : TODO: decimal value for a percent that represent the size of the tail of the bar that cant be preceeded to be considered strong close
     size : TODO: decimal value for a percent that represents by how much the breakout bar should be bigger than others to be considered one
  Returns: TODO: boolean value, true if breakout bar, false otherwise






















