Library "TypeMovingAverages" This library function returns a moving average. ma_fast ma_slow MA_selector() Example // This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org // © hapharmonic //@version=5 indicator("Test MATYPE", overlay=true) import hapharmonic/TypeMovingAverages/1 as MAType xprd1 =...
Quite recently TradingView added the possibility to create and use Libraries in PineScript. With this feature PineScript became higher quality of coding language overnight. Libraries enable splitting your code into multiple files, providing easier access to code reusability. I was working on a script which included 3000 lines of code, which was recompiling 1:30...
This library is used to convert Text type numbers are numbers. Library "StringtoNumber" str1 = '12340' , vv = numstrToNum(str1) numstrToNum() Example // This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org // © hapharmonic //@version=5 indicator("My Script") import hapharmonic/StringtoNumber/1 as CV TF =...
Library "PureRebalance" A rebalance function that is pure. Depends only on its arguments to perform the necessary calculations. rebalance(token_price, portfolio_token_amount, portfolio_fiat_amount, rebalance_ratio) Rebalances a portfolio made of tokens and fiat to a given ratio of tokens per fiat Parameters: token_price : The value of a single unit...
Library "SessionsInBoxesLib" Provides functions calculating the all-time high/low of values. get_positions() draw()
Library "FunctionZigZagMultipleMethods" ZigZag Multiple Methods. method(idx) Helper methods enumeration. Parameters: idx : int, index of method, range 0 to 4. Returns: string function(method, value_x, value_y) Multiple method ZigZag. Parameters: method : string, default='(MANUAL) Percent price move over X * Y', method for zigzag. ...
Library "MHCustomSpotTradingLibrary" HMA(float, float) Parameters: float : _src price data float : _length Period Returns: Hull Moving Average EHMA(float, float) Parameters: float : _src price data float : _length Period Returns: EHMA Moving Average THMA(float, float) Parameters: float : _src price data ...
Library "AwesomeColor" This library provides a variety of colors. The following functions all provide different sets of colors. The name of the function indicates the color scheme. The usage of arguments for all functions is the same. // @function {Color set name} // @param _color TODO: The name of the color group. // @returns TODO: Returns an array of colors.
Library "_arrayutils" Library contains utility functions using arrays. delete(arr, index) remove an item from array at specific index. Also deletes the item Parameters: arr : - array from which the item needs to be deleted index : - index of item to be deleted Returns: void pop(arr) remove the last item from array. Also deletes the...
Library "harmonicpatterns" harmonicpatterns: methods required for calculation of harmonic patterns. These are customised to be used in my scripts. But, also simple enough for others to make use of :) isGartleyPattern(xabRatio, abcRatio, bcdRatio, xadRatio, err_min, err_max) isGartleyPattern: Checks for harmonic pattern Gartley Parameters: xabRatio :...
Library "Signal_Data_2021_09_09__2021_11_18" Functions to support my timing signals system import_start_time(harmonic) get the start time for each harmonic signal Parameters: harmonic : is an integer identifying the harmonic Returns: the starting timestamp of the harmonic data import_signal(index, harmonic) access point for pre-processed data...
Library "ma_function" TODO: This library is a package of various MAs. ma_function(name, source, length) This function provides the MA specified in the argument. Parameters: name : MA's name source : Source value length : Look back periods Returns: Ma value
Library "TableColorTheme" TODO: This library provides the color for the table. monokai(name) theme: Provides the colors of monokai. Parameters: name : TODO: The name of the color group. Returns: TODO: Returns an array of colors. kolormark.com monokaipro(name) theme: Provides the colors of monokai pro. Parameters: name : TODO: The name of...
Library "LocalLimit" Calculates the local upper or local lower limit for a given series. Applying multiple passes produces what appears like support or resistance levels. See Local Limits for more detail. upper(src) Produces the recent local upper limit for a given series. Parameters: src : The source series to derive from. lower(src) Produces...
Library "UnicodeReplacementFunction" Unicode Characters Replacement function for strings. replaceFont(_str, _fontType) Unicode Character Replace Function Parameters: _str : String input _fontType : Font Type Selector Returns: Replaced Char String with any custom font type choosed
Library "SgjoeLibrary" Custom functions highest_when(float, float) Permits a condition to be used with highest(high,condition) Parameters: float : _high_series The High for the condition float : _when The condition such as close > high Returns: The high(s) at the point(s) the condition was true lowest_when(float, float) Permits a condition...
Library "MomentumSignals" Contains utilities varying algorithms for detecting key changes in momentum. Note: Momentum is not velocity and should be used in conjunction with other indicators. A change in momentum does not mean a reversal of velocity or trend. simple(primary, secondary, len) Compares two series for changes in momentum to derive signal...
Library "GenericTrading" This library aims to collect rare but useful operations for get_most_recent_long_or_short_position_closed_index() : returns most recent long/short closed bar index. get_most_recent_long_or_short_position_open_index() : returns most recent long/short closed bar index. These two functions designed to help to speed up the...