Library "Pivot" This library helps you store and manage pivots.
bias(isHigh, isHigher, prevWasHigher) Helper function to calculate bias. Parameters: isHigh (bool): (bool) Wether the pivot is a pivot high or not. isHigher (bool): (bool) Wether the pivot is a higher pivot or not. return (bool) The bias (true = bullish, false = bearish, na = neutral). prevWasHigher (bool)
Settings All settings for the pivot. Fields: theme (Theme)
發行說明
v2 | Added a new biasToColor function that sets returns colors based of given attributes. And added a new biasToColor wrapper function for Theme.
Updated: biasToColor(bias, theme) Helper function that converts bias to color from theme. Parameters: bias (bool): (bool) The bias. neutral (color): (bool) The neutral color. bullish (color): (bool) The bullish color. bearish (color): (bool) The bearish color.
發行說明
v3 | Fixed bug where we would check for wrong conditions to update existing pivot or create a new one.
Updated: method updateLast(this, y, isHigh, settings) Namespace types: Pivot[] Parameters: this (Pivot[]) y (float) isHigh (bool) settings (Settings)
發行說明
v4: Fixes custom theme input not being respected for tooltip display and colored pivot text.
Added: method generateName(this, abbr) Generates a name string for the this pivot. Namespace types: Pivot Parameters: this (Pivot): (Pivot) The Pivot. abbr (bool): (bool) Wether to create abbreviation. (optional, default is false) return (string) The name string.
method calculateBias(this, prevWasHigher) Calculates bias for this Pivot. Namespace types: Pivot Parameters: this (Pivot): (Pivot) The Pivot. prevWasHigher (bool): (bool) Wether the previous pivot is a higher pivot or not. return (bool) The bias (true = bullish, false = bearish, na = neutral).
newPivot(x, y, isHigh, isHigher, settings) Parameters: x (int) y (float) isHigh (bool) isHigher (bool) settings (Settings)
Updated: biasToString(bias) Helper function that converts bias to string. Parameters: bias (bool): (bool) The bias. return (string) The bias string.
method biasToColor(this, theme) Helper function that converts bias to color. Namespace types: Pivot Parameters: this (Pivot) theme (Theme): (theme) The theme. return (color) The color that belongs to the bias derived from the Theme.