lib_retracement_patternsLibrary "lib_retracement_patterns"
types and functions for XABCD pattern detection and plotting
method set_tolerances(this, tolerance_Bmin, tolerance_Bmax, tolerance_Cmin, tolerance_Cmax, tolerance_Dmin, tolerance_Dmax)
sets tolerances for B, C and D retracements. This creates another Pattern instance that is set as tolerances field on the original and will be used for detection instead of the original ratios.
Namespace types: Pattern
create_config(pattern_line_args, pattern_point_args, name_label_args, retracement_line_args, retracement_label_args, line_args_Dtarget, line_args_completion, line_args_tp1, line_args_tp2, line_args_sl, label_args_completion, label_args_tp1, label_args_tp2, label_args_sl, label_terminal, label_terminal_up_char, label_terminal_down_char, color_bull, color_bear, color_muted, fill_opacity, draw_point_labels, draw_retracements, draw_target_range, draw_levels, hide_shorter_if_shared_legs_greater_than_max, hide_engulfed_pattern, hide_engulfed_pattern_of_same_type, hide_longer_pattern_with_same_X, mute_previous_pattern_when_next_overlaps, keep_failed_patterns)
method direction(this)
Namespace types: Match
method length(this)
return the length of this pattern, determined by the distance between X and D point
Namespace types: Match
method height(this)
return the height of this pattern, determined by the distance between the biggest distance between A/C and X/D
Namespace types: Match
method is_forming(this)
returns true if not complete, not expired and not invalidated
Namespace types: Match
method tostring(this)
return a string representation of all Matches in this map
Namespace types: Match
method tostring(this)
Namespace types: map
remove_complete_and_expired(this)
method add(this, item)
Namespace types: map
method is_engulfed_by(this, other)
checks if this Match is engulfed by the other
Namespace types: Match
method update(tracking_matches, zigzag, patterns, max_age_idx, detect_dir, pattern_minlen, pattern_maxlen, max_sub_waves, max_shared_legs, max_XB_BD_ratio, debug_log)
checks this map of tracking Matches if any of them was completed or invalidated in
Namespace types: map
method mute(this, mute_color, mute_fill_color)
mute this pattern by making it all one color (lines and labels, for pattern fill there's another)
Namespace types: Match
method mute(this, mute_color, mute_fill_color)
mute all patterns in this map by making it all one color (lines and labels, for pattern fill there's another)
Namespace types: map
method hide(this)
hide this pattern by muting it with a transparent color
Namespace types: Match
method reset_styles(this)
reset the style of a muted or hidden match back to the preset configuration
Namespace types: Match
method delete(this)
remove the plot of this Match from the chart
Namespace types: Match
method delete(this)
remove all the plots of the Matches in this map from the chart
Namespace types: map
method draw(this)
draw this Match on the chart
Namespace types: Match
method draw(this, config, all_patterns, debug_log)
draw all Matches in this map, considering all other patterns for engulfing and overlapping
Namespace types: map
method check_hide_or_mute(this, all, config, debug_log)
checks if this pattern needs to be hidden or muted based on other plotted patterns and given configuration
Namespace types: Match
method add_if(id, item, condition)
convenience function to add a search pattern to a list, only if given condition (input.bool) is true
Namespace types: Pattern
Pattern
type to hold retracement ratios and tolerances for this pattern, as well as targets for trades
Config
allows control of pattern plotting shape and colors, as well as settings for hiding overlapped patterns etc.
Match
holds all information on a Pattern and a successful match in the chart. Includes XABCD pivot points as well as all Line and Label objects to draw it
Wizardry
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_profileLibrary "lib_profile"
a library with functions to calculate a volume profile for either a set of candles within the current chart, or a single candle from its lower timeframe security data. All you need is to feed the
method delete(this)
deletes this bucket's plot from the chart
Namespace types: Bucket
Parameters:
this (Bucket)
method delete(this)
Namespace types: Profile
Parameters:
this (Profile)
method delete(this)
Namespace types: Bucket
Parameters:
this (Bucket )
method delete(this)
Namespace types: Profile
Parameters:
this (Profile )
method update(this, top, bottom, value, fraction)
updates this bucket's data
Namespace types: Bucket
Parameters:
this (Bucket)
top (float)
bottom (float)
value (float)
fraction (float)
method update(this, tops, bottoms, values)
update this Profile's data (recalculates the whole profile and applies the result to this object) TODO optimisation to calculate this incremental to improve performance in realtime on high resolution
Namespace types: Profile
Parameters:
this (Profile)
tops (float ) : array of range top/high values (either from ltf or chart candles using history() function
bottoms (float ) : array of range bottom/low values (either from ltf or chart candles using history() function
values (float ) : array of range volume/1 values (either from ltf or chart candles using history() function (1s can be used for analysing candles in bucket/price range over time)
method tostring(this)
allows debug print of a bucket
Namespace types: Bucket
Parameters:
this (Bucket)
method draw(this, start_t, start_i, end_t, end_i, args, line_color)
allows drawing a line in a Profile, representing this bucket and it's value + it's value's fraction of the Profile total value
Namespace types: Bucket
Parameters:
this (Bucket)
start_t (int) : the time x coordinate of the line's left end (depends on the Profile box)
start_i (int) : the bar_index x coordinate of the line's left end (depends on the Profile box)
end_t (int) : the time x coordinate of the line's right end (depends on the Profile box)
end_i (int) : the bar_index x coordinate of the line's right end (depends on the Profile box)
args (LineArgs type from robbatt/lib_plot_objects/24) : the default arguments for the line style
line_color (color) : the color override for POC/VAH/VAL lines
method draw(this, forced_width)
draw all components of this Profile (Box, Background, Bucket lines, POC/VAH/VAL overlay levels and labels)
Namespace types: Profile
Parameters:
this (Profile)
forced_width (int) : allows to force width of the Profile Box, overrides the ProfileArgs.default_size and ProfileArgs.extend arguments (default: na)
method init(this)
Namespace types: ProfileArgs
Parameters:
this (ProfileArgs)
method init(this)
Namespace types: Profile
Parameters:
this (Profile)
profile(tops, bottoms, values, resolution, vah_pc, val_pc, bucket_buffer)
split a chart/parent bar into 'resolution' sections, figure out in which section the most volume/time was spent, by analysing a given set of (intra)bars' top/bottom/volume values. Then return price center of the bin with the highest volume, essentially marking the point of control / highest volume (poc) in the chart/parent bar.
Parameters:
tops (float ) : array of range top/high values (either from ltf or chart candles using history() function
bottoms (float ) : array of range bottom/low values (either from ltf or chart candles using history() function
values (float ) : array of range volume/1 values (either from ltf or chart candles using history() function (1s can be used for analysing candles in bucket/price range over time)
resolution (int) : amount of buckets/price ranges to sort the candle data into (analyse how much volume / time was spent in a certain bucket/price range) (default: 25)
vah_pc (float) : a threshold percentage (of values' total) for the top end of the value area (default: 80)
val_pc (float) : a threshold percentage (of values' total) for the bottom end of the value area (default: 20)
bucket_buffer (Bucket ) : optional buffer of empty Buckets to fill, if omitted a new one is created and returned. The buffer length must match the resolution
Returns: poc (price level), vah (price level), val (price level), poc_index (idx in buckets), vah_index (idx in buckets), val_index (idx in buckets), buckets (filled buffer or new)
create_profile(start_idx, tops, bottoms, values, resolution, vah_pc, val_pc, args)
split a chart/parent bar into 'resolution' sections, figure out in which section the most volume/time was spent, by analysing a given set of (intra)bars' top/bottom/volume values. Then return price center of the bin with the highest volume, essentially marking the point of control / highest volume (poc) in the chart/parent bar.
Parameters:
start_idx (int) : the bar_index at which the Profile should start drawing
tops (float ) : array of range top/high values (either from ltf or chart candles using history() function
bottoms (float ) : array of range bottom/low values (either from ltf or chart candles using history() function
values (float ) : array of range volume/1 values (either from ltf or chart candles using history() function (1s can be used for analysing candles in bucket/price range over time)
resolution (int) : amount of buckets/price ranges to sort the candle data into (analyse how much volume / time was spent in a certain bucket/price range) (default: 25)
vah_pc (float) : a threshold percentage (of values' total) for the top end of the value area (default: 80)
val_pc (float) : a threshold percentage (of values' total) for the bottom end of the value area (default: 20)
args (ProfileArgs)
Returns: poc (price level), vah (price level), val (price level), poc_index (idx in buckets), vah_index (idx in buckets), val_index (idx in buckets), buckets (filled buffer or new)
history(src, len, offset)
allows fetching an array of values from the history series with offset from current candle
Parameters:
src (int)
len (int)
offset (int)
history(src, len, offset)
allows fetching an array of values from the history series with offset from current candle
Parameters:
src (float)
len (int)
offset (int)
history(src, len, offset)
allows fetching an array of values from the history series with offset from current candle
Parameters:
src (bool)
len (int)
offset (int)
history(src, len, offset)
allows fetching an array of values from the history series with offset from current candle
Parameters:
src (string)
len (int)
offset (int)
Bucket
Fields:
idx (series int) : the index of this Bucket within the Profile starting with 0 for the lowest Bucket at the bottom of the Profile
value (series float) : the value of this Bucket, can be volume or time, for using time pass and array of 1s to the update function
top (series float) : the top of this Bucket's price range (for calculation)
btm (series float) : the bottom of this Bucket's price range (for calculation)
center (series float) : the center of this Bucket's price range (for plotting)
fraction (series float) : the fraction this Bucket's value is compared to the total of the Profile
plot_bucket_line (Line type from robbatt/lib_plot_objects/24) : the line that resembles this bucket and it's valeu in the Profile
ProfileArgs
Fields:
show_poc (series bool) : whether to plot a POC line across the Profile Box (default: true)
show_profile (series bool) : whether to plot a line for each Bucket in the Profile Box, indicating the value per Bucket (Price range), e.g. volume that occured in a certain time and price range (default: false)
show_va (series bool) : whether to plot a VAH/VAL line across the Profile Box (default: false)
show_va_fill (series bool) : whether to fill the 'value' area between VAH/VAL line (default: false)
show_background (series bool) : whether to fill the Profile Box with a background color (default: false)
show_labels (series bool) : whether to add labels to the right end of the POC/VAH/VAL line (default: false)
show_price_levels (series bool) : whether add price values to the labels to the right end of the POC/VAH/VAL line (default: false)
extend (series bool) : whether extend the Profile Box to the current candle (default: false)
default_size (series int) : the default min. width of the Profile Box (default: 30)
args_poc_line (LineArgs type from robbatt/lib_plot_objects/24) : arguments for the poc line plot
args_va_line (LineArgs type from robbatt/lib_plot_objects/24) : arguments for the va line plot
args_poc_label (LabelArgs type from robbatt/lib_plot_objects/24) : arguments for the poc label plot
args_va_label (LabelArgs type from robbatt/lib_plot_objects/24) : arguments for the va label plot
args_profile_line (LineArgs type from robbatt/lib_plot_objects/24) : arguments for the Bucket line plots
args_profile_bg (BoxArgs type from robbatt/lib_plot_objects/24)
va_fill_color (series color) : color for the va area fill plot
Profile
Fields:
start (series int) : left x coordinate for the Profile Box
end (series int) : right x coordinate for the Profile Box
resolution (series int) : the amount of buckets/price ranges the Profile will dissect the data into
vah_threshold_pc (series float) : the percentage of the total data value to mark the upper threshold for the main value area
val_threshold_pc (series float) : the percentage of the total data value to mark the lower threshold for the main value area
args (ProfileArgs) : the style arguments for the Profile Box
h (series float) : the highest price of the data
l (series float) : the lowest price of the data
total (series float) : the total data value (e.g. volume of all candles, or just one each to analyse candle distribution over time)
buckets (Bucket ) : the Bucket objects holding the data for each price range bucket
poc_bucket_index (series int) : the Bucket index in buckets, that holds the poc Bucket
vah_bucket_index (series int) : the Bucket index in buckets, that holds the vah Bucket
val_bucket_index (series int) : the Bucket index in buckets, that holds the val Bucket
poc (series float) : the according price level marking the Point Of Control
vah (series float) : the according price level marking the Value Area High
val (series float) : the according price level marking the Value Area Low
plot_poc (Line type from robbatt/lib_plot_objects/24)
plot_vah (Line type from robbatt/lib_plot_objects/24)
plot_val (Line type from robbatt/lib_plot_objects/24)
plot_poc_label (Label type from robbatt/lib_plot_objects/24)
plot_vah_label (Label type from robbatt/lib_plot_objects/24)
plot_val_label (Label type from robbatt/lib_plot_objects/24)
plot_va_fill (LineFill type from robbatt/lib_plot_objects/24)
plot_profile_bg (Box type from robbatt/lib_plot_objects/24)
lib_retracement_labelLibrary "lib_retracement_label"
creates a retracement label between the origin and target of a retracement, updating it's position (via update + draw) when the target moves.
create_tooltip(name, min, max, tol_min, tol_max)
Parameters:
name (string)
min (float)
max (float)
tol_min (float)
tol_max (float)
method update(this)
Namespace types: RetracementLabel
Parameters:
this (RetracementLabel)
method create_retracement_label(this, move_endpoint, args, tooltip)
Creates a new RetracementLabel object.
Namespace types: D.Line
Parameters:
this (Line type from robbatt/lib_plot_objects/23)
move_endpoint (Point type from robbatt/lib_plot_objects/23)
args (LabelArgs type from robbatt/lib_plot_objects/23)
tooltip (string)
method create_retracement_label(this, move_end, args, tooltip)
Creates a new RetracementLabel object.
Namespace types: D.Line
Parameters:
this (Line type from robbatt/lib_plot_objects/23)
move_end (Pivot type from robbatt/lib_pivot/43)
args (LabelArgs type from robbatt/lib_plot_objects/23)
tooltip (string)
method enqueue(id, item, max)
Namespace types: RetracementLabel
Parameters:
id (RetracementLabel )
item (RetracementLabel)
max (int)
method draw(this)
Namespace types: RetracementLabel
Parameters:
this (RetracementLabel)
method draw(this)
Namespace types: RetracementLabel
Parameters:
this (RetracementLabel )
method delete(this)
Namespace types: RetracementLabel
Parameters:
this (RetracementLabel)
method delete(this)
Namespace types: RetracementLabel
Parameters:
this (RetracementLabel )
RetracementLabel
Fields:
move_endpoint (|robbatt/lib_plot_objects/23;Point|#OBJ)
center_label (|robbatt/lib_plot_objects/23;CenterLabel|#OBJ)
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
lib_priceactionLibrary "lib_priceaction"
a library for everything related to price action, starting off with displacements
displacement(len, min_strength, o, c)
calculate if there is a displacement and how strong it is
Parameters:
len (int) : The amount of candles to consider for the deviation
min_strength (float) : The minimum displacement strength to trigger a signal
o (float) : The source series on which calculations are based
c (float) : The source series on which calculations are based
Returns: a tuple of (bool signal, float displacement_strength)
lib_statemachineLibrary "lib_statemachine"
simple state machine that allows tracking a state an manipulating it with conditions
method step(this, before, after, condition)
will step the state of the state machine from one to the next in case of condition
Namespace types: StateMachine
Parameters:
this (StateMachine) : (StateMachine) the state machine to use
before (int) : (int) from state
after (int) : (int) to state
condition (bool) : (bool) if condition is true
Returns: true (bool) if the state of the statemachine changed
method step(this, after, condition)
will change the state of the state machine to the next in case of condition (not depending on previous state)
Namespace types: StateMachine
Parameters:
this (StateMachine) : (StateMachine) the state machine to use
after (int) : (int) to state
condition (bool) : (bool) if condition is true
Returns: true (bool) if the state of the statemachine changed
method changed(this, within_bars)
will return true if the state of the state machine was changed in this iteration
Namespace types: StateMachine
Parameters:
this (StateMachine) : (StateMachine) the state machine to use
within_bars (int)
Returns: true (bool) if the state of the statemachine changed
method reset(this, condition, min_occurrences)
will reset the state machine if a certain 'condition' appears 'min_occurrences' times
Namespace types: StateMachine
Parameters:
this (StateMachine) : (StateMachine) the state machine to use
condition (bool) : (bool) reset condition
min_occurrences (int) : (int) min times 'condition' must appear for the reset to happen
Returns: true (bool) if the state of the statemachine changed
StateMachine
Fields:
state (series__integer)
neutral (series__integer)
enabled (series__bool)
reset_counter (series__integer)
lib_colorsLibrary "lib_colors"
offset_mono(original, offset, transparency)
get offset color
Parameters:
original (simple color) : original color
offset (float) : offset for new color
transparency (float) : transparency for new color
Returns: offset color
lib_arrayLibrary "lib_array"
several array functions for chained calls, batch conversion, incrementing and comparing arrays.
method sort(id, descending)
Namespace types: int
Parameters:
id (int ) : The array to sort (and return again)
descending (bool) : The sort order: order.ascending (default:false, meaning omit this param and just call myArray.sort()) or order.descending => set descending=true
@return The array that was passed as parameter id
method sort(id, descending)
Namespace types: float
Parameters:
id (float ) : The array to sort (and return again)
descending (bool) : The sort order: order.ascending (default:false, meaning omit this param and just call myArray.sort()) or order.descending => set descending=true
@return The array that was passed as parameter id
method sort(id, descending)
Namespace types: string
Parameters:
id (string ) : The array to sort (and return again)
descending (bool) : The sort order: order.ascending (default:false, meaning omit this param and just call myArray.sort()) or order.descending => set descending=true
@return The array that was passed as parameter id
method increment(id, by_value)
Namespace types: int
Parameters:
id (int ) : The array to increment (and return again)
by_value (int) : The value by which to increment (default: 1)
@return The array that was passed as parameter id
method increment(id, by_value)
Namespace types: float
Parameters:
id (float ) : The array to increment (and return again)
by_value (float) : The value by which to increment (default: 1.0)
@return The array that was passed as parameter id
method decrement(id, by_value)
Namespace types: int
Parameters:
id (int ) : The array to increment (and return again)
by_value (int) : The value by which to increment (default: 1)
@return The array that was passed as parameter id
method decrement(id, by_value)
Namespace types: float
Parameters:
id (float ) : The array to increment (and return again)
by_value (float) : The value by which to increment (default: 1.0)
@return The array that was passed as parameter id
method toint(id)
Namespace types: string
Parameters:
id (string ) : The array to convert
method toint(id)
Namespace types: float
Parameters:
id (float ) : The array to convert
method tofloat(id)
Namespace types: string
Parameters:
id (string ) : The array to convert
method tofloat(id)
Namespace types: int
Parameters:
id (int ) : The array to convert
method tostring(id)
Namespace types: int
Parameters:
id (int ) : The array to convert
method tostring(id)
Namespace types: float
Parameters:
id (float ) : The array to convert
method tobool(id)
Namespace types: float
Parameters:
id (float ) : The array to convert
method tobool(id)
Namespace types: int
Parameters:
id (int ) : The array to convert
method tobool(id)
Namespace types: string
Parameters:
id (string ) : The array to convert
method sum(id)
Namespace types: bool
Parameters:
id (bool ) : The array to convert
method enqueue(id, item, max, condition, lifo)
Namespace types: int
Parameters:
id (int ) : The array that is used as queue
item (int) : The item to enqueue (at pos 0, unless lifo = true)
max (int) : The max size of the queue
condition (bool) : An optional flag that allows disabling the adding, which in turn will prevent for in loops from ever running and save performance where not needed
lifo (bool) : An optional flag that allows to change the behavior from First In Last Out (default and consistent with pine scripts history operator with most recent elements at index 0) to a more common and resource efficient approach in programming languages: Last In First Out
Returns: The queue passed as param id
method enqueue(id, item, max, condition, lifo)
Namespace types: float
Parameters:
id (float ) : The array that is used as queue
item (float) : The item to enqueue (at pos 0, unless lifo = true)
max (int) : The max size of the queue
condition (bool) : An optional flag that allows disabling the adding, which in turn will prevent for in loops from ever running and save performance where not needed
lifo (bool) : An optional flag that allows to change the behavior from First In Last Out (default and consistent with pine scripts history operator with most recent elements at index 0) to a more common and resource efficient approach in programming languages: Last In First Out
Returns: The queue passed as param id
method enqueue(id, item, max, condition, lifo)
Namespace types: string
Parameters:
id (string ) : The array that is used as queue
item (string) : The item to enqueue (at pos 0, unless lifo = true)
max (int) : The max size of the queue
condition (bool) : An optional flag that allows disabling the adding, which in turn will prevent for in loops from ever running and save performance where not needed
lifo (bool) : An optional flag that allows to change the behavior from First In Last Out (default and consistent with pine scripts history operator with most recent elements at index 0) to a more common and resource efficient approach in programming languages: Last In First Out
Returns: The queue passed as param id
method enqueue(id, item, max, condition, lifo)
Namespace types: line
Parameters:
id (line ) : The array that is used as queue
item (line) : The item to enqueue (at pos 0, unless lifo = true)
max (int) : The max size of the queue
condition (bool) : An optional flag that allows disabling the adding, which in turn will prevent for in loops from ever running and save performance where not needed
lifo (bool) : An optional flag that allows to change the behavior from First In Last Out (default and consistent with pine scripts history operator with most recent elements at index 0) to a more common and resource efficient approach in programming languages: Last In First Out
Returns: The queue passed as param id
method enqueue(id, item, max, condition, lifo)
Namespace types: box
Parameters:
id (box ) : The array that is used as queue
item (box) : The item to enqueue (at pos 0, unless lifo = true)
max (int) : The max size of the queue
condition (bool) : An optional flag that allows disabling the adding, which in turn will prevent for in loops from ever running and save performance where not needed
lifo (bool) : An optional flag that allows to change the behavior from First In Last Out (default and consistent with pine scripts history operator with most recent elements at index 0) to a more common and resource efficient approach in programming languages: Last In First Out
Returns: The queue passed as param id