Implementation of functions related to data correlation calculations. Formulas have been transformed in such a way that we avoid running loops and instead make use of time series to gradually build the data we need to perform calculation. This allows the calculations to run on unbound series, and/or higher number of samples
Here is a perfectly replicated TradingView backtesting engine condensed into a single library function calculated with arrays. It includes TradingView's calculations for Net profit, Total Trades, Percent of Trades Profitable, Profit Factor, Max Drawdown (absolute and percent), and Average Trade (absolute and percent). Here's how TradingView...
Returns the smoothed hyperbolic tangent of the input series.
src : The input series (i.e., the first-order derivative for price).
quadraticMeanLength : The length of the quadratic mean (RMS).
Returns: nDeriv The normalized derivative of the input series.
Collection of types and functions that can be used for the calculation of the percentage of a distance from a barrier price using several methods. Methods supported are percentagewise (PERC), atr-based (ATR), local extrema (LOC), tick-based (TICKS) and risk reward ratio (RR)
This library contains functions that try to analyze trading signals performance.
Like the % of average returns after a long or short signal is provided or the number of times that signal was correct, in the inmediate 2 candles after the signal.
This library holds technical analysis functions calculating values for which no Pine built-in exists.
Look first. Then leap.
cagr(entryTime, entryPrice, exitTime, exitPrice)
It calculates the "Compound Annual Growth Rate" between two points in time. The CAGR is a notional, annualized growth rate that...
This library provides non-repainting kernel functions for Nadaraya-Watson estimator implementations. This allows for easy substitution/comparison of different kernel functions for one another in indicators. Furthermore, kernels can easily be combined with other kernels to create newer, more customized kernels. Compared to Moving...
General technical analysis functions
div_bull(pS, iS, cp_length_after, cp_length_before, pivot_length, lookback, no_broken, pW, iW, hidW, regW)
Test for bullish divergence
pS : Price series (float)
iS : Indicator series (float)
cp_length_after : Bars after current (divergent) pivot low to be considered a valid...
Feel free to contribute for an extended version. 😊 Still in development.
We hope you enjoy it! 🎉
CRYPTOLINX - jango_blockchained 😊👍
*** MORE EXAMPLE WILL COMING UP SOON ***
Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon...
Collection of experimental kNN functions. This is a work in progress, an improvement upon my original kNN script:
The script can be recreated with this library. Unlike the original script, that used multiple arrays, this has been reworked with the new Pine Script matrix features.
To make a kNN prediction, the following data should be supplied...
The Net Liquidity Library provides daily values for net liquidity. Net liquidity is measured as Fed Balance Sheet - Treasury General Account - Reverse Repo. Time series for each individual component included too.
Function takes date in timestamp form and returns the Net Liquidity value for that...
Calculates a divergence between 2 series
bullish(_src, _low, depth) Calculates bullish divergence
_src : Main series
_low : Comparison series (`low` is used if no argument is supplied)
depth : Fractal Depth (`2` is used if no argument is supplied)
Returns: 2 boolean values for regular and hidden...
Kelly criterion methods.
the kelly criterion helps with the decision of how much one should invest in
a asset as long as you know the odds and expected return of said asset.
simplified version of the kelly criterion formula.
win_p : float, probability of winning.
rr : float,...
Fourier Transform for Traders By John Ehlers, slightly modified to allow to inspect other than the 8-50 frequency spectrum.
high_pass_filter(source) Detrended version of the data by High Pass Filtering with a 40 Period cutoff
source : float, data source.
Performs Polynomial Regression fit to data.
In statistics, polynomial regression is a form of regression analysis in which
the relationship between the independent variable x and the dependent variable
y is modelled as an nth degree polynomial in x.
gauss_elimination(A, m, n) ...
Provides a data set of the monthly mean air temperature (°C) for the city of Tokyo in Japan.
this was just for fun, no financial implications in this.
TOKYO WMO Station ID:47662 Lat 35o41.5'N Lon 139o45.0'E
the years of the data set.
Returns: array : year values.