libKageBotLibrary "libKageBot"
Library of function to generate command strings for bots FrostyBot and Zignally. This version ONLY WORKS WITH FROSTYBOT.
strSize(_sizePercent, _sizeCurrency)
Converts a float to a formated string suitable to position size in percentage or currency. At leaste one parameter must be given
Parameters:
_sizePercent : (float) Position size in percent value. Optional. Default = na. Mandatory if _sizeCurrency is not given.
_sizeCurrency : (float) Position size in currency value. Optional. Default = na. Mandatory if _sizePercent is not given.
Returns: (string) A formated string containing the position size
entry(_bot, _direction, _sizePercent, _sizeCurrency)
Generates a simple entry command string for a bot
Parameters:
_bot : (TradeBot) Previously instancied bot type variable
_direction : (string) Flag to opena long or a short position. Must be either DIRECTION_LONG or DIRECTION_SHORT constant
_sizePercent : (float) Position size in percent value. Optional. Default = na. Mandatory if _sizeCurrency is not given.
_sizeCurrency : (float) Position size in currency value. Optional. Default = na. Mandatory if _sizePercent is not given.
Returns: (string) A string of a simple open position command
exit(_bot, _sizePercent, _sizeCurrency, _reduce)
Generates a simple exit command string for a bot
Parameters:
_bot : (TradeBot) Previously instancied bot type variable
_sizePercent : (float) Position size in percent value. Optional. Default = na. Mandatory if _sizeCurrency is not given.
_sizeCurrency : (float) Position size in currency value. Optional. Default = na. Mandatory if _sizePercent is not given.
_reduce : (bool) Flag to use Ruce Only option on Binance positions. Optional. Default = true
Returns: (string) A string of a simple close position command
cancelAll(_bot)
Generates a command string for a bot that cancels all open orders
Parameters:
_bot : (TradeBot) Previously instancied bot type variable
Returns: (string) A string of a command to cancel all open orders
leverage(_bot, _leverage, _type)
Generates a command string for a bot to set leverage
Parameters:
_bot : (TradeBot) Previously instancied bot type variable
_leverage : (int) The amount of leverage to be used when opening a position. Optional. If does not given, the bot's default will be used
_type : (string) Type of leverage. Must be either LEVERAGE_CROSS or LEVERAGE_ISOLATED. Optional. Default is LEVERAGE_CROSS.
Returns: (string) A string of a simple leverage command
entryLong(_bot, _leverage, _leverageType, _sizePercent, _sizeCurrency)
Generates a complete long entry command string for a bot
Parameters:
_bot : (TradeBot) Previously instancied bot type variable
_leverage : (int) The amount of leverage to be used when opening a position. Optional. If does not given, the bot's default will be used
_leverageType : (string) Type of leverage. Must be either LEVERAGE_CROSS or LEVERAGE_ISOLATED. Optional. Default is LEVERAGE_CROSS.
_sizePercent : (float) Position size in percent value. Optional. Default = na. Mandatory if _sizeCurrency is not given.
_sizeCurrency : (float) Position size in currency value. Optional. Default = na. Mandatory if _sizePercent is not given.
Returns: (string) A string of a complete open long position command
entryShort(_bot, _leverage, _leverageType, _sizePercent, _sizeCurrency)
Generates a complete short entry command string for a bot
Parameters:
_bot : (TradeBot) Previously instancied bot type variable
_leverage : (int) The amount of leverage to be used when opening a position. Optional. If does not given, the bot's default will be used
_leverageType
_sizePercent : (float) Position size in percent value. Optional. Default = na. Mandatory if _sizeCurrency is not given.
_sizeCurrency : (float) Position size in currency value. Optional. Default = na. Mandatory if _sizePercent is not given.
Returns: (string) A string of a complete open short position command
exitPosition(_bot, _sizePercent, _sizeCurrency, _reduce)
Generates a complete close position command string for a bot
Parameters:
_bot : (TradeBot) Previously instancied bot type variable
_sizePercent : (float) Position size in percent value. Optional. Default = na. Mandatory if _sizeCurrency is not given.
_sizeCurrency : (float) Position size in currency value. Optional. Default = na. Mandatory if _sizePercent is not given.
_reduce : (bool) Flag to use Ruce Only option on Binance positions. Optional. Default = true
Returns: (string) A string of a comlete close position command
printBot(_bot, _command)
Print bot's information for debug purposes
Parameters:
_bot : (TradeBot) Previously instancied bot type variable
_command : (string) A command string to be debugged
Returns: Nothing.
Constants
Constants to be used in both in internal and external code
Fields:
SERVER_FROSTBOT : (string) Identifier to FrostyBot
SERVER_ZIGNALY : (string) Identifier to Zignaly
DIRECTION_LONG : (string) Flag to open a long position
DIRECTION_SHORT
LEVERAGE_CROSS : (string) Flag to set leverage to cross
LEVERAGE_ISOLATED : (string) Flag to set leverage to isolated
TradeBot
Bot type to handle its essential information
Fields:
server : (string) Type o server. Must me one of the SERVER_* constant values
id : (string) Id of the account in the server (Stub for FrostyBot or Key to Zignally)
symbol : (string) Symbol of the pair to be negotiated (example: ETH/USDT)
leverage : (int) Leverage coeficient. Default is 1
Indicators and strategies
arraymethodsLibrary "arraymethods"
Supplementary array methods.
delete(arr, index)
remove int object from array of integers at specific index
Parameters:
arr : int array
index : index at which int object need to be removed
Returns: void
delete(arr, index)
remove float object from array of float at specific index
Parameters:
arr : float array
index : index at which float object need to be removed
Returns: float
delete(arr, index)
remove bool object from array of bool at specific index
Parameters:
arr : bool array
index : index at which bool object need to be removed
Returns: bool
delete(arr, index)
remove string object from array of string at specific index
Parameters:
arr : string array
index : index at which string object need to be removed
Returns: string
delete(arr, index)
remove color object from array of color at specific index
Parameters:
arr : color array
index : index at which color object need to be removed
Returns: color
delete(arr, index)
remove line object from array of lines at specific index and deletes the line
Parameters:
arr : line array
index : index at which line object need to be removed and deleted
Returns: void
delete(arr, index)
remove label object from array of labels at specific index and deletes the label
Parameters:
arr : label array
index : index at which label object need to be removed and deleted
Returns: void
delete(arr, index)
remove box object from array of boxes at specific index and deletes the box
Parameters:
arr : box array
index : index at which box object need to be removed and deleted
Returns: void
delete(arr, index)
remove table object from array of tables at specific index and deletes the table
Parameters:
arr : table array
index : index at which table object need to be removed and deleted
Returns: void
delete(arr, index)
remove linefill object from array of linefills at specific index and deletes the linefill
Parameters:
arr : linefill array
index : index at which linefill object need to be removed and deleted
Returns: void
popr(arr)
remove last int object from array
Parameters:
arr : int array
Returns: int
popr(arr)
remove last float object from array
Parameters:
arr : float array
Returns: float
popr(arr)
remove last bool object from array
Parameters:
arr : bool array
Returns: bool
popr(arr)
remove last string object from array
Parameters:
arr : string array
Returns: string
popr(arr)
remove last color object from array
Parameters:
arr : color array
Returns: color
popr(arr)
remove and delete last line object from array
Parameters:
arr : line array
Returns: void
popr(arr)
remove and delete last label object from array
Parameters:
arr : label array
Returns: void
popr(arr)
remove and delete last box object from array
Parameters:
arr : box array
Returns: void
popr(arr)
remove and delete last table object from array
Parameters:
arr : table array
Returns: void
popr(arr)
remove and delete last linefill object from array
Parameters:
arr : linefill array
Returns: void
shiftr(arr)
remove first int object from array
Parameters:
arr : int array
Returns: int
shiftr(arr)
remove first float object from array
Parameters:
arr : float array
Returns: float
shiftr(arr)
remove first bool object from array
Parameters:
arr : bool array
Returns: bool
shiftr(arr)
remove first string object from array
Parameters:
arr : string array
Returns: string
shiftr(arr)
remove first color object from array
Parameters:
arr : color array
Returns: color
shiftr(arr)
remove and delete first line object from array
Parameters:
arr : line array
Returns: void
shiftr(arr)
remove and delete first label object from array
Parameters:
arr : label array
Returns: void
shiftr(arr)
remove and delete first box object from array
Parameters:
arr : box array
Returns: void
shiftr(arr)
remove and delete first table object from array
Parameters:
arr : table array
Returns: void
shiftr(arr)
remove and delete first linefill object from array
Parameters:
arr : linefill array
Returns: void
push(arr, val, maxItems)
add int to the end of an array with max items cap. Objects are removed from start to maintain max items cap
Parameters:
arr : int array
val : int object to be pushed
maxItems : max number of items array can hold
Returns: int
push(arr, val, maxItems)
add float to the end of an array with max items cap. Objects are removed from start to maintain max items cap
Parameters:
arr : float array
val : float object to be pushed
maxItems : max number of items array can hold
Returns: float
push(arr, val, maxItems)
add bool to the end of an array with max items cap. Objects are removed from start to maintain max items cap
Parameters:
arr : bool array
val : bool object to be pushed
maxItems : max number of items array can hold
Returns: bool
push(arr, val, maxItems)
add string to the end of an array with max items cap. Objects are removed from start to maintain max items cap
Parameters:
arr : string array
val : string object to be pushed
maxItems : max number of items array can hold
Returns: string
push(arr, val, maxItems)
add color to the end of an array with max items cap. Objects are removed from start to maintain max items cap
Parameters:
arr : color array
val : color object to be pushed
maxItems : max number of items array can hold
Returns: color
push(arr, val, maxItems)
add line to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
Parameters:
arr : line array
val : line object to be pushed
maxItems : max number of items array can hold
Returns: line
push(arr, val, maxItems)
add label to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
Parameters:
arr : label array
val : label object to be pushed
maxItems : max number of items array can hold
Returns: label
push(arr, val, maxItems)
add box to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
Parameters:
arr : box array
val : box object to be pushed
maxItems : max number of items array can hold
Returns: box
push(arr, val, maxItems)
add table to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
Parameters:
arr : table array
val : table object to be pushed
maxItems : max number of items array can hold
Returns: table
push(arr, val, maxItems)
add linefill to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
Parameters:
arr : linefill array
val : linefill object to be pushed
maxItems : max number of items array can hold
Returns: linefill
unshift(arr, val, maxItems)
add int to the beginning of an array with max items cap. Objects are removed from end to maintain max items cap
Parameters:
arr : int array
val : int object to be unshift
maxItems : max number of items array can hold
Returns: int
unshift(arr, val, maxItems)
add float to the beginning of an array with max items cap. Objects are removed from end to maintain max items cap
Parameters:
arr : float array
val : float object to be unshift
maxItems : max number of items array can hold
Returns: float
unshift(arr, val, maxItems)
add bool to the beginning of an array with max items cap. Objects are removed from end to maintain max items cap
Parameters:
arr : bool array
val : bool object to be unshift
maxItems : max number of items array can hold
Returns: bool
unshift(arr, val, maxItems)
add string to the beginning of an array with max items cap. Objects are removed from end to maintain max items cap
Parameters:
arr : string array
val : string object to be unshift
maxItems : max number of items array can hold
Returns: string
unshift(arr, val, maxItems)
add color to the beginning of an array with max items cap. Objects are removed from end to maintain max items cap
Parameters:
arr : color array
val : color object to be unshift
maxItems : max number of items array can hold
Returns: color
unshift(arr, val, maxItems)
add line to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
Parameters:
arr : line array
val : line object to be unshift
maxItems : max number of items array can hold
Returns: line
unshift(arr, val, maxItems)
add label to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
Parameters:
arr : label array
val : label object to be unshift
maxItems : max number of items array can hold
Returns: label
unshift(arr, val, maxItems)
add box to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
Parameters:
arr : box array
val : box object to be unshift
maxItems : max number of items array can hold
Returns: box
unshift(arr, val, maxItems)
add table to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
Parameters:
arr : table array
val : table object to be unshift
maxItems : max number of items array can hold
Returns: table
unshift(arr, val, maxItems)
add linefill to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
Parameters:
arr : linefill array
val : linefill object to be unshift
maxItems : max number of items array can hold
Returns: linefill
flush(arr)
remove all int objects in an array
Parameters:
arr : int array
Returns: int
flush(arr)
remove all float objects in an array
Parameters:
arr : float array
Returns: float
flush(arr)
remove all bool objects in an array
Parameters:
arr : bool array
Returns: bool
flush(arr)
remove all string objects in an array
Parameters:
arr : string array
Returns: string
flush(arr)
remove all color objects in an array
Parameters:
arr : color array
Returns: color
flush(arr)
remove and delete all line objects in an array
Parameters:
arr : line array
Returns: line
flush(arr)
remove and delete all label objects in an array
Parameters:
arr : label array
Returns: label
flush(arr)
remove and delete all box objects in an array
Parameters:
arr : box array
Returns: box
flush(arr)
remove and delete all table objects in an array
Parameters:
arr : table array
Returns: table
flush(arr)
remove and delete all linefill objects in an array
Parameters:
arr : linefill array
Returns: linefill
OfekIndicatorsLibLibrary "OfekIndicatorsLib"
TODO: add library description here
ichiClouds(conversionPeriods, basePeriods, laggingSpan2Periods)
Parameters:
conversionPeriods
basePeriods
laggingSpan2Periods
trama(tramaSrc, tramaLength)
Parameters:
tramaSrc
tramaLength
kdj(ilong, isig, startFrom)
Parameters:
ilong
isig
startFrom(look into history)
Linear_Regression_SlopeLibrary "Linear_Regression_Slope"
linreg_slope(a, b)
Parameters:
a
b
This library is available to anyone.
This library calculates the linear regression slope.
Be sure to use the source value for a.
(End price, high price, low price, market price)
Please set a period for b.
Overlay is set to false.
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.
UnispacesLibrary "Unispaces"
Easier than looking up unicode spaces
spaces(sequence, string1, string2)
UNISPACES
Parameters:
sequence : (int) required | 123 = 3 spaces / 3 different sizes (one space per number can find spaces in hover over)
string1 : (str) optional | default = ""
string2 : (str) optional | default = ""
Returns: `string - concatenated string surrounding unispaces`
space(space, string1, string2)
UNISPACE
Parameters:
space : (int) optional | default = 0 | 0-15 (can find spaces in hover over)
string1 : (str) optional | default = ""
string2 : (str) optional | default = ""
Returns: `string - concatenated string surrounding a unispace `
Markdown: The Pine Editor's Hidden Gem💬 Markdown, a markup language
Markdown is a portable, lightweight markup language that can be used for everything whether you're building a website, documentation, or even presentations.
Platforms like Discord, Reddit, and GitHub support Markdown and is the widely go-to option for text formatting due to its simplicity. Pine Script is a language that also utilizes Markdown, specifically in the Pine Editor where it can really be used to some extent.
Since the release of libraries, user-defined types, and methods, Pine Script is entering an age where developers will be highly dependent on libraries due to the capabilities Pine has inherited recently. It would be no surprise if a few people got together and took their time to thoroughly develop an entire project/library centered around improving Pine Script's built-in functions and providing developers with easier ways of achieving things than they thought they could.
As you're all aware, hovering over functions (and more) in the editor pops up a prompt that specifies the parameters, types, and what the function returns. Pine Script uses Markdown for that, so I figured we could go ahead and push that feature to its limits and see what we can do.
Today we'll go over how we can utilize Markdown in Pine Script, and how you can make your library's built-in functions stand out more than they did previously.
For more information, visit www.markdownguide.org
📕 General Notes
Markdown syntax only works on functions and methods.
Using arrays as parameters as of 2/21/2023 breaks the Markdown system.
The prompt window holds a max of 166 characters on one line before overflowing.
There is no limit on how long the prompt window can be.
🔽 Getting Started 🔽
▶️ Headings
If you have experience in HTML, Markdown, or even Microsoft Word then you already have a grasp of how headings work and look.
To simplify it, headings make the given text either massive or tiny depending on how many number symbols are provided.
When defining headings, you must have a space between the number (#) symbol, and the text. This is typical syntax throughout the language.
Pine Script uses bold text by applying (**) for their titles on their built-ins (e.g. @returns) but you could also use heading level 4 (####) and have it look the same.
▶️ Paragraphs & Line Breaks
You may want to provide extensive details and examples relating to one function, in this case, you could create line breaks. Creating line breaks skips to the next line so you can keep things organized as a result.
To achieve a valid line break and create a new paragraph, you must end the line with two or more spaces.
If you want to have an empty line in between, apply a backslash (\).
Backslashes (\) are generally not recommended for every line break. In this case, I only recommend using them for empty lines.
▶️ Text Formatting
Markdown provides text formatting such as bold, italics, and strikethrough.
For bolding text, you can apply open and close (**) or (__).
For italicizing text, you can apply open and close (*) or (_).
For bolding and italicizing text, you can apply open and close (***) or (___).
For s̶t̶r̶i̶k̶e̶t̶h̶r̶o̶u̶g̶h̶, you need to apply open and close (~~).
This was mentioned in the Headers section, but Pine Script's main titles (e.g. @returns or @syntax) use bold (**) by default.
▶️ Blockquotes
Blockquotes in Pine Script can be visualized as a built-in indentation system.
They are declared using greater than (>) and everything will be auto-aligned and indented until closed.
By convention you generally want to include the greater than (>) on every line that's included in the block quote. Even when not needed.
If you would like to indent even more (nested blockquotes), you can apply multiple greater than symbols (>). For example, (>>)
Blockquotes can be closed by ending the next line with only one greater than (>) symbol, or by using a horizontal rule.
▶️ Horizontal Rules
Horizontal rules in Pine Script are what you see at the very top of the prompt in built-ins.
When hovering, you can see the top of the prompt provides a line, and we can actually reproduce these lines.
These are extremely useful for separating information into their own parts and are accessed by applying 3 underscores (___), or 3 asterisks (***).
Horizontal rules were mentioned above, when we were discussing block quotes. These can also be used to close blockquotes as well.
Horizontal rules require a minimum of 3 underscores (___) or 3 asterisks (***).
▶️ Lists
Lists give us a way to structure data in a somewhat neat way. There are multiple ways to start a list, such as
1. First Item (number followed by a period)
- First Item (dash)
+ First Item (plus sign)
* First Item (asterisk)
Using number-based lists provide an ordered list, whereas using (-), (+), or (*) will provide an unordered list (bullet points).
If you want to begin an unordered list with a number that ends with a period, you must use an escape sequence (\) after the number.
Standard indentation (tab-width) list detection isn't supported, so to nest lists you have to use blockquotes (>) which may not look as appealing.
▶️ Code Blocks
Using code blocks allows you to write actual Pine Script code inside the prompt.
It's a game changer that can potentially help people understand how to execute functions quickly.
To use code blocks, apply three 3 open and close backquotes (```). Built-in's use (```pine) but there's no difference when we apply it.
Considering that tab-width indentation isn't detected properly, we can make use of the blockquotes mentioned above.
▶️ Denotation
Denoting can also be seen as highlighting a background layer behind text. They're basically code blocks, but without the "block".
Similar to how code blocks work, we apply one backquote open and close (`).
Make sure to only use this on important keywords. There really isn't a conventional way of applying this.
It's up to you to decide what people should have their eyes tracked onto when they hover over your functions.
If needed, look at how Pine Script's built-in variables and functions utilize this.
▶️ Tables
Tables are possible in Markdown, although they may look a bit different in the Pine Editor.
They are made by separating text with vertical bars (|).
The headers are detected when there is a minimum of one hyphen (-) below them.
You can align text by using a colon as I do in the photo. Hyphens must be connected to the colon in order to display correctly.
Tables aren't ideal to use in the editor but are there if anyone wants to give it a go.
▶️ Links & Images
Markdown supports images and hyperlinks, which means we can also do that here in the Pine Editor. Cool right?
If you want to create a hyperlink, surround the displayed text in open and close brackets .
If you want to load a photo into your prompt, it's the same syntax as the hyperlink, except it uses a (!)
See syntax list below.
Here are realistic usage examples. (Snippets from code below)
These follow the same syntax as the built-ins.
I'm not using horizontal rules here, but it's entirely up to you.
▶️ Syntax List
Headings
Level 1: #
Level 2: ##
Level 3: ###
Level 4: ####
Level 5: #####
Level 6: ######
Line Breaks
Text (two spaces)
Text\ (backslash)
Text Formatting
Bold (**)
Italic (**)
Strikethrough (~~)
Blockquotes
Indent (>)
Double Indent (>>)
Triple Indent (>>>) and so on.
Horizontal Rules
(___) or (***)
Lists
Ordered List (1.)
Unordered List (-) or (+) or (*)
Code Blocks
(```) or (```pine)
Denotation
(`)
Tables
(|) and (-) and (:)
Hyperlinks
(URL)
Images
! (URL)
Hope this helps. 👍
ulibLibrary "ulib"
Stochastic(length, d_smooth)
Parameters:
length
d_smooth
bull_stoch_condition(k, d)
Parameters:
k
d
ema_condition(ema_1, ema_2, ema_3)
Parameters:
ema_1
ema_2
ema_3
bull_fractal_condition(n)
Parameters:
n
Bull(Fractal, ema, stochastic_osc)
Parameters:
Fractal
ema
stochastic_osc
Vector2ArrayLibrary "Vector2Array"
functions to handle vector2 Array operations.
.
references:
docs.unity3d.com
gist.github.com
github.com
gist.github.com
gist.github.com
gist.github.com
.
from(source, prop_sep, vect_sep)
Generate array of vector2 from string.
Parameters:
source : string Source string of the vectors.
prop_sep : string Separator character of the vector properties (x`,`y).
vect_sep : string Separator character of the vectors ((x,y)`;`(x,y)).
Returns: array.
max(vectors)
Combination of the highest elements in column of a array of vectors.
Parameters:
vectors : array, Array of Vector2 objects.
Returns: Vector2.Vector2, Vector2 object.
-> usage:
`a = Vector2.from(1.0) , b = Vector2.from(2.0), c = Vector2.from(3.0), d = max(array.from(a, b, c)) , plot(d.x)`
min(vectors)
Combination of the lowest elements in column of a array of vectors.
Parameters:
vectors : array, Array of Vector2 objects.
Returns: Vector2.Vector2, Vector2 object.
-> usage:
`a = Vector2.from(1.0) , b = Vector2.from(2.0), c = Vector2.from(3.0), d = min(array.from(a, b, c)) , plot(d.x)`
sum(vectors)
Total sum of all vectors.
Parameters:
vectors : array, ID of the vector2 array.
Returns: Vector2.Vector2, vector2 object.
-> usage:
`a = Vector2.from(1.0) , b = Vector2.from(2.0), c = Vector2.from(3.0), d = sum(array.from(a, b, c)) , plot(d.x)`
center(vectors)
Finds the vector center of the array.
Parameters:
vectors : array, ID of the vector2 array.
Returns: Vector2.Vector2, vector2 object.
-> usage:
`a = Vector2.from(1.0) , b = Vector2.from(2.0), c = Vector2.from(3.0), d = center(array.from(a, b, c)) , plot(d.x)`
rotate(vectors, center, degree)
Rotate Array vectors around origin vector by a angle.
Parameters:
vectors : array, ID of the vector2 array.
center : Vector2.Vector2 , Vector2 object. Center of the rotation.
degree : float , Angle value.
Returns: rotated points array.
-> usage:
`a = Vector2.from(1.0) , b = Vector2.from(2.0), c = Vector2.from(3.0), d = rotate(array.from(a, b, c), b, 45.0)`
scale(vectors, center, rate)
Scale Array vectors based on a origin vector perspective.
Parameters:
vectors : array, ID of the vector2 array.
center : Vector2.Vector2 , Vector2 object. Origin center of the transformation.
rate : float , Rate to apply transformation.
Returns: rotated points array.
-> usage:
`a = Vector2.from(1.0) , b = Vector2.from(2.0), c = Vector2.from(3.0), d = scale(array.from(a, b, c), b, 1.25)`
move(vectors, center, rate)
Move Array vectors by a rate of the distance to center position (LERP).
Parameters:
vectors : array, ID of the vector2 array.
center
rate
Returns: Moved points array.
-> usage:
`a = Vector2.from(1.0) , b = Vector2.from(2.0), c = Vector2.from(3.0), d = move(array.from(a, b, c), b, 1.25)`
to_string(id, separator)
Reads a array of vectors into a string, of the form ` `.
Parameters:
id : array, ID of the vector2 array.
separator : string separator for cell splitting.
Returns: string Translated complex array into string.
-> usage:
`a = Vector2.from(1.0) , b = Vector2.from(2.0), c = Vector2.from(3.0), d = to_string(array.from(a, b, c))`
to_string(id, format, separator)
Reads a array of vectors into a string, of the form ` `.
Parameters:
id : array, ID of the vector2 array.
format : string , Format to apply transformation.
separator : string , Separator for cell splitting.
Returns: string Translated complex array into string.
-> usage:
`a = Vector2.from(1.234) , b = Vector2.from(2.23), c = Vector2.from(3.1234), d = to_string(array.from(a, b, c), "#.##")`
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.
PineTradingbotWebhookLibrary "PineTradingbotWebhook"
makeWebhookJson(webhookKey, direction, qty, entryLimit, entryStop, exitLimit, exitStop, orderRef, contract)
Creates a Webhook message for Tbot on Tradingboat
Parameters:
webhookKey : the unique key to the Flask (TVWB) server
direction : the same as the strategy's direction
qty
entryLimit
entryStop
exitLimit
exitStop
orderRef
contract
Returns: JSON as a string
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.
MathComplexNumbersThis is a Pine Script library for handling complex numbers without arrays. It contains several utility functions for performing various operations on complex numbers, including converting complex numbers into tuples, getting the real and imaginary parts of a complex number, adding and subtracting complex numbers, computing the conjugate, multiplying and dividing complex numbers, computing the reciprocal, the inverse, the negative, the exponential, the ceil and the radius of a complex number.
The library exports a complex data type which consists of two float values: re, the real part of the complex number, and im, the imaginary part of the complex number.
The complex_tuple function and ct function convert a complex number into a tuple, and the get_real, get_imaginary, re, and im functions return the real and imaginary parts of a complex number.
The add and subtract functions add and subtract two complex numbers, respectively, by performing the appropriate arithmetic operations on their real and imaginary parts. The conjugate function returns the complex conjugate of a given complex number, which is the same as the original number but with the sign of its imaginary part reversed. The multiply and divide functions multiply and divide two complex numbers, respectively, according to the rules of complex arithmetic. The reciprocal function computes the reciprocal or inverse of a given complex number, while the inverse function computes the inverse of a given complex number. The negative function returns the negative of a given complex number, and the exponential function computes the exponential of a given complex number. The ceil function rounds a given complex number up to a specified number of digits. The radius function computes the radius (magnitude) of a given complex number, which is defined as its distance from the origin (0,0) of the complex plane.
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.
time_filtersLibrary "time_filters"
Collection of filters that related with time like sessions and datetime ranges.
All existing session functions I found in the documentation e.g. not na(time(timeframe.period, sessionTimes))
are not suitable for strategies, since the execution of the entries and the exits are delayed by one bar.
Thus I created this library to overcome this small but very important limitation.
is_in_date_range(fromDate, toDate, srcTimezone, dstTimezone, t)
is_in_date_range - Check if the given time is between the start and end dates
Parameters:
fromDate : - The start date in UNIX time of the valid range
toDate : - The end date in UNIX time of the valid range
srcTimezone : - The timezone of reference for the 'from' and 'to' dates
dstTimezone : - The target timezone to convert the 'from' and 'to' dates
t : - The time to compare in UNIX format
Returns: series of bool whether or not the time is inside the valid range
is_in_session(startTime, endTime, days, srcTimezone, dstTimezone, t)
is_in_session - Check if the given time is inside the session as defined by the input params
Parameters:
startTime : - The sessionTime object with the use flag and the start time
endTime : - The sessionTime object with the use flag and the end time
days : - The sessionDays object with the use flag and marks for each day of the session
srcTimezone : - The timezone of reference for the time ranges
dstTimezone : - The target timezone to convert the time ranges
t : - The current time to compare in UNIX format.
Returns: series of bool whether or not the time is inside the session
sessionTime
Fields:
hourInDay
minuteInHour
sessionDays
Fields:
mon
tue
wed
thu
fri
sat
sun
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.
Vector2Library "Vector2"
Representation of two dimensional vectors or points.
This structure is used to represent positions in two dimensional space or vectors,
for example in spacial coordinates in 2D space.
~~~
references:
docs.unity3d.com
gist.github.com
github.com
gist.github.com
gist.github.com
gist.github.com
~~~
new(x, y)
Create a new Vector2 object.
Parameters:
x : float . The x value of the vector, default=0.
y : float . The y value of the vector, default=0.
Returns: Vector2. Vector2 object.
-> usage:
`unitx = Vector2.new(1.0) , plot(unitx.x)`
from(value)
Assigns value to a new vector `x,y` elements.
Parameters:
value : float, x and y value of the vector.
Returns: Vector2. Vector2 object.
-> usage:
`one = Vector2.from(1.0), plot(one.x)`
from(value, element_sep, open_par, close_par)
Assigns value to a new vector `x,y` elements.
Parameters:
value : string . The `x` and `y` value of the vector in a `x,y` or `(x,y)` format, spaces and parentesis will be removed automatically.
element_sep : string . Element separator character, default=`,`.
open_par : string . Open parentesis character, default=`(`.
close_par : string . Close parentesis character, default=`)`.
Returns: Vector2. Vector2 object.
-> usage:
`one = Vector2.from("1.0,2"), plot(one.x)`
copy(this)
Creates a deep copy of a vector.
Parameters:
this : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = Vector2.new(1.0) , b = a.copy() , plot(b.x)`
down()
Vector in the form `(0, -1)`.
Returns: Vector2. Vector2 object.
left()
Vector in the form `(-1, 0)`.
Returns: Vector2. Vector2 object.
right()
Vector in the form `(1, 0)`.
Returns: Vector2. Vector2 object.
up()
Vector in the form `(0, 1)`.
Returns: Vector2. Vector2 object.
one()
Vector in the form `(1, 1)`.
Returns: Vector2. Vector2 object.
zero()
Vector in the form `(0, 0)`.
Returns: Vector2. Vector2 object.
minus_one()
Vector in the form `(-1, -1)`.
Returns: Vector2. Vector2 object.
unit_x()
Vector in the form `(1, 0)`.
Returns: Vector2. Vector2 object.
unit_y()
Vector in the form `(0, 1)`.
Returns: Vector2. Vector2 object.
nan()
Vector in the form `(float(na), float(na))`.
Returns: Vector2. Vector2 object.
xy(this)
Return the values of `x` and `y` as a tuple.
Parameters:
this : Vector2 . Vector2 object.
Returns: .
-> usage:
`a = Vector2.new(1.0, 1.0) , = a.xy() , plot(ax)`
length_squared(this)
Length of vector `a` in the form. `a.x^2 + a.y^2`, for comparing vectors this is computationaly lighter.
Parameters:
this : Vector2 . Vector2 object.
Returns: float. Squared length of vector.
-> usage:
`a = Vector2.new(1.0, 1.0) , plot(a.length_squared())`
length(this)
Magnitude of vector `a` in the form. `sqrt(a.x^2 + a.y^2)`
Parameters:
this : Vector2 . Vector2 object.
Returns: float. Length of vector.
-> usage:
`a = Vector2.new(1.0, 1.0) , plot(a.length())`
normalize(a)
Vector normalized with a magnitude of 1, in the form. `a / length(a)`.
Parameters:
a : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = normalize(Vector2.new(3.0, 2.0)) , plot(a.y)`
isNA(this)
Checks if any of the components is `na`.
Parameters:
this : Vector2 . Vector2 object.
Returns: bool.
usage:
p = Vector2.new(1.0, na) , plot(isNA(p)?1:0)
add(a, b)
Adds vector `b` to `a`, in the form `(a.x + b.x, a.y + b.y)`.
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = one() , b = one() , c = add(a, b) , plot(c.x)`
add(a, b)
Adds vector `b` to `a`, in the form `(a.x + b, a.y + b)`.
Parameters:
a : Vector2 . Vector2 object.
b : float . Value.
Returns: Vector2. Vector2 object.
-> usage:
`a = one() , b = 1.0 , c = add(a, b) , plot(c.x)`
add(a, b)
Adds vector `b` to `a`, in the form `(a + b.x, a + b.y)`.
Parameters:
a : float . Value.
b : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = 1.0 , b = one() , c = add(a, b) , plot(c.x)`
subtract(a, b)
Subtract vector `b` from `a`, in the form `(a.x - b.x, a.y - b.y)`.
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = one() , b = one() , c = subtract(a, b) , plot(c.x)`
subtract(a, b)
Subtract vector `b` from `a`, in the form `(a.x - b, a.y - b)`.
Parameters:
a : Vector2 . vector2 object.
b : float . Value.
Returns: Vector2. Vector2 object.
-> usage:
`a = one() , b = 1.0 , c = subtract(a, b) , plot(c.x)`
subtract(a, b)
Subtract vector `b` from `a`, in the form `(a - b.x, a - b.y)`.
Parameters:
a : float . value.
b : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = 1.0 , b = one() , c = subtract(a, b) , plot(c.x)`
multiply(a, b)
Multiply vector `a` with `b`, in the form `(a.x * b.x, a.y * b.y)`.
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = one() , b = one() , c = multiply(a, b) , plot(c.x)`
multiply(a, b)
Multiply vector `a` with `b`, in the form `(a.x * b, a.y * b)`.
Parameters:
a : Vector2 . Vector2 object.
b : float . Value.
Returns: Vector2. Vector2 object.
-> usage:
`a = one() , b = 1.0 , c = multiply(a, b) , plot(c.x)`
multiply(a, b)
Multiply vector `a` with `b`, in the form `(a * b.x, a * b.y)`.
Parameters:
a : float . Value.
b : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = 1.0 , b = one() , c = multiply(a, b) , plot(c.x)`
divide(a, b)
Divide vector `a` with `b`, in the form `(a.x / b.x, a.y / b.y)`.
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = from(3.0) , b = from(2.0) , c = divide(a, b) , plot(c.x)`
divide(a, b)
Divide vector `a` with value `b`, in the form `(a.x / b, a.y / b)`.
Parameters:
a : Vector2 . Vector2 object.
b : float . Value.
Returns: Vector2. Vector2 object.
-> usage:
`a = from(3.0) , b = 2.0 , c = divide(a, b) , plot(c.x)`
divide(a, b)
Divide value `a` with vector `b`, in the form `(a / b.x, a / b.y)`.
Parameters:
a : float . Value.
b : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = 3.0 , b = from(2.0) , c = divide(a, b) , plot(c.x)`
negate(a)
Negative of vector `a`, in the form `(-a.x, -a.y)`.
Parameters:
a : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = from(3.0) , b = a.negate , plot(b.x)`
pow(a, b)
Raise vector `a` with exponent vector `b`, in the form `(a.x ^ b.x, a.y ^ b.y)`.
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = from(3.0) , b = from(2.0) , c = pow(a, b) , plot(c.x)`
pow(a, b)
Raise vector `a` with value `b`, in the form `(a.x ^ b, a.y ^ b)`.
Parameters:
a : Vector2 . Vector2 object.
b : float . Value.
Returns: Vector2. Vector2 object.
-> usage:
`a = from(3.0) , b = 2.0 , c = pow(a, b) , plot(c.x)`
pow(a, b)
Raise value `a` with vector `b`, in the form `(a ^ b.x, a ^ b.y)`.
Parameters:
a : float . Value.
b : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = 3.0 , b = from(2.0) , c = pow(a, b) , plot(c.x)`
sqrt(a)
Square root of the elements in a vector.
Parameters:
a : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = from(3.0) , b = sqrt(a) , plot(b.x)`
abs(a)
Absolute properties of the vector.
Parameters:
a : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = from(-3.0) , b = abs(a) , plot(b.x)`
min(a)
Lowest element of a vector.
Parameters:
a : Vector2 . Vector2 object.
Returns: float.
-> usage:
`a = new(3.0, 1.5) , b = min(a) , plot(b)`
max(a)
Highest element of a vector.
Parameters:
a : Vector2 . Vector2 object.
Returns: float.
-> usage:
`a = new(3.0, 1.5) , b = max(a) , plot(b)`
vmax(a, b)
Highest elements of two vectors.
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 2.0) , b = new(2.0, 3.0) , c = vmax(a, b) , plot(c.x)`
vmax(a, b, c)
Highest elements of three vectors.
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
c : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 2.0) , b = new(2.0, 3.0) , c = new(1.5, 4.5) , d = vmax(a, b, c) , plot(d.x)`
vmin(a, b)
Lowest elements of two vectors.
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 2.0) , b = new(2.0, 3.0) , c = vmin(a, b) , plot(c.x)`
vmin(a, b, c)
Lowest elements of three vectors.
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
c : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 2.0) , b = new(2.0, 3.0) , c = new(1.5, 4.5) , d = vmin(a, b, c) , plot(d.x)`
perp(a)
Perpendicular Vector of `a`, in the form `(a.y, -a.x)`.
Parameters:
a : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = perp(a) , plot(b.x)`
floor(a)
Compute the floor of vector `a`.
Parameters:
a : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = floor(a) , plot(b.x)`
ceil(a)
Ceils vector `a`.
Parameters:
a : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = ceil(a) , plot(b.x)`
ceil(a, digits)
Ceils vector `a`.
Parameters:
a : Vector2 . Vector2 object.
digits : int . Digits to use as ceiling.
Returns: Vector2. Vector2 object.
round(a)
Round of vector elements.
Parameters:
a : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = round(a) , plot(b.x)`
round(a, precision)
Round of vector elements.
Parameters:
a : Vector2 . Vector2 object.
precision : int . Number of digits to round vector "a" elements.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(0.123456, 1.234567) , b = round(a, 2) , plot(b.x)`
fractional(a)
Compute the fractional part of the elements from vector `a`.
Parameters:
a : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.123456, 1.23456) , b = fractional(a) , plot(b.x)`
dot_product(a, b)
dot_product product of 2 vectors, in the form `a.x * b.x + a.y * b.y.
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
Returns: float.
-> usage:
`a = new(3.0, 1.5) , b = from(2.0) , c = dot_product(a, b) , plot(c)`
cross_product(a, b)
cross product of 2 vectors, in the form `a.x * b.y - a.y * b.x`.
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
Returns: float.
-> usage:
`a = new(3.0, 1.5) , b = from(2.0) , c = cross_product(a, b) , plot(c)`
equals(a, b)
Compares two vectors
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
Returns: bool. Representing the equality.
-> usage:
`a = new(3.0, 1.5) , b = from(2.0) , c = equals(a, b) ? 1 : 0 , plot(c)`
sin(a)
Compute the sine of argument vector `a`.
Parameters:
a : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = sin(a) , plot(b.x)`
cos(a)
Compute the cosine of argument vector `a`.
Parameters:
a : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = cos(a) , plot(b.x)`
tan(a)
Compute the tangent of argument vector `a`.
Parameters:
a : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = tan(a) , plot(b.x)`
atan2(x, y)
Approximation to atan2 calculation, arc tangent of `y/x` in the range (-pi,pi) radians.
Parameters:
x : float . The x value of the vector.
y : float . The y value of the vector.
Returns: float. Value with angle in radians. (negative if quadrante 3 or 4)
-> usage:
`a = new(3.0, 1.5) , b = atan2(a.x, a.y) , plot(b)`
atan2(a)
Approximation to atan2 calculation, arc tangent of `y/x` in the range (-pi,pi) radians.
Parameters:
a : Vector2 . Vector2 object.
Returns: float, value with angle in radians. (negative if quadrante 3 or 4)
-> usage:
`a = new(3.0, 1.5) , b = atan2(a) , plot(b)`
distance(a, b)
Distance between vector `a` and `b`.
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
Returns: float.
-> usage:
`a = new(3.0, 1.5) , b = from(2.0) , c = distance(a, b) , plot(c)`
rescale(a, length)
Rescale a vector to a new magnitude.
Parameters:
a : Vector2 . Vector2 object.
length : float . Magnitude.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = 2.0 , c = rescale(a, b) , plot(c.x)`
rotate(a, radians)
Rotates vector by a angle.
Parameters:
a : Vector2 . Vector2 object.
radians : float . Angle value in radians.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = 2.0 , c = rotate(a, b) , plot(c.x)`
rotate_degree(a, degree)
Rotates vector by a angle.
Parameters:
a : Vector2 . Vector2 object.
degree : float . Angle value in degrees.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = 45.0 , c = rotate_degree(a, b) , plot(c.x)`
rotate_around(this, center, angle)
Rotates vector `target` around `origin` by angle value.
Parameters:
this
center : Vector2 . Vector2 object.
angle : float . Angle value in degrees.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = from(2.0) , c = rotate_around(a, b, 45.0) , plot(c.x)`
perpendicular_distance(a, b, c)
Distance from point `a` to line between `b` and `c`.
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
c : Vector2 . Vector2 object.
Returns: float.
-> usage:
`a = new(1.5, 2.6) , b = from(1.0) , c = from(3.0) , d = perpendicular_distance(a, b, c) , plot(d.x)`
project(a, axis)
Project a vector onto another.
Parameters:
a : Vector2 . Vector2 object.
axis : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = from(2.0) , c = project(a, b) , plot(c.x)`
projectN(a, axis)
Project a vector onto a vector of unit length.
Parameters:
a : Vector2 . Vector2 object.
axis : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = from(2.0) , c = projectN(a, b) , plot(c.x)`
reflect(a, axis)
Reflect a vector on another.
Parameters:
a : Vector2 . Vector2 object.
axis
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = from(2.0) , c = reflect(a, b) , plot(c.x)`
reflectN(a, axis)
Reflect a vector to a arbitrary axis.
Parameters:
a : Vector2 . Vector2 object.
axis
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = from(2.0) , c = reflectN(a, b) , plot(c.x)`
angle(a)
Angle in radians of a vector.
Parameters:
a : Vector2 . Vector2 object.
Returns: float.
-> usage:
`a = new(3.0, 1.5) , b = angle(a) , plot(b)`
angle_unsigned(a, b)
unsigned degree angle between 0 and +180 by given two vectors.
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
Returns: float.
-> usage:
`a = new(3.0, 1.5) , b = from(2.0) , c = angle_unsigned(a, b) , plot(c)`
angle_signed(a, b)
Signed degree angle between -180 and +180 by given two vectors.
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
Returns: float.
-> usage:
`a = new(3.0, 1.5) , b = from(2.0) , c = angle_signed(a, b) , plot(c)`
angle_360(a, b)
Degree angle between 0 and 360 by given two vectors
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
Returns: float.
-> usage:
`a = new(3.0, 1.5) , b = from(2.0) , c = angle_360(a, b) , plot(c)`
clamp(a, min, max)
Restricts a vector between a min and max value.
Parameters:
a : Vector2 . Vector2 object.
min
max
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = from(2.0) , c = from(2.5) , d = clamp(a, b, c) , plot(d.x)`
clamp(a, min, max)
Restricts a vector between a min and max value.
Parameters:
a : Vector2 . Vector2 object.
min : float . Lower boundary value.
max : float . Higher boundary value.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = clamp(a, 2.0, 2.5) , plot(b.x)`
lerp(a, b, rate)
Linearly interpolates between vectors a and b by rate.
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
rate : float . Value between (a:-infinity -> b:1.0), negative values will move away from b.
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = from(2.0) , c = lerp(a, b, 0.5) , plot(c.x)`
herp(a, b, rate)
Hermite curve interpolation between vectors a and b by rate.
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
rate : Vector2 . Vector2 object. Value between (a:0 > 1:b).
Returns: Vector2. Vector2 object.
-> usage:
`a = new(3.0, 1.5) , b = from(2.0) , c = from(2.5) , d = herp(a, b, c) , plot(d.x)`
transform(position, mat)
Transform a vector by the given matrix.
Parameters:
position : Vector2 . Source vector.
mat : M32 . Transformation matrix
Returns: Vector2. Transformed vector.
transform(position, mat)
Transform a vector by the given matrix.
Parameters:
position : Vector2 . Source vector.
mat : M44 . Transformation matrix
Returns: Vector2. Transformed vector.
transform(position, mat)
Transform a vector by the given matrix.
Parameters:
position : Vector2 . Source vector.
mat : matrix . Transformation matrix, requires a 3x2 or a 4x4 matrix.
Returns: Vector2. Transformed vector.
transform(this, rotation)
Transform a vector by the given quaternion rotation value.
Parameters:
this : Vector2 . Source vector.
rotation : Quaternion . Rotation to apply.
Returns: Vector2. Transformed vector.
area_triangle(a, b, c)
Find the area in a triangle of vectors.
Parameters:
a : Vector2 . Vector2 object.
b : Vector2 . Vector2 object.
c : Vector2 . Vector2 object.
Returns: float.
-> usage:
`a = new(1.0, 2.0) , b = from(2.0) , c = from(1.0) , d = area_triangle(a, b, c) , plot(d.x)`
random(max)
2D random value.
Parameters:
max : Vector2 . Vector2 object. Vector upper boundary.
Returns: Vector2. Vector2 object.
-> usage:
`a = from(2.0) , b = random(a) , plot(b.x)`
random(max)
2D random value.
Parameters:
max : float, Vector upper boundary.
Returns: Vector2. Vector2 object.
-> usage:
`a = random(2.0) , plot(a.x)`
random(min, max)
2D random value.
Parameters:
min : Vector2 . Vector2 object. Vector lower boundary.
max : Vector2 . Vector2 object. Vector upper boundary.
Returns: Vector2. Vector2 object.
-> usage:
`a = from(1.0) , b = from(2.0) , c = random(a, b) , plot(c.x)`
random(min, max)
2D random value.
Parameters:
min : Vector2 . Vector2 object. Vector lower boundary.
max : Vector2 . Vector2 object. Vector upper boundary.
Returns: Vector2. Vector2 object.
-> usage:
`a = random(1.0, 2.0) , plot(a.x)`
noise(a)
2D Noise based on Morgan McGuire @morgan3d.
Parameters:
a : Vector2 . Vector2 object.
Returns: Vector2. Vector2 object.
-> usage:
`a = from(2.0) , b = noise(a) , plot(b.x)`
to_string(a)
Converts vector `a` to a string format, in the form `"(x, y)"`.
Parameters:
a : Vector2 . Vector2 object.
Returns: string. In `"(x, y)"` format.
-> usage:
`a = from(2.0) , l = barstate.islast ? label.new(bar_index, 0.0, to_string(a)) : label(na)`
to_string(a, format)
Converts vector `a` to a string format, in the form `"(x, y)"`.
Parameters:
a : Vector2 . Vector2 object.
format : string . Format to apply transformation.
Returns: string. In `"(x, y)"` format.
-> usage:
`a = from(2.123456) , l = barstate.islast ? label.new(bar_index, 0.0, to_string(a, "#.##")) : label(na)`
to_array(a)
Converts vector to a array format.
Parameters:
a : Vector2 . Vector2 object.
Returns: array.
-> usage:
`a = from(2.0) , b = to_array(a) , plot(array.get(b, 0))`
to_barycentric(this, a, b, c)
Captures the barycentric coordinate of a cartesian position in the triangle plane.
Parameters:
this : Vector2 . Source cartesian coordinate position.
a : Vector2 . Triangle corner `a` vertice.
b : Vector2 . Triangle corner `b` vertice.
c : Vector2 . Triangle corner `c` vertice.
Returns: bool.
from_barycentric(this, a, b, c)
Captures the cartesian coordinate of a barycentric position in the triangle plane.
Parameters:
this : Vector2 . Source barycentric coordinate position.
a : Vector2 . Triangle corner `a` vertice.
b : Vector2 . Triangle corner `b` vertice.
c : Vector2 . Triangle corner `c` vertice.
Returns: bool.
to_complex(this)
Translate a Vector2 structure to complex.
Parameters:
this : Vector2 . Source vector.
Returns: Complex.
to_polar(this)
Translate a Vector2 cartesian coordinate into polar coordinates.
Parameters:
this : Vector2 . Source vector.
Returns: Pole. The returned angle is in radians.
keyed value types with pseudo-dict - Methods Library "key_vals"
a set of primitive single-type key/value items, and pseudo-dictionaries
The dictionaries are single arrays of items, each item has a key and value.
The library is 100% methods. add, remove, get and set items by key.
It provides methods to get all the keys, values or items in the dict as arrays.
For those familiar with python, it's similar, but typified.. and the brackets are round.
example syntax.. using floats, the same functions exist for Int, Bool and String
new float_item
new (‘demo’, 1.0 )
set the key of a float_item
float_item.key (‘demo’)
get the key of a float_item
float_item.key ()
set the value of a float_item
float_item.val (1.5)
get the value of a float_item
float_item.val ()
get the number of items in a dict
float_dict.count ()
set an item to a dict by key ( add / update)
float_dict.set ( ‘demo’, 2.0 )
remove an item from a dict by key (changes index, but this is about keys, not ids)
float_dict.remove ( ‘demo’ )
get an item from a dict array
array.get (1 )
get an item from a dict by key
float_dict.get ( ‘demo’ )
get an item from a dict by id (remember, ids change if removed by key) mainlyy an internal function
float_dict.get ( 1)
return all keys as string
float_dict.get_keys()
return all values as float
float_dict.get_values()
return all items as float
float_dict.get_items()
create a new float dict in the multi dict and return the index of it
multi_dict.add_float_dict()
get the float dict at index 0 from the multi dict
multi_dict.get_float_dict( 0)
set an item in a float dict in a multi dict
multi_dict.set_float( ‘demo’, 2.0 )
get an item from a float dict in a multi dict
multi_dict.get_float( ‘demo’ )
float_item
float_item
Fields:
key : (string)
val : (float)
next : (float_item)
float_dict
float_dict
Fields:
content
int_item
int_item
Fields:
key : (string)
val : (int)
next : (int_item)
int_dict
int_dict
Fields:
content
string_item
string_item
Fields:
key : (string)
val : (string)
next : (string_item)
string_dict
string_dict
Fields:
content
bool_item
bool_item
Fields:
key : (string)
val : (bool)
next : (bool_item)
bool_dict
bool_dict
Fields:
content
multi_dict
multi_dict
Fields:
f_dicts
f_registry
i_dicts
i_registry
s_dicts
s_registry
b_dicts
b_registry
new(key, val)
new
Parameters:
key : string
val : float
new(key, val)
Parameters:
key
val
new(key, val)
Parameters:
key
val
new(key, val)
Parameters:
key
val
key(this, key)
key
Parameters:
this : float_item
key : string
key(this)
key
Parameters:
this : float_item
key(this, key)
Parameters:
this
key
key(this)
Parameters:
this
key(this, key)
Parameters:
this
key
key(this)
Parameters:
this
key(this, key)
Parameters:
this
key
key(this)
Parameters:
this
val(this)
val
Parameters:
this : float_item
val(this, val)
val
Parameters:
this : float_item
val : float
val(this)
Parameters:
this
val(this, val)
Parameters:
this
val
val(this)
Parameters:
this
val(this, val)
Parameters:
this
val
val(this)
Parameters:
this
val(this, val)
Parameters:
this
val
count(dict)
count
Parameters:
dict : float_dict
count(dict)
Parameters:
dict
count(dict)
Parameters:
dict
count(dict)
Parameters:
dict
get(dict, index)
get
Parameters:
dict : float_dict
index : int
get(dict, index)
get
Parameters:
dict : float_dict
index : int
get(d, key)
Parameters:
d
key
get(dict, index)
Parameters:
dict
index
get(dict, index)
Parameters:
dict
index
get(d, key)
Parameters:
d
key
get(dict, index)
Parameters:
dict
index
get(dict, index)
Parameters:
dict
index
get(d, key)
Parameters:
d
key
get(dict, index)
Parameters:
dict
index
get(dict, index)
Parameters:
dict
index
get(d, key)
Parameters:
d
key
set(d, key, val)
set
Parameters:
d : float_dict
key : string
val : float
set(d, key, val)
Parameters:
d
key
val
set(d, key, val)
Parameters:
d
key
val
set(d, key, val)
Parameters:
d
key
val
get_keys(d)
Parameters:
d
get_keys(d)
Parameters:
d
get_keys(d)
Parameters:
d
get_keys(d)
Parameters:
d
get_values(d)
Parameters:
d
get_values(d)
Parameters:
d
get_values(d)
Parameters:
d
get_values(d)
Parameters:
d
get_items(d)
Parameters:
d
get_items(d)
Parameters:
d
get_items(d)
Parameters:
d
get_items(d)
Parameters:
d
remove(dict, key)
Parameters:
dict
key
remove(dict, key)
Parameters:
dict
key
remove(dict, key)
Parameters:
dict
key
remove(dict, key)
Parameters:
dict
key
create_multi_dict()
add_float_dict(this)
Parameters:
this
add_int_dict(this)
Parameters:
this
add_string_dict(this)
Parameters:
this
add_bool_dict(this)
Parameters:
this
get_float_dict(this, index)
Parameters:
this
index
get_float_dict(this, key)
Parameters:
this
key
get_int_dict(this, index)
Parameters:
this
index
get_int_dict(this, key)
Parameters:
this
key
get_string_dict(this, index)
Parameters:
this
index
get_string_dict(this, key)
Parameters:
this
key
get_bool_dict(this, index)
Parameters:
this
index
get_bool_dict(this, key)
Parameters:
this
key
set_float(this, key, val)
Parameters:
this
key
val
set_int(this, key, val)
Parameters:
this
key
val
set_string(this, key, val)
Parameters:
this
key
val
set_bool(this, key, val)
Parameters:
this
key
val
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