Library "Interpolation" Functions for interpolating values. Can be useful in signal processing or applied as a sigmoid function. linear(k, delta, offset, unbound) Returns the linear adjusted value. Parameters: k : A number (float) from 0 to 1 representing where the on the line the value is. delta : The amount the value should change as k reaches...
Library "FunctionPeakDetection" Method used for peak detection, similar to MATLAB peakdet method function(sample_x, sample_y, delta) Method for detecting peaks. Parameters: sample_x : float array, sample with indices. sample_y : float array, sample with data. delta : float, positive threshold value for detecting a peak. Returns: tuple with...
Library "CRCLog" default_params() Returns default high/low intercept/slope parameter values for Bitcoin that can be adjusted and used to calculate new Regression Log lines log_regression() Returns set of (fib) spaced lines representing log regression (default values attempt fitted to INDEX:BTCUSD genesis-2021)
Library "Library_RICH" TODO: add library description here sum(x) TODO: add function description here Parameters: x : TODO: add parameter x description here Returns: TODO: add what function returns checkBuyReversal() : ckeck if there are buy reversal conditions (divergences) in rsi insure that the bar count since the last pivot low is within the...
Library "Averages" Contains utilities for generating averages from arrays. Useful for manipulated or cleaned data. triangular(src, startingWeight) Calculates the triangular weighted average of a set of values where the last value has the highest weight. Parameters: src : The array to derive the average from. startingWeight : The weight to begin...
Library "DailyDeviation" Helps in determining the relative deviation from the open of the day compared to the high or low values. hlcDeltaArrays(daysPrior, maxDeviation, spec, res) Retuns a set of arrays representing the daily deviation of price for a given number of days. Parameters: daysPrior : Number of days back to get the close from. ...
Library "CRCBars" min_max(open, open) Get bar min (low) and max (high) price points Parameters: open : Open price data open : Close price data Returns: is_bullish_bearish(open, open) Get bar bullish/bearish boolean signals Parameters: open : Open price data open : Close price data Returns: sizes(open, open, open, open) ...
Library "CRCChars" arrow_up() : ▲ arrow_down() : ▼ warning() : ⚠ checkmark() : ✅ no_entry() : 🚫
Library "CRCPaint" black(trans) Parameters: trans : Transparency value (float) Returns: color -------------------------------------------------------------------------- // white() silver() gray() fuchsia() maroon() red() orange() yellow() blue() navy() aqua() purple() teal() green() lime() ...
Library "options_expiration_and_strike_price_calculator" TODO: add library description here fun() this is a library to help calculate options strike price and expiration that you can add to a script i use it mainly for symbol calulation to place orders to buy options on TD ameritrade so it will be set up to order options on TD ameritrade using json order...
Library "ConverterTF" I have found a bug Regarding the timeframe display, on the chart I have found that the display is numeric, for example 4Hr timeframe instead of '4H', but it turns out to be '240', which I want it to be displayed in abbreviated form. And in all other timeframes it's the same. So this library was created to solve those problems. It converts...
Library "TradingPortfolio" Simple functions for portfolio management. A portfolio is essentially a float array with 3 positions that gets passed around into these functions that ensure it gets properly updated as trading ensues. An example usage: import hugodanielcom/TradingPortfolio/XXXX as portfolio var float my_portfolio = portfolio.init(0.0,...
Library "lib_Indicators_v2_DTU" This library functions returns included Moving averages, indicators with factorization, functions candles, function heikinashi and more. Created it to feed as backend of my indicator/strategy "Indicators & Combinations Framework Advanced v2 " that will be released ASAP. This is replacement of my previous indicator...
Library "Last_Available_Bar_Info" getLastBarTimeStamp() getAvailableBars() This simple library is built with an aim of getting the last available bar information for the chart. This returns a constant value that doesn't change on bar change. For backtesting with accurate results on non standard charts, it will be helpful. (Especially if you are using...
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...