Library "MathTrigonometry" Trigonometric methods. sinc(value) Normalized sinc function. Parameters: value : float, value. Returns: float. cot(value) Cotangent of value. Parameters: value : float, value. Returns: float. csc(value) Cosecant of value. Parameters: value : float, value. Returns: float. sec(value) Secant of...
Library "MathSearchDijkstra" Shortest Path Tree Search Methods using Dijkstra Algorithm. min_distance(distances, flagged_vertices) Find the lowest cost/distance. Parameters: distances : float array, data set with distance costs to start index. flagged_vertices : bool array, data set with visited vertices flags. Returns: int, lowest cost/distance...
Library "MathGaussFunction" Implements multiple gauss methods. f_1d(point_x, sigma) 1-D Gaussian function. Parameters: point_x : float, x value. sigma : float, sigma value, default=1.0. Returns: float, function's value at point_x. f_2d(point_x, point_y, sigma) 2-D Gaussian function. Parameters: point_x : float, x value. point_y : float, y...
Library "MathFinancialAbsoluteRiskMeasures" Financial Absolute Risk Measures. gain_stdev(sample) Standard deviation of gains in a data sample. Parameters: sample : float array, data sample. Returns: float. loss_stdev(sample) Standard deviation of losses in a data sample. Parameters: sample : float array, data sample. Returns: float. ...
Library "MathOperator" Methods to handle operators. add(value_a, value_b) Add value a to b. Parameters: value_a : float, value a. value_b : float, value b. Returns: float. subtract(value_a, value_b) subtract value b from a. Parameters: value_a : float, value a. value_b : float, value b. Returns: float. multiply(value_a, value_b) ...
Library "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 ...
Library "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,...
Library "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 ...
Library "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 ...
Library "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 ...
Library "NumberOfSharesBuy" Library for the number of shares purchased SizeCalc(totalAssets, unit, lossPercent, maxLossPerShere) Calculate the number of shares to be purchased from the initial capital and the maximum loss per share Parameters: totalAssets : Initial capital unit : A unit of the number of shares to be traded in one trade lossPercent :...
Library "enhanced_ta" Collection of all custom and enhanced TA indicators ma(source, maType, length) returns custom moving averages Parameters: source : Moving Average Source maType : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow length : Moving Average Length Returns: moving average for the given type and length ...
Library "RS" Utility methods for Relative Strength analysis This is the first library test publication with ratio() method. More functions will be added. ratio(symbol, benchmark) Simple ratio of symbol vs benchmark Parameters: symbol : to be compared benchmark : to be compared Returns: ratio of symbol to benchmark
Library "bursamalaysianonshariah" List of non-Shariah stock for Bursa Malaysia as of Oct 2021 No parameter required status() will return 1 if ticker in the list, 0 if ticker not in the list and 2 if ticker not from Bursa Malaysia Example usage : //@version=5 indicator("My Script", overlay = true) import BURSATRENDBANDCHART/bursamalaysianonshariah/1 as...
Library "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...
Library "SignalProcessingClusteringKMeans" K-Means Clustering Method. nearest(point_x, point_y, centers_x, centers_y) finds the nearest center to a point and returns its distance and center index. Parameters: point_x : float, x coordinate of point. point_y : float, y coordinate of point. centers_x : float array, x coordinates of cluster centers. ...
Library "FunctionDatestring" Methods to stringify date/time, altho there is already builtin support for it. datetime(unixtime) a stringified date stamp at specified unix time. Parameters: unixtime : int unix timestamp. Returns: string date_(unixtime) a stringified date stamp at specified unix time. Parameters: unixtime : int unix timestamp....
Library "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 ...