MathExtensionLibrary "MathExtension"
Math Extension.
log2(_value) calculate log base 2
Parameters:
_value : float, number.
Returns: float, base 2 logarithm of value.
fmod(numerator, denominator) float remainder of x divided by y.
Parameters:
numerator : float, division numerator.
denominator : float, division denuminator.
Returns: float
fractional(value) computes the fractional part of the argument value.
Parameters:
value : float, value to compute.
Returns: float, fractional part.
integral(value) Find the integral of value.
Parameters:
value : float, value.
Returns: float.
atan2(value_x, value_y) Approximation to atan2 calculation, arc tangent of y/ x in the range (-pi,pi) radians.
Parameters:
value_x : float, value x.
value_y : float, value y.
Returns: float, value with angle in radians. (negative if quadrante 3 or 4)
hypotenuse(value_x, value_y) Multidimensional euclidean distance from the origin to a point.
Parameters:
value_x : float, value x.
value_y : float, value y.
Returns: float
near_equal(value_a, value_b, relative_tolerance, absolute_tolerance) Determine whether two floating point numbers are near in value.
Parameters:
value_a : float, value to compare with.
value_b : float, value to be compared against.
relative_tolerance : float, default (1.0e-09).
absolute_tolerance : float, default (0.0).
Returns: bool
factorize(value) Factorize a number.
Parameters:
value : int, positive number.
Returns: int
permutations(options_size, combo_size) Number of ways to choose k items from n items without repetition and with order.
Parameters:
options_size : int, number of items to pool from
combo_size : int, number of items to be chosen
Returns: int
combinations(options_size, combo_size) Find the total number of possibilities to choose k things from n items
Parameters:
options_size : int, number of items to pool from
combo_size : int, number of items to be chosen
Returns: int
MATH
MathConstantsUniversalLibrary "MathConstantsUniversal"
Mathematical Constants
SpeedOfLight() Speed of Light in Vacuum: c_0 = 2.99792458e8 (defined, exact; 2007 CODATA)
MagneticPermeability() Magnetic Permeability in Vacuum: mu_0 = 4*Pi * 10^-7 (defined, exact; 2007 CODATA)
ElectricPermittivity() Electric Permittivity in Vacuum: epsilon_0 = 1/(mu_0*c_0^2) (defined, exact; 2007 CODATA)
CharacteristicImpedanceVacuum() Characteristic Impedance of Vacuum: Z_0 = mu_0*c_0 (defined, exact; 2007 CODATA)
GravitationalConstant() Newtonian Constant of Gravitation: G = 6.67429e-11 (2007 CODATA)
PlancksConstant() Planck's constant: h = 6.62606896e-34 (2007 CODATA)
DiracsConstant() Reduced Planck's constant: h_bar = h / (2*Pi) (2007 CODATA)
PlancksMass() Planck mass: m_p = (h_bar*c_0/G)^(1/2) (2007 CODATA)
PlancksTemperature() Planck temperature: T_p = (h_bar*c_0^5/G)^(1/2)/k (2007 CODATA)
PlancksLength() Planck length: l_p = h_bar/(m_p*c_0) (2007 CODATA)
PlancksTime() Planck time: t_p = l_p/c_0 (2007 CODATA)
MathConstantsScientificLibrary "MathConstantsScientific"
Mathematical Constants
Yotta() The SI prefix factor corresponding to 1 000 000 000 000 000 000 000 000
Zetta() The SI prefix factor corresponding to 1 000 000 000 000 000 000 000
Exa() The SI prefix factor corresponding to 1 000 000 000 000 000 000
Peta() The SI prefix factor corresponding to 1 000 000 000 000 000
Tera() The SI prefix factor corresponding to 1 000 000 000 000
Giga() The SI prefix factor corresponding to 1 000 000 000
Mega() The SI prefix factor corresponding to 1 000 000
Kilo() The SI prefix factor corresponding to 1 000
Hecto() The SI prefix factor corresponding to 100
Deca() The SI prefix factor corresponding to 10
Deci() The SI prefix factor corresponding to 0.1
Centi() The SI prefix factor corresponding to 0.01
Milli() The SI prefix factor corresponding to 0.001
Micro() The SI prefix factor corresponding to 0.000 001
Nano() The SI prefix factor corresponding to 0.000 000 001
Pico() The SI prefix factor corresponding to 0.000 000 000 001
Femto() The SI prefix factor corresponding to 0.000 000 000 000 001
Atto() The SI prefix factor corresponding to 0.000 000 000 000 000 001
Zepto() The SI prefix factor corresponding to 0.000 000 000 000 000 000 001
Yocto() The SI prefix factor corresponding to 0.000 000 000 000 000 000 000 001
MathConstantsElectromagneticLibrary "MathConstantsElectromagnetic"
Mathematical Constants
ElementaryCharge() Elementary Electron Charge: e = 1.602176487e-19 (2007 CODATA)
MagneticFluxQuantum() Magnetic Flux Quantum: theta_0 = h/(2*e) (2007 CODATA)
ConductanceQuantum() Conductance Quantum: G_0 = 2*e^2/h (2007 CODATA)
JosephsonConstant() Josephson Constant: K_J = 2*e/h (2007 CODATA)
VonKlitzingConstant() Von Klitzing Constant: R_K = h/e^2 (2007 CODATA)
BohrMagneton() Bohr Magneton: mu_B = e*h_bar/2*m_e (2007 CODATA)
NuclearMagneton() Nuclear Magneton: mu_N = e*h_bar/2*m_p (2007 CODATA)
MathConstantsAtomicLibrary "MathConstantsAtomic"
Mathematical Constants
FineStructureConstant() Fine Structure Constant: alpha = e^2/4*Pi*e_0*h_bar*c_0 (2007 CODATA)
RydbergConstant() Rydberg Constant: R_infty = alpha^2*m_e*c_0/2*h (2007 CODATA)
BohrRadius() Bor Radius: a_0 = alpha/4*Pi*R_infty (2007 CODATA)
HartreeEnergy() Hartree Energy: E_h = 2*R_infty*h*c_0 (2007 CODATA)
QuantumOfCirculation() Quantum of Circulation: h/2*m_e (2007 CODATA)
FermiCouplingConstant() Fermi Coupling Constant: G_F/(h_bar*c_0)^3 (2007 CODATA)
WeakMixingAngle() Weak Mixin Angle: sin^2(theta_W) (2007 CODATA)
ElectronMass() Electron Mass: (2007 CODATA)
ElectronMassEnergyEquivalent() Electron Mass Energy Equivalent: (2007 CODATA)
ElectronMolarMass() Electron Molar Mass: (2007 CODATA)
ComptonWavelength() Electron Compton Wavelength: (2007 CODATA)
ClassicalElectronRadius() Classical Electron Radius: (2007 CODATA)
ThomsonCrossSection() Thomson Cross Section: (2002 CODATA)
ElectronMagneticMoment() Electron Magnetic Moment: (2007 CODATA)
ElectronGFactor() Electon G-Factor: (2007 CODATA)
MuonMass() Muon Mass: (2007 CODATA)
MuonMassEnegryEquivalent() Muon Mass Energy Equivalent: (2007 CODATA)
MuonMolarMass() Muon Molar Mass: (2007 CODATA)
MuonComptonWavelength() Muon Compton Wavelength: (2007 CODATA)
MuonMagneticMoment() Muon Magnetic Moment: (2007 CODATA)
MuonGFactor() Muon G-Factor: (2007 CODATA)
TauMass() Tau Mass: (2007 CODATA)
TauMassEnergyEquivalent() Tau Mass Energy Equivalent: (2007 CODATA)
TauMolarMass() Tau Molar Mass: (2007 CODATA)
TauComptonWavelength() Tau Compton Wavelength: (2007 CODATA)
ProtonMass() Proton Mass: (2007 CODATA)
ProtonMassEnergyEquivalent() Proton Mass Energy Equivalent: (2007 CODATA)
ProtonMolarMass() Proton Molar Mass: (2007 CODATA)
ProtonComptonWavelength() Proton Compton Wavelength: (2007 CODATA)
ProtonMagneticMoment() Proton Magnetic Moment: (2007 CODATA)
ProtonGFactor() Proton G-Factor: (2007 CODATA)
ShieldedProtonMagneticMoment() Proton Shielded Magnetic Moment: (2007 CODATA)
ProtonGyromagneticRatio() Proton Gyro-Magnetic Ratio: (2007 CODATA)
ShieldedProtonGyromagneticRatio() Proton Shielded Gyro-Magnetic Ratio: (2007 CODATA)
NeutronMass() Neutron Mass: (2007 CODATA)
NeutronMassEnegryEquivalent() Neutron Mass Energy Equivalent: (2007 CODATA)
NeutronMolarMass() Neutron Molar Mass: (2007 CODATA)
NeutronComptonWavelength() Neuron Compton Wavelength: (2007 CODATA)
NeutronMagneticMoment() Neutron Magnetic Moment: (2007 CODATA)
NeutronGFactor() Neutron G-Factor: (2007 CODATA)
NeutronGyromagneticRatio() Neutron Gyro-Magnetic Ratio: (2007 CODATA)
DeuteronMass() Deuteron Mass: (2007 CODATA)
DeuteronMassEnegryEquivalent() Deuteron Mass Energy Equivalent: (2007 CODATA)
DeuteronMolarMass() Deuteron Molar Mass: (2007 CODATA)
DeuteronMagneticMoment() Deuteron Magnetic Moment: (2007 CODATA)
HelionMass() Helion Mass: (2007 CODATA)
HelionMassEnegryEquivalent() Helion Mass Energy Equivalent: (2007 CODATA)
HelionMolarMass() Helion Molar Mass: (2007 CODATA)
Avogadro() Avogadro constant: (2010 CODATA)
Vector2OperationsLibrary "Vector2Operations"
functions to handle vector2 operations.
math_fractional(_value) computes the fractional part of the argument value.
Parameters:
_value : float, value to compute.
Returns: float, fractional part.
atan2(_a) Approximation to atan2 calculation, arc tangent of y/ x in the range radians.
Parameters:
_a : vector2 in the form of a array .
Returns: float, value with angle in radians. (negative if quadrante 3 or 4)
set_x(_a, _value) Set the x value of vector _a.
Parameters:
_a : vector2 in the form of a array .
_value : value to replace x value of _a.
Returns: void Modifies vector _a.
set_y(_a, _value) Set the y value of vector _a.
Parameters:
_a : vector in the form of a array .
_value : value to replace y value of _a.
Returns: void Modifies vector _a.
get_x(_a) Get the x value of vector _a.
Parameters:
_a : vector in the form of a array .
Returns: float, x value of the vector _a.
get_y(_a) Get the y value of vector _a.
Parameters:
_a : vector in the form of a array .
Returns: float, y value of the vector _a.
get_xy(_a) Return the tuple of vector _a in the form
Parameters:
_a : vector2 in the form of a array .
Returns:
length_squared(_a) Length of vector _a in the form. , for comparing vectors this is computationaly lighter.
Parameters:
_a : vector in the form of a array .
Returns: float, squared length of vector.
length(_a) Magnitude of vector _a in the form.
Parameters:
_a : vector in the form of a array .
Returns: float, Squared length of vector.
vmin(_a) Lowest element of vector.
Parameters:
_a : vector in the form of a array .
Returns: float
vmax(_a) Highest element of vector.
Parameters:
_a : vector in the form of a array .
Returns: float
from(_value) Assigns value to a new vector x,y elements.
Parameters:
_value : x and y value of the vector. optional.
Returns: float vector.
new(_x, _y) Creates a prototype array to handle vectors.
Parameters:
_x : float, x value of the vector. optional.
_y : float, y number of the vector. optional.
Returns: float vector.
down() Vector in the form . Returns: float vector.
left() Vector in the form . Returns: float vector.
one() Vector in the form . Returns: float vector.
right() Vector in the form . Returns: float vector
up() Vector in the form . Returns: float vector
zero() Vector in the form . Returns: float vector
add(_a, _b) Adds vector _b to _a, in the form
.
Parameters:
_a : vector in the form of a array .
_b : vector in the form of a array .
Returns:
subtract(_a, _b) Subtract vector _b from _a, in the form
.
Parameters:
_a : vector in the form of a array .
_b : vector in the form of a array .
Returns:
multiply(_a, _b) Multiply vector _a with _b, in the form
Parameters:
_a : vector in the form of a array .
_b : vector in the form of a array .
Returns:
divide(_a, _b) Divide vector _a with _b, in the form
Parameters:
_a : vector in the form of a array .
_b : vector in the form of a array .
Returns:
negate(_a) Negative of vector _a, in the form
Parameters:
_a : vector in the form of a array .
Returns:
perp(_a) Perpendicular Vector of _a.
Parameters:
_a : vector in the form of a array .
Returns:
vfloor(_a) Compute the floor of argument vector _a.
Parameters:
_a : vector in the form of a array .
Returns:
fractional(_a) Compute the fractional part of the elements from vector _a.
Parameters:
_a : vector in the form of a array .
Returns:
vsin(_a) Compute the sine of argument vector _a.
Parameters:
_a : vector in the form of a array .
Returns:
equals(_a, _b) Compares two vectors
Parameters:
_a : vector in the form of a array .
_b : vector in the form of a array .
Returns: boolean value representing the equality.
dot(_a, _b) Dot product of 2 vectors, in the form
Parameters:
_a : vector in the form of a array .
_b : vector in the form of a array .
Returns: float
cross_product(_a, _b) cross product of 2 vectors, in the form
Parameters:
_a : vector in the form of a array .
_b : vector in the form of a array .
Returns: float
scale(_a, _scalar) Multiply a vector by a scalar.
Parameters:
_a : vector in the form of a array .
_scalar : value to multiply vector elements by.
Returns: float vector
normalize(_a) Vector _a normalized with a magnitude of 1, in the form.
Parameters:
_a : vector in the form of a array .
Returns: float vector
rescale(_a) Rescale a vector to a new Magnitude.
Parameters:
_a : vector in the form of a array .
Returns:
rotate(_a, _radians) Rotates vector _a by angle value
Parameters:
_a : vector in the form of a array .
_radians : Angle value.
Returns:
rotate_degree(_a, _degree) Rotates vector _a by angle value
Parameters:
_a : vector in the form of a array .
_degree : Angle value.
Returns:
rotate_around(_center, _target, _degree) Rotates vector _target around _origin by angle value
Parameters:
_center : vector in the form of a array .
_target : vector in the form of a array .
_degree : Angle value.
Returns:
vceil(_a, _digits) Ceils vector _a
Parameters:
_a : vector in the form of a array .
_digits : digits to use as ceiling.
Returns:
vpow(_a) Raise both vector elements by a exponent.
Parameters:
_a : vector in the form of a array .
Returns:
distance(_a, _b) vector distance between 2 vectors.
Parameters:
_a : vector in the form of a array .
_b : vector in the form of a array .
Returns: float, distance.
project(_a, _axis) Project a vector onto another.
Parameters:
_a : vector in the form of a array .
_axis : float vector2
Returns: float vector
projectN(_a, _axis) Project a vector onto a vector of unit length.
Parameters:
_a : vector in the form of a array .
_axis : vector in the form of a array .
Returns: float vector
reflect(_a, _b) Reflect a vector on another.
Parameters:
_a : vector in the form of a array .
_b : vector in the form of a array .
Returns: float vector
reflectN(_a, _b) Reflect a vector to a arbitrary axis.
Parameters:
_a : vector in the form of a array .
_b : vector in the form of a array .
Returns: float vector
angle(_a) Angle in radians of a vector.
Parameters:
_a : vector in the form of a array .
Returns: float
angle_unsigned(_a, _b) unsigned degree angle between 0 and +180 by given two vectors.
Parameters:
_a : vector in the form of a array .
_b : vector in the form of a array .
Returns: float
angle_signed(_a, _b) Signed degree angle between -180 and +180 by given two vectors.
Parameters:
_a : vector in the form of a array .
_b : vector in the form of a array .
Returns: float
angle_360(_a, _b) Degree angle between 0 and 360 by given two vectors
Parameters:
_a : vector in the form of a array .
_b : vector in the form of a array .
Returns: float
clamp(_a, _vmin, _vmax) Restricts a vector between a min and max value.
Parameters:
_a : vector in the form of a array .
_vmin : vector in the form of a array .
_vmax : vector in the form of a array .
Returns: float vector
lerp(_a, _b, _rate_of_move) Linearly interpolates between vectors a and b by _rate_of_move.
Parameters:
_a : vector in the form of a array .
_b : vector in the form of a array .
_rate_of_move : float value between (a:-infinity -> b:1.0), negative values will move away from b.
Returns: vector in the form of a array
herp(_a, _b, _rate_of_move) Hermite curve interpolation between vectors a and b by _rate_of_move.
Parameters:
_a : vector in the form of a array .
_b : vector in the form of a array .
_rate_of_move : float value between (a-infinity -> b1.0), negative values will move away from b.
Returns: vector in the form of a array
area_triangle(_a, _b, _c) Find the area in a triangle of vectors.
Parameters:
_a : vector in the form of a array .
_b : vector in the form of a array .
_c : vector in the form of a array .
Returns: float
to_string(_a) Converts vector _a to a string format, in the form "(x, y)"
Parameters:
_a : vector in the form of a array .
Returns: string in "(x, y)" format
vrandom(_max) 2D random value
Parameters:
_max : float vector, vector upper bound
Returns: vector in the form of a array
noise(_a) 2D Noise based on Morgan McGuire @morgan3d
thebookofshaders.com
www.shadertoy.com
Parameters:
_a : vector in the form of a array .
Returns: vector in the form of a array
array_new(_size, _initial_vector) Prototype to initialize a array of vectors.
Parameters:
_size : size of the array.
_initial_vector : vector to be used as default value, in the form of array .
Returns: _vector_array complex Array in the form of a array
array_size(_id) number of vector elements in array.
Parameters:
_id : ID of the array.
Returns: int
array_get(_id, _index) Get the vector in a array, in the form of a array
Parameters:
_id : ID of the array.
_index : Index of the vector.
Returns: vector in the form of a array
array_set(_id, _index, _a) Sets the values vector in a array.
Parameters:
_id : ID of the array.
_index : Index of the vector.
_a : vector, in the form .
Returns: Void, updates array _id.
array_push(_id, _a) inserts the vector at the end of array.
Parameters:
_id : ID of the array.
_a : vector, in the form .
Returns: Void, updates array _id.
array_unshift(_id, _a) inserts the vector at the begining of array.
Parameters:
_id : ID of the array.
_a : vector, in the form .
Returns: Void, updates array _id.
array_pop(_id, _a) removes the last vector of array and returns it.
Parameters:
_id : ID of the array.
_a : vector, in the form .
Returns: vector2, updates array _id.
array_shift(_id, _a) removes the first vector of array and returns it.
Parameters:
_id : ID of the array.
_a : vector, in the form .
Returns: vector2, updates array _id.
array_sum(_id) Total sum of all vectors.
Parameters:
_id : ID of the array.
Returns: vector in the form of a array
array_center(_id) Finds the vector center of the array.
Parameters:
_id : ID of the array.
Returns: vector in the form of a array
array_rotate_points(_id) Rotate Array vectors around origin vector by a angle.
Parameters:
_id : ID of the array.
Returns: rotated points array.
array_scale_points(_id) Scale Array vectors based on a origin vector perspective.
Parameters:
_id : ID of the array.
Returns: rotated points array.
array_tostring(_id, _separator) Reads a array of vectors into a string, of the form " ""
Parameters:
_id : ID of the array.
_separator : string separator for cell splitting.
Returns: string Translated complex array into string.
line_new(_a, _b) 2 vector line in the form.
Parameters:
_a : vector, in the form .
_b : vector, in the form .
Returns:
line_get_a(_line) Start vector of a line.
Parameters:
_line : vector4, in the form .
Returns: float vector2
line_get_b(_line) End vector of a line.
Parameters:
_line : vector4, in the form .
Returns: float vector2
line_intersect(_line1, _line2) Find the intersection vector of 2 lines.
Parameters:
_line1 : line of 2 vectors in the form of a array .
_line2 : line of 2 vectors in the form of a array .
Returns: vector in the form of a array .
draw_line(_line, _xloc, _extend, _color, _style, _width) Draws a line using line prototype.
Parameters:
_line : vector4, in the form .
_xloc : string
_extend : string
_color : color
_style : string
_width : int
Returns: draw line object
draw_triangle(_v1, _v2, _v3, _xloc, _color, _style, _width) Draws a triangle using line prototype.
Parameters:
_v1 : vector4, in the form .
_v2 : vector4, in the form .
_v3 : vector4, in the form .
_xloc : string
_color : color
_style : string
_width : int
Returns: tuple with 3 line objects.
draw_rect(_v1, _size, _angle, _xloc, _color, _style, _width) Draws a square using vector2 line prototype.
Parameters:
_v1 : vector4, in the form .
_size : float
_angle : float
_xloc : string
_color : color
_style : string
_width : int
Returns: tuple with 3 line objects.
HarmonicPatternLibrary "HarmonicPattern"
Functions to detect/check harmonic patterns from provided values.
line_price_rate(point_c, point_b, point_a) Compute the price rate of the line AB divided by the the line BC
Parameters:
point_c : float, the price at point C.
point_b : float, the price at point B.
point_a : float, the price at point A.
Returns: float
line_time_rate(_c, _b, _a) Compute the time rate of the line AB divided by the the line BC
Parameters:
_c : float, the time or bar_index at point C.
_b : float, the time or bar_index at point B.
_a : float, the time or bar_index at point A.
Returns: float
is_inrange(value, min, max) Check if value is within min/max range of tolerance.
Parameters:
value : float, value to check tolerance.
min : float, minimum value in range of tolerance.
max : float, maximum value in range of tolerance.
Returns: bool
isHarmonicTriangle(rate_cba, margin_of_error) Check if the rate(s) correspond to pattern ("Harmonic Triangle").
Parameters:
rate_cba : float, percent rate of the triangle CBA. expects a negative rate.
margin_of_error : float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
is2Tap(rate_cba, margin_of_error) Check if the rate(s) correspond to pattern ("2Tap", 'Double Top / Bottom').
Parameters:
rate_cba : float, percent rate of the triangle CBA. expects a negative rate.
margin_of_error : float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
is3Tap(rate_edc, rate_cba, margin_of_error) Check if the rate(s) correspond to pattern ("3Tap", "Triple Top / Bottom").
Parameters:
rate_edc : float, percent rate of the triangle EDC. expects a negative rate.
rate_cba : float, percent rate of the triangle CBA. expects a negative rate.
margin_of_error : float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
is4Tap(rate_gfe, rate_edc, rate_cba, margin_of_error) Check if the rate(s) correspond to pattern ("4Tap", "Quadruple Top / Bottom").
Parameters:
rate_gfe : float, percent rate of the triangle GFE. expects a negative rate.
rate_edc : float, percent rate of the triangle EDC. expects a negative rate.
rate_cba : float, percent rate of the triangle CBA. expects a negative rate.
margin_of_error : float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isABCD(rate_cba, rate_dcb, margin_of_error) Check if the rate(s) correspond to pattern ("AB=CD").
Parameters:
rate_cba : float, percent rate of the triangle CBA. expects a negative rate.
rate_dcb : float, percent rate of the triangle DCB. expects a negative rate.
margin_of_error : float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isBat(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Bat").
Parameters:
rate_edc : float, percent rate of the triangle EDC. expects a negative rate.
rate_dcb : float, percent rate of the triangle DCB. expects a negative rate.
rate_cba : float, percent rate of the triangle CBA. expects a negative rate.
rate_eda : float, percent rate of the triangle EDA. expects a negative rate.
margin_of_error : float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isButterfly(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Butterfly").
Parameters:
rate_edc : float, percent rate of the triangle EDC. expects a negative rate.
rate_dcb : float, percent rate of the triangle DCB. expects a negative rate.
rate_cba : float, percent rate of the triangle CBA. expects a negative rate.
rate_eda : float, percent rate of the triangle EDA. expects a negative rate.
margin_of_error : float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isGartley(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Gartley").
Parameters:
rate_edc : float, percent rate of the triangle EDC. expects a negative rate.
rate_dcb : float, percent rate of the triangle DCB. expects a negative rate.
rate_cba : float, percent rate of the triangle CBA. expects a negative rate.
rate_eda : float, percent rate of the triangle EDA. expects a negative rate.
margin_of_error : float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isCrab(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Crab").
Parameters:
rate_edc : float, percent rate of the triangle EDC. expects a negative rate.
rate_dcb : float, percent rate of the triangle DCB. expects a negative rate.
rate_cba : float, percent rate of the triangle CBA. expects a negative rate.
rate_eda : float, percent rate of the triangle EDA. expects a negative rate.
margin_of_error : float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isShark(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Shark").
Parameters:
rate_edc : float, percent rate of the triangle EDC. expects a negative rate.
rate_dcb : float, percent rate of the triangle DCB. expects a negative rate.
rate_cba : float, percent rate of the triangle CBA. expects a negative rate.
rate_eda : float, percent rate of the triangle EDA. expects a negative rate.
margin_of_error : float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
is5o(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("5o").
Parameters:
rate_edc : float, percent rate of the triangle EDC. expects a negative rate.
rate_dcb : float, percent rate of the triangle DCB. expects a negative rate.
rate_cba : float, percent rate of the triangle CBA. expects a negative rate.
rate_eda : float, percent rate of the triangle EDA. expects a negative rate.
margin_of_error : float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isWolfe(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Wolfe").
Parameters:
rate_edc : float, percent rate of the triangle EDC. expects a negative rate.
rate_dcb : float, percent rate of the triangle DCB. expects a negative rate.
rate_cba : float, percent rate of the triangle CBA. expects a negative rate.
rate_eda : float, percent rate of the triangle EDA. expects a negative rate.
margin_of_error : float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
is3Driver(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("3 Driver").
Parameters:
rate_edc : float, percent rate of the triangle EDC. expects a negative rate.
rate_dcb : float, percent rate of the triangle DCB. expects a negative rate.
rate_cba : float, percent rate of the triangle CBA. expects a negative rate.
rate_eda : float, percent rate of the triangle EDA. expects a negative rate.
margin_of_error : float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isConTria(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Contracting Triangle").
Parameters:
rate_edc : float, percent rate of the triangle EDC. expects a negative rate.
rate_dcb : float, percent rate of the triangle DCB. expects a negative rate.
rate_cba : float, percent rate of the triangle CBA. expects a negative rate.
rate_eda : float, percent rate of the triangle EDA. expects a negative rate.
margin_of_error : float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isExpTria(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Expanding Triangle").
Parameters:
rate_edc : float, percent rate of the triangle EDC. expects a negative rate.
rate_dcb : float, percent rate of the triangle DCB. expects a negative rate.
rate_cba : float, percent rate of the triangle CBA. expects a negative rate.
rate_eda : float, percent rate of the triangle EDA. expects a negative rate.
margin_of_error : float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isHnS(rate_fed, rate_feb, rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Head and Shoulders").
Parameters:
rate_fed : float, percent rate of the triangle FED. expects a negative rate.
rate_feb : float, percent rate of the triangle FEB. expects a negative rate.
rate_edc : float, percent rate of the triangle EDC. expects a negative rate.
rate_dcb : float, percent rate of the triangle DCB. expects a negative rate.
rate_cba : float, percent rate of the triangle CBA. expects a negative rate.
rate_eda : float, percent rate of the triangle EDA. expects a negative rate.
margin_of_error : float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
AnalysisInterpolationLoessLibrary "AnalysisInterpolationLoess"
LOESS, local weighted Smoothing function.
loess(sample_x, sample_y, point_span) LOESS, local weighted Smoothing function.
Parameters:
sample_x : int array, x values.
sample_y : float array, y values.
point_span : int, local point interval span.
aloess(sample_x, sample_y, point_span) aLOESS, adaptive local weighted Smoothing function.
Parameters:
sample_x : int array, x values.
sample_y : float array, y values.
point_span : int, local point interval span.
MathConstantsLibrary "MathConstants"
Mathematical Constants
E() The number e
Log2E() The number log (e)
Log10E() The number log (e)
Ln2() The number log (2)
Ln10() The number log (10)
LnPi() The number log (pi)
Ln2PiOver2() The number log (2*pi)/2
InvE() The number 1/e
SqrtE() The number sqrt(e)
Sqrt2() The number sqrt(2)
Sqrt3() The number sqrt(3)
Sqrt1Over2() The number sqrt(1/2) = 1/sqrt(2) = sqrt(2)/2
HalfSqrt3() The number sqrt(3)/2
Pi() The number pi
Pi2() The number pi*2
PiOver2() The number pi/2
Pi3Over2() The number pi*3/2
PiOver4() The number pi/4
SqrtPi() The number sqrt(pi)
Sqrt2Pi() The number sqrt(2pi)
SqrtPiOver2() The number sqrt(pi/2)
Sqrt2PiE() The number sqrt(2*pi*e)
LogSqrt2Pi() The number log(sqrt(2*pi))
LogSqrt2PiE() The number log(sqrt(2*pi*e))
LogTwoSqrtEOverPi() The number log(2 * sqrt(e / pi))
InvPi() The number 1/pi
TwoInvPi() The number 2/pi
InvSqrtPi() The number 1/sqrt(pi)
InvSqrt2Pi() The number 1/sqrt(2pi)
TwoInvSqrtPi() The number 2/sqrt(pi)
TwoSqrtEOverPi() The number 2 * sqrt(e / pi)
Degree() The number (pi)/180 - factor to convert from Degree (deg) to Radians (rad).
Grad() The number (pi)/200 - factor to convert from NewGrad (grad) to Radians (rad).
PowerDecibel() The number ln(10)/20 - factor to convert from Power Decibel (dB) to Neper (Np). Use this version when the Decibel represent a power gain but the compared values are not powers (e.g. amplitude, current, voltage).
NeutralDecibel() The number ln(10)/10 - factor to convert from Neutral Decibel (dB) to Neper (Np). Use this version when either both or neither of the Decibel and the compared values represent powers.
Catalan() The Catalan constant
Sum(k=0 -> inf){ (-1)^k/(2*k + 1)2 }
EulerMascheroni() The Euler-Mascheroni constant
lim(n -> inf){ Sum(k=1 -> n) { 1/k - log(n) } }
GoldenRatio() The number (1+sqrt(5))/2, also known as the golden ratio
Glaisher() The Glaisher constant
e^(1/12 - Zeta(-1))
Khinchin() The Khinchin constant
prod(k=1 -> inf){1+1/(k*(k+2))^log(k,2)}
Euler Cubes - CubᵋI give you the "Euler Cubes", inspired by the mathematical number 'e' (Euler's number).
It is suggested (fibonacci ratios analogy) that price/e ratio can give Support/Resistance area's.
The first cube is made by a low/high of choice, for example:
You set the 'source low'/'source high' in position:
Then you choose the 'e ratio' (x times 'e')
This multiplies the distance 'high-low' times '0.271828' times 'the set number' .
For example, choosing 5 gives 5 x 0.271828 = 1.35914, the distance 'high-low' hereby multiplied by 1.35914, the following cubes multiply the previous distance by 1.35914.
(Settings below 5 will give cubes smaller than the 'high-low' distance)
In the case of x times 'e' = 5:
You can extend the lines:
Now you can give it an angle:
Do mind, using it over very little bars and using an angle can cause some lines to not align as intended, because for now, it is not possible to plot in between bars.
There are also 'Euler' SMA and EMA available with following length's:
27, 54, 82,109, 136, 163, 190 and 217
Cheers!
Function: Dinamic string InterpreterEXPERIMENTAL:
a arithmetic string interpreter that allows for using basic operations on input strings.
note: float values not supported currently.
UCS_Murrey's Math Oscillator_V2Hello, Murrey Math lovers, Thanks for those who showed interest on this. Based on a request, I have updated the plot / candle coloring, for Version - 2.
This has been in the queue for a while.
There was a Glitch found with the Multiplier. Will Fix in the next version. The Current Version (and the previous version) only supports 1/8 fractions. Will not support 0.25. The code needs to be updated, to automate the fractal line glitches for other ratios, Planned for future update.
Good Luck and Enjoy the Colorful Oscillator. Please keep your suggestions flowing. Lets make it better.
UCS_Murrey's Math OscillatorThis is a new indicator release, Using the principle of Murrey Math Line Trading Systems. It will be easier for someone to add alerts on an oscillator rather than a overlay.
Currently, I did add some aesthetics for those who like to view different colors, can be turned off.
Oscillator Color Definition -
Green = Above MidLine
Red = Below Midline
Blue = Below Negative 3rd Quadrant
Orange = Above Positive 3rd Quadrant
/////////
Planned future Improvement is to consider Wicks as well.
Do post your opinions and any improvement.
GL.
Candlestick MathThis is an updated version of my previous post, with the option to specify which symbol you want it to show up on.
This is a script I made to do what is called candlestick math (if you're not sure, Google it). It will take the first open, the last close, and the highest high and lowest low from a range of candlesticks, and plot it on top of the chart.
Unfortunately, there is no way to make it so you can move it with your mouse, and the bar numbering is not the same as the regular drawing tools, so to figure out what the line number is, create a new script with the text:
study("Plot N")
plot(n)
This will create another chart that will show you the bar numbers that correspond to the script's bar numbers. From there, figure out where you want to start the candlestick math, and enter that number in the "Start" field in the inputs for this script.
Candlestick Math(Re-post with better graph)
This is a script I made to do what is called candlestick math (if you're not sure, Google it). It will take the first open, the last close, and the highest high and lowest low from a range of candlesticks, and plot it on top of the chart.
Unfortunately, there is no way to make it so you can move it with your mouse, and the bar numbering is not the same as the regular drawing tools, so to figure out what the line number is, create a new script with the text:
study("Plot N")
plot(n)
This will create another chart that will show you the bar numbers that correspond to the script's bar numbers. From there, figure out where you want to start the candlestick math, and enter that number in the "Start" field in the inputs for this script.
Candlestick MathThis is a script I made to do what is called candlestick math (if you're not sure, Google it). It will take the first open, the last close, and the highest high and lowest low from a range of candlesticks, and plot it on top of the chart.
Unfortunately, there is no way to make it so you can move it with your mouse, and the bar numbering is not the same as the regular drawing tools, so to figure out what the line number is, create a new script with the text:
study("Plot N")
plot(n)
This will create another chart that will show you the bar numbers that correspond to the script's bar numbers. From there, figure out where you want to start the candlestick math, and enter that number in the "Start" field in the inputs for this script.