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.
There is a small problem with the "tooltipname" Because its 1 "tab" more then the others. "value and bias"
"import niquedegraaff/Tooltip/3"
thank you.
niquedegraaff
⋅
@Mupsje, I know. As I remember, I tried to rewrite the Absolute ZigZag Library because I wanted to split the objects (Pivots, Lines, and so on). But I really think you are looking for that library instead of this one because that one is just complete :) Click on the chart below, it will take you to that lib. tradingview.com/script/lRY74dha-Absolute-ZigZag-Lib/
Mupsje
⋅
@niquedegraaff, thanks , I saw it indeed. thanks for taking your time. have a Question about the other one, I shall place it there ;)
I like your style en coding, I'm busy to make a indicator from this library.
I have one Q.
when I maka a custom theme like this.
``` Pivots.Theme customTheme = Pivots.Theme.new( size=size.normal, colorDefault=input.color(#A2A2A2FF, "Default Color"), colorNeutral=input.color(#A2A200FF, "Neutral Color"), colorBullish=input.color(#00A200FF, "Bullish Color"), colorBearish=input.color(#A20000FF, "Bearish Color"), colored= input.bool(true, "Color Pivots?"), showTooltips = input.bool(true, "Show Tooltips?"), showTooltipName = input.bool(true, "Show Name in Tooltip?"), showTooltipValue = input.bool(true, "Show Value in Tooltip?"), showTooltipBias = input.bool(true, "Show Bias in Tooltip?") )
Pivots.Settings settings = Pivots.Settings.new(customTheme) var array<Pivots.Pivot> pivots = Pivots.newArray() ```
why does the input vairables not their work , only the Show Name, Value and Bias work. The colored and showTooltips not.
can you advise please.
Regards Mupsje aka CasaTropical
niquedegraaff
⋅
@Mupsje, try version 4 (import niquedegraaff/Pivot/4) I updated the code. Thanks for notifying me. I copied the wrong private script to public version I guess :). It's fixed now.
By the way, you can use pine bbcode style tags to put code in comments. e.g. (pine)(/pine) but then replace with correct bbcode brackets. Have a nice day!
There is a small problem with the "tooltipname"
Because its 1 "tab" more then the others. "value and bias"
"import niquedegraaff/Tooltip/3"
thank you.