Library "lib_pivot"
Object oriented implementation of Pivot methods.
method tostring(this)
Converts HLData to a json string representation
Namespace types: HLData
Parameters:
this (HLData): HLData
Returns: string representation of Pivot
method tostring(this, date_format)
Namespace types: Pivot
Parameters:
this (Pivot)
date_format (simple string)
method tostring(this, date_format)
Namespace types: Pivot[]
Parameters:
this (Pivot[])
date_format (simple string)
method get_color(this, mode)
Namespace types: PivotColors
Parameters:
this (PivotColors)
mode (int)
method get_label_text(this)
Namespace types: Pivot
Parameters:
this (Pivot)
method direction(this)
Namespace types: Pivot
Parameters:
this (Pivot)
method same_direction_as(this, other)
Namespace types: Pivot
Parameters:
this (Pivot)
other (Pivot)
method exceeds(this, price)
Namespace types: Pivot
Parameters:
this (Pivot)
price (float)
method exceeds(this, other)
Namespace types: Pivot
Parameters:
this (Pivot)
other (Pivot)
method exceeded_by(this, price)
Namespace types: Pivot
Parameters:
this (Pivot)
price (float)
method exceeded_by(this, other)
Namespace types: Pivot
Parameters:
this (Pivot)
other (Pivot)
method retracement_ratio(this, lastPivot, sec_lastPivot)
Namespace types: Pivot
Parameters:
this (Pivot)
lastPivot (Pivot)
sec_lastPivot (Pivot)
ratio_target(sec_lastPivot, lastPivot, target_ratio)
Parameters:
sec_lastPivot (Pivot)
lastPivot (Pivot)
target_ratio (float)
method update(this, ref_highest, ref_lowest)
Namespace types: HLData
Parameters:
this (HLData)
ref_highest (float)
ref_lowest (float)
method update(this, bar_time, bar_idx, price, prev)
Namespace types: Pivot
Parameters:
this (Pivot)
bar_time (int)
bar_idx (int)
price (float)
prev (Pivot)
method create_next(this, bar_time, bar_idx, price)
Namespace types: Pivot
Parameters:
this (Pivot)
bar_time (int)
bar_idx (int)
price (float)
HLData
HLData wraps the data received from ta.highest, ta.highestbars, ta.lowest, ta.lowestbars, as well as the reference sources
Fields:
length (series int): lookback length for pivot points
highest_offset (series int): offset to highest value bar
lowest_offset (series int): offset to lowest value bar
highest (series float): highest value within lookback bars
lowest (series float): lowest value within lookback bars
new_highest (series bool): update() will set this true if the current candle forms a new highest high at the last (current) bar of set period (length)
new_lowest (series bool): update() will set this true if the current candle forms a new lowest low at the last (current) bar of set period (length)
new_highest_fractal (series bool): update() will set this true if the current candle forms a new fractal high at the center of set period (length)
new_lowest_fractal (series bool): update() will set this true if the current candle forms a new fractal low at the center of set period (length)
PivotColors
Pivot colors for different modes
Fields:
hh (series color): Color for Pivot mode 2 (HH)
lh (series color): Color for Pivot mode 1 (LH)
hl (series color): Color for Pivot mode -1 (HL)
ll (series color): Color for Pivot mode -2 (LL)
Pivot
Pivot additional pivot data around basic Point
Fields:
point (Point type from robbatt/lib_plot_objects/5)
mode (series int): can be -2/-1/1/2 for LL/HL/LH/HH
price_movement (series float): The price difference between this and the previous pivot point in the opposite direction
retracement_ratio (series float): The ratio between this price_movement and the previous
prev (Pivot)