FunctionArrayMaxSubKadanesAlgorithmLibrary "FunctionArrayMaxSubKadanesAlgorithm"
Implements Kadane's maximum sum sub array algorithm.
size(samples) Kadanes algorithm.
Parameters:
samples : float array, sample data values.
Returns: float.
indices(samples) Kadane's algorithm with indices.
Parameters:
samples : float array, sample data values.
Returns: tuple with format .
Arrays
cacheLibrary "cache"
A simple cache library to store key value pairs.
Fed up of injecting and returning so many values all the time?
Want to separate your code and keep it clean?
Need to make an expensive calculation and use the results in numerous places?
Want to throttle calculations or persist random values across bars or ticks?
Then you've come to the right place. Or not! Up to you, I don't mind either way... ;)
Check the helpers and unit tests in the script for further detail.
Detailed Interface
init(persistant) Initialises the syncronised cache key and value arrays
Parameters:
persistant : bool, toggles data persistance between bars and ticks
Returns: [string , float ], a tuple of both arrays
set(keys, values, key, value) Sets a value into the cache
Parameters:
keys : string , the array of cache keys
values : float , the array of cache values
key : string, the cache key to create or update
value : float, the value to set
has(keys, values, key) Checks if the cache has a key
Parameters:
keys : string , the array of cache keys
values : float , the array of cache values
key : string, the cache key to check
Returns: bool, true only if the key is found
get(keys, values, key) Gets a keys value from the cache
Parameters:
keys : string , the array of cache keys
values : float , the array of cache values
key : string, the cache key to get
Returns: float, the stored value
remove(keys, values, key) Removes a key and value from the cache
Parameters:
keys : string , the array of cache keys
values : float , the array of cache values
key : string, the cache key to remove
count() Counts how many key value pairs in the cache
Returns: int, the total number of pairs
loop(keys, values) Returns true for each value in the cache (use as the while loop expression)
Parameters:
keys : string , the array of cache keys
values : float , the array of cache values
next(keys, values) Returns each key value pair on successive calls (use in the while loop)
Parameters:
keys : string , the array of cache keys
values : float , the array of cache values
Returns: , tuple of each key value pair
clear(keys, values) Clears all key value pairs from the cache
Parameters:
keys : string , the array of cache keys
values : float , the array of cache values
unittest_cache(case) Cache module unit tests, for inclusion in parent script test suite. Usage: log.unittest_cache(__ASSERTS)
Parameters:
case : string , the current test case and array of previous unit tests (__ASSERTS)
unittest(verbose) Run the cache module unit tests as a stand alone. Usage: cache.unittest()
Parameters:
verbose : bool, optionally disable the full report to only display failures
ArrayMultipleDimensionPrototypeLibrary "ArrayMultipleDimensionPrototype"
A prototype library for Multiple Dimensional array methods
index_md_to_1d()
new_float(dimensions, initial_size) Creates a variable size multiple dimension array.
Parameters:
dimensions : int array, dimensions of array.
initial_size : float, default=na, initial value of the array.
Returns: float array
dimensions(id, value) set value of a element in a multiple dimensions array.
Parameters:
id : float array, multiple dimensions array.
value : float, new value.
Returns: float.
get(id) get value of a multiple dimensions array.
Parameters:
id : float array, multiple dimensions array.
Returns: float.
set(id) set value of a element in a multiple dimensions array.
Parameters:
id : float array, multiple dimensions array.
Returns: float.
FunctionArrayReduceLibrary "FunctionArrayReduce"
A limited method to reduce a array using a mathematical formula.
float_(formula, samples, arguments, initial_value) Method to reduce a array using a mathematical formula.
Parameters:
formula : string, the mathematical formula, accepts some default name codes (index, output, previous, current, integer index of arguments array).
samples : float array, the data to process.
arguments : float array, the extra arguments of the formula.
initial_value : float, default=0, a initial base value for the process.
Returns: float.
Notes:
** if initial value is specified as "na" it will default to the first element of samples.
FunctionProbabilityDistributionSamplingLibrary "FunctionProbabilityDistributionSampling"
Methods for probability distribution sampling selection.
sample(probabilities) Computes a random selected index from a probability distribution.
Parameters:
probabilities : float array, probabilities of sample.
Returns: int.
FunctionElementsInArrayLibrary "FunctionElementsInArray"
Methods to count number of elements in arrays
count_float(sample, value) Counts the number of elements equal to provided value in array.
Parameters:
sample : float array, sample data to process.
value : float value to check for equality.
Returns: int.
count_int(sample, value) Counts the number of elements equal to provided value in array.
Parameters:
sample : int array, sample data to process.
value : int value to check for equality.
Returns: int.
count_string(sample, value) Counts the number of elements equal to provided value in array.
Parameters:
sample : string array, sample data to process.
value : string value to check for equality.
Returns: int.
count_bool(sample, value) Counts the number of elements equal to provided value in array.
Parameters:
sample : bool array, sample data to process.
value : bool value to check for equality.
Returns: int.
count_color(sample, value) Counts the number of elements equal to provided value in array.
Parameters:
sample : color array, sample data to process.
value : color value to check for equality.
Returns: int.
extract_indices_float(sample, value) Counts the number of elements equal to provided value in array, and returns its indices.
Parameters:
sample : float array, sample data to process.
value : float value to check for equality.
Returns: int.
extract_indices_int(sample, value) Counts the number of elements equal to provided value in array, and returns its indices.
Parameters:
sample : int array, sample data to process.
value : int value to check for equality.
Returns: int.
extract_indices_string(sample, value) Counts the number of elements equal to provided value in array, and returns its indices.
Parameters:
sample : string array, sample data to process.
value : string value to check for equality.
Returns: int.
extract_indices_bool(sample, value) Counts the number of elements equal to provided value in array, and returns its indices.
Parameters:
sample : bool array, sample data to process.
value : bool value to check for equality.
Returns: int.
extract_indices_color(sample, value) Counts the number of elements equal to provided value in array, and returns its indices.
Parameters:
sample : color array, sample data to process.
value : color value to check for equality.
Returns: int.
amibrokerLibrary "amibroker"
This library consists of functions from amibroker that doesn't exist on tradingview pinescript. The example of these are the ExRem and Flip.
In the example below, I used ExRem to remove the excessive buy and sell signals. Meanwhile, I used the Flip to highlight the bg color when there is an open position.
exrem(series1, series2) Removes excessive signals. Pinescript version of ExRem in Amibroker (www.amibroker.com)
Parameters:
series1 : boolean
series2 : boolean
Returns: boolean
flip(series1, series2) works as a flip/flop device or "latch". Pinescript version of Flip in Amibroker: (www.amibroker.com)
Parameters:
series1 : boolan
series2 : boolean
Returns: boolean.
FunctionCompoundInterestLibrary "FunctionCompoundInterest"
Method for compound interest.
simple_compound(principal, rate, duration) Computes compound interest for given duration.
Parameters:
principal : float, the principal or starting value.
rate : float, the rate of interest.
duration : float, the period of growth.
Returns: float.
variable_compound(principal, rates, duration) Computes variable compound interest for given duration.
Parameters:
principal : float, the principal or starting value.
rates : float array, the rates of interest.
duration : int, the period of growth.
Returns: float array.
simple_compound_array(principal, rates, duration) Computes variable compound interest for given duration.
Parameters:
principal : float, the principal or starting value.
rates : float array, the rates of interest.
duration : int, the period of growth.
Returns: float array.
variable_compound_array(principal, rates, duration) Computes variable compound interest for given duration.
Parameters:
principal : float, the principal or starting value.
rates : float array, the rates of interest.
duration : int, the period of growth.
Returns: float array.
FunctionSMCMCLibrary "FunctionSMCMC"
Methods to implement Markov Chain Monte Carlo Simulation (MCMC)
markov_chain(weights, actions, target_path, position, last_value) a basic implementation of the markov chain algorithm
Parameters:
weights : float array, weights of the Markov Chain.
actions : float array, actions of the Markov Chain.
target_path : float array, target path array.
position : int, index of the path.
last_value : float, base value to increment.
Returns: void, updates target array
mcmc(weights, actions, start_value, n_iterations) uses a monte carlo algorithm to simulate a markov chain at each step.
Parameters:
weights : float array, weights of the Markov Chain.
actions : float array, actions of the Markov Chain.
start_value : float, base value to start simulation.
n_iterations : integer, number of iterations to run.
Returns: float array with path.
FunctionGeometricLineDrawingsLibrary "FunctionGeometricLineDrawings"
array_delete_all_lines(lines) deletes all lines in array.
Parameters:
lines : line array, array with line objects to delete.
Returns: void.
triangle(sample_x, sample_y, xloc, extend, color, style, width) Draw a Triangle with 3 vector2D(x, y) coordinates.
Parameters:
sample_x : int array, triangle sample data X coordinate values.
sample_y : float array, triangle sample data Y coordinate values.
xloc : string, defaultoptions=xloc.bar_index, xloc.bar_time.
extend : string, default=extend.none, options=(extend.none, extend.right, extend.left, extend.both).
color : color, default=
style : options line.style_solid, line.style_dotted, line.style_dashed, line.style_arrow_left, line.style_arrow_right, line.style_arrow_both
width : width in pixels.
Returns: line array
trapezoid(sample_x, sample_y, xloc, extend, color, style, width) Draw a Trapezoid with 4 vector2D(x, y) coordinates:
Parameters:
sample_x : int array, trapezoid sample data X coordinate values.
sample_y : float array, trapezoid sample data Y coordinate values.
xloc : string, defaultoptions=xloc.bar_index, xloc.bar_time.
extend : string, default=extend.none, options=(extend.none, extend.right, extend.left, extend.both).
color : color, default=
style : options line.style_solid, line.style_dotted, line.style_dashed, line.style_arrow_left, line.style_arrow_right, line.style_arrow_both
width : width in pixels.
Returns: line array
zigzagplusThis is same as existing zigzag library with respect to functionality. But, there is a small update with respect to how arrays are used internally. This also leads to issues with backward compatibility. Hence I decided to make this as new library instead of updating the older one.
Below are the major changes:
Earlier version uses array.unshift for adding new elements and array.pop for removing old elements. But, since array.unshift is considerably slower than alternative method array.push. Hence, this library makes use of array.push method to achieve performance.
While array.push increases the performance significantly, there is also an issue with removing as we no longer will be able to remove the element using pop which is again faster than shift (which need to shit all the elements by index). Hence, have removed the logic of removing elements for zigzag pivots after certain limit. Will think further about it once I find better alternative of handling it.
These implementation change also mean that zigzag pivots received by calling method will be ordered in reverse direction. Latest pivots will be stored with higher array index whereas older pivots are stored with lower array index. This is also the reason why backward compatibility is not achievable with this code change.
Library "zigzagplus"
Library dedicated to zigzags and related indicators
zigzag(length, useAlternativeSource, source, oscillatorSource, directionBias) zigzag: Calculates zigzag pivots and generates an array
Parameters:
length : : Zigzag Length
useAlternativeSource : : If set uses the source for genrating zigzag. Default is false
source : : Alternative source used only if useAlternativeSource is set to true. Default is close
oscillatorSource : : Oscillator source for calculating divergence
directionBias : : Direction bias for calculating divergence
Returns: zigzagpivots : Array containing zigzag pivots
zigzagpivotbars : Array containing zigzag pivot bars
zigzagpivotdirs : Array containing zigzag pivot directions (Lower High : 1, Higher High : 2, Lower Low : -2 and Higher Low : -1)
zigzagpivotratios : Array containing zigzag retracement ratios for each pivot
zigzagoscillators : Array of oscillator values at pivots. Will have valid values only if valid oscillatorSource is provided as per input.
zigzagoscillatordirs: Array of oscillator directions (HH, HL, LH, LL) at pivots. Will have valid values only if valid oscillatorSource is provided as per input.
zigzagtrendbias : Array of trend bias at pivots. Will have valid value only if directionBias series is sent in input parameters
zigzagdivergence : Array of divergence sentiment at each pivot. Will have valid values only if oscillatorSource and directionBias inputs are provided
newPivot : Returns true if new pivot created
doublePivot : Returns true if two new pivots are created on same bar (Happens in case of candles with long wicks and shorter zigzag lengths)
drawzigzag(length, , source, linecolor, linewidth, linestyle, oscillatorSource, directionBias, showHighLow, showRatios, showDivergence) drawzigzag: Calculates and draws zigzag pivots
Parameters:
length : : Zigzag Length
: useAlternativeSource: If set uses the source for genrating zigzag. Default is false
source : : Alternative source used only if useAlternativeSource is set to true. Default is close
linecolor : : zigzag line color
linewidth : : zigzag line width
linestyle : : zigzag line style
oscillatorSource : : Oscillator source for calculating divergence
directionBias : : Direction bias for calculating divergence
showHighLow : : show highlow label
showRatios : : show retracement ratios
showDivergence : : Show divergence on label (Only works if divergence data is available - that is if we pass valid oscillatorSource and directionBias input)
Returns: zigzagpivots : Array containing zigzag pivots
zigzagpivotbars : Array containing zigzag pivot bars
zigzagpivotdirs : Array containing zigzag pivot directions (Lower High : 1, Higher High : 2, Lower Low : -2 and Higher Low : -1)
zigzagpivotratios : Array containing zigzag retracement ratios for each pivot
zigzagoscillators : Array of oscillator values at pivots. Will have valid values only if valid oscillatorSource is provided as per input.
zigzagoscillatordirs: Array of oscillator directions (HH, HL, LH, LL) at pivots. Will have valid values only if valid oscillatorSource is provided as per input.
zigzagtrendbias : Array of trend bias at pivots. Will have valid value only if directionBias series is sent in input parameters
zigzagdivergence : Array of divergence sentiment at each pivot. Will have valid values only if oscillatorSource and directionBias inputs are provided
zigzaglines : Returns array of zigzag lines
zigzaglabels : Returns array of zigzag labels
LibraryPrivateUsage001This is a public library that include the functions explained below. The libraries are considered public domain code and permission is not required from the author if you reuse these functions in your open-source scripts
FunctionDecisionTreeLibrary "FunctionDecisionTree"
Method to generate decision tree based on weights.
decision_tree(weights, depth) Method to generate decision tree based on weights.
Parameters:
weights : float array, weights for decision consideration.
depth : int, depth of the tree.
Returns: int array
FunctionForecastLinearLibrary "FunctionForecastLinear"
Method for linear Forecast, same as found in excel and other sheet packages.
forecast(sample_x, sample_y, target_x) linear forecast method.
Parameters:
sample_x : float array, sample data X value.
sample_y : float array, sample data Y value.
target_x : float, target X to get Y forecast value.
Returns: float
FunctionBoxCoxTransformLibrary "FunctionBoxCoxTransform"
Methods to compute the Box-Cox Transformer.
regular(sample, lambda) Regular transform.
Parameters:
sample : float array, sample data values.
lambda : float, scaling factor.
Returns: float array.
inverse(sample, lambda) Regular transform.
Parameters:
sample : float array, sample data values.
lambda : float, scaling factor.
Returns: float array.
FunctionPolynomialRegressionLibrary "FunctionPolynomialRegression"
TODO:
polyreg(sample_x, sample_y) Method to return a polynomial regression channel using (X,Y) sample points.
Parameters:
sample_x : float array, sample data X points.
sample_y : float array, sample data Y points.
Returns: tuple with:
_predictions: Array with adjusted Y values.
_max_dev: Max deviation from the mean.
_min_dev: Min deviation from the mean.
_stdev/_sizeX: Average deviation from the mean.
draw(sample_x, sample_y, extend, mid_color, mid_style, mid_width, std_color, std_style, std_width, max_color, max_style, max_width) Method for drawing the Polynomial Regression into chart.
Parameters:
sample_x : float array, sample point X value.
sample_y : float array, sample point Y value.
extend : string, default=extend.none, extend lines.
mid_color : color, default=color.blue, middle line color.
mid_style : string, default=line.style_solid, middle line style.
mid_width : int, default=2, middle line width.
std_color : color, default=color.aqua, standard deviation line color.
std_style : string, default=line.style_dashed, standard deviation line style.
std_width : int, default=1, standard deviation line width.
max_color : color, default=color.purple, max range line color.
max_style : string, default=line.style_dotted, max line style.
max_width : int, default=1, max line width.
Returns: line array.
FunctionLinearRegressionLibrary "FunctionLinearRegression"
Method for Linear Regression using array sample points.
linreg(sample_x, sample_y) Performs Linear Regression over the provided sample points.
Parameters:
sample_x : float array, sample points X value.
sample_y : float array, sample points Y value.
Returns: tuple with:
_predictions: Array with adjusted Y values.
_max_dev: Max deviation from the mean.
_min_dev: Min deviation from the mean.
_stdev/_sizeX: Average deviation from the mean.
draw(sample_x, sample_y, extend, mid_color, mid_style, mid_width, std_color, std_style, std_width, max_color, max_style, max_width) Method for drawing the Linear Regression into chart.
Parameters:
sample_x : float array, sample point X value.
sample_y : float array, sample point Y value.
extend : string, default=extend.none, extend lines.
mid_color : color, default=color.blue, middle line color.
mid_style : string, default=line.style_solid, middle line style.
mid_width : int, default=2, middle line width.
std_color : color, default=color.aqua, standard deviation line color.
std_style : string, default=line.style_dashed, standard deviation line style.
std_width : int, default=1, standard deviation line width.
max_color : color, default=color.purple, max range line color.
max_style : string, default=line.style_dotted, max line style.
max_width : int, default=1, max line width.
Returns: line array.
MathSpecialFunctionsDiscreteFourierTransformLibrary "MathSpecialFunctionsDiscreteFourierTransform"
Method for Complex Discrete Fourier Transform (DFT).
dft(inputs, inverse) Complex Discrete Fourier Transform (DFT).
Parameters:
inputs : float array, pseudo complex array of paired values .
inverse : bool, invert the transformation.
Returns: float array, pseudo complex array of paired values .
Bursa_SectorLibrary "Bursa_Sector"
: List of stocks classified by sector in Bursa Malaysia (As of Oct 2021)
getSector()
This function will get the sector of current stock that listed in Bursa Malaysia
CreateAndShowZigzagLibrary "CreateAndShowZigzag"
Functions in this library creates/updates zigzag array and shows the zigzag
getZigzag(zigzag, prd, max_array_size) calculates zigzag using period
Parameters:
zigzag : is the float array for the zigzag (should be defined like "var zigzag = array.new_float(0)"). each zigzag points contains 2 element: 1. price level of the zz point 2. bar_index of the zz point
prd : is the length to calculate zigzag waves by highest(prd)/lowest(prd)
max_array_size : is the maximum number of elements in zigzag, keep in mind each zigzag point contains 2 elements, so for example if it's 10 then zigzag has 10/2 => 5 zigzag points
Returns: dir that is the current direction of the zigzag
showZigzag(zigzag, oldzigzag, dir, upcol, dncol) this function shows zigzag
Parameters:
zigzag : is the float array for the zigzag (should be defined like "var zigzag = array.new_float(0)"). each zigzag points contains 2 element: 1. price level of the zz point 2. bar_index of the zz point
oldzigzag : is the float array for the zigzag, you get copy the zigzag array to oldzigzag by "oldzigzag = array.copy(zigzay)" before calling get_zigzag() function
dir : is the direction of the zigzag wave
upcol : is the color of the line if zigzag direction is up
dncol : is the color of the line if zigzag direction is down
Returns: null
MathComplexEvaluateLibrary "MathComplexEvaluate"
TODO: add library description here
is_op(char) Check if char is a operator.
Parameters:
char : string, 1 character string.
Returns: bool.
operator(op, left, right) operation between left and right values.
Parameters:
op : string, operator string character.
left : float, left value of operation.
right : float, right value of operation.
operator_precedence(op) level of precedence of operator.
Parameters:
op : string, operator 1 char string.
Returns: int.
eval() evaluate a string with references to a array of arguments.
| @param tokens string, arithmetic operations with references to indices in arguments, ex:"0+1*0+2*2+3" arguments
| @param arguments float array, arguments.
| @returns float, solution.
MathComplexTrignometryLibrary "MathComplexTrignometry"
Methods for complex number trignometry operations.
sinh(complex) Hyperbolic Sine of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
cosh(complex) Hyperbolic cosine of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
tanh(complex) Hyperbolic tangent of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
coth(complex) Hyperbolic cotangent of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
sech(complex) Hyperbolic Secant of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
csch(complex) Hyperbolic Cosecant of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
sin(complex) Trigonometric Sine of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
cos(complex) Trigonometric cosine of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
tan(complex) Trigonometric tangent of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
cot(complex) Trigonometric cotangent of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
sec(complex) Trigonometric Secant of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
csc(complex) Trigonometric Cosecant of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
asin(complex) Trigonometric Arc Sine of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
acos(complex) Trigonometric Arc Cosine of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
atan(complex) Trigonometric Arc Tangent of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
acot(complex) Trigonometric Arc Cotangent of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
asec(complex) Trigonometric Arc Secant of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
acsc(complex) Trigonometric Arc Cosecant of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
asinh(complex) Hyperbolic Arc Sine of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
acosh(complex) Hyperbolic Arc Cosine of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
atanh(complex) Hyperbolic Arc Tangent of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
acoth(complex) Hyperbolic Arc Cotangent of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
asech(complex) Hyperbolic Arc Secant of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
acsch(complex) Hyperbolic Arc Cosecant of complex number.
Parameters:
complex : float array, complex number.
Returns: float array.
MathComplexExtensionLibrary "MathComplexExtension"
A set of utility functions to handle complex numbers.
get_phase(complex_number, in_radians) The phase value of complex number complex_number.
Parameters:
complex_number : float array, pseudo complex number in the form of a array .
in_radians : boolean, value for the type of angle value, default=true, options=(true: radians, false: degrees)
Returns: float value with phase.
natural_logarithm(complex_number) Natural logarithm of complex number (base E).
Parameters:
complex_number : float array, pseudo complex number in the form of a array .
Returns: float array, complex number.
common_logarithm(complex_number) Common logarithm of complex number (base 10).
Parameters:
complex_number : float array, pseudo complex number in the form of a array .
Returns: float array, complex number.
logarithm(complex_number, base) Common logarithm of complex number (custom base).
Parameters:
complex_number : float array, pseudo complex number in the form of a array .
base : float, base value.
Returns: float array, complex number.
power(complex_number, complex_exponent) Raise complex_number with complex_exponent.
Parameters:
complex_number : float array, pseudo complex number in the form of a array .
complex_exponent : float array, pseudo complex number in the form of a array .
Returns: float array, pseudo complex number in the form of a array
root(complex_number, complex_exponent) Raise complex_number with inverse of complex_exponent.
Parameters:
complex_number : float array, pseudo complex number in the form of a array .
complex_exponent : float array, pseudo complex number in the form of a array .
Returns: float array, pseudo complex number in the form of a array
square(complex_number) Square of complex_number (power 2).
Parameters:
complex_number : float array, pseudo complex number in the form of a array .
Returns: float array, pseudo complex number in the form of a array
square_root(complex_number) Square root of complex_number (power 1/2).
Parameters:
complex_number : float array, pseudo complex number in the form of a array .
Returns: float array, pseudo complex number in the form of a array
square_roots(complex_number) Square root of complex_number (power 1/2).
Parameters:
complex_number : float array, pseudo complex number in the form of a array .
Returns: tuple with 2 complex numbers.
cubic_roots(complex_number) Square root of complex_number (power 1/2).
Parameters:
complex_number : float array, pseudo complex number in the form of a array .
Returns: tuple with 2 complex numbers.
to_polar_form(complex_number, in_radians) The polar form value of complex_number.
Parameters:
complex_number : float array, pseudo complex number in the form of a array .
in_radians : boolean, value for the type of angle value, default=true, options=(true: radians, false: degrees)
Returns: float array, pseudo complex number in the form of a array
** returns a array