Pivots libraryLibrary "Pivots"
TODO: add library description here
pivots(_type, _open, _high, _low, _clsoe) Calculates the pivot point and returns its value.
Parameters:
_type : Specifies the type of pivot point.
_open : The open price
_high : The high price
_low : The low price
_clsoe : The close price
Returns: Returns the value of the calculated pivot point as a tuple.
cpr(_high, _low, _clsoe) Calculate the Central Pivot Range
Parameters:
_high : The high price
_low : The low price
_clsoe : The close price
Returns: Returns the values as a tuple.
htf_ohlc(_htf) Calculate the HTF values
Parameters:
_htf : Resolution
Returns: Returns the values as a tuple.
Indikator dan strategi
regressLibrary "regress"
produces the slope (beta), y-intercept (alpha) and coefficient of determination for a linear regression
regress(x, y, len) regress: computes alpha, beta, and r^2 for a linear regression of y on x
Parameters:
x : the explaining (independent) variable
y : the dependent variable
len : use the most recent "len" values of x and y
Returns: : alpha is the x-intercept, beta is the slope, an r2 is the coefficient of determination
Note: the chart does not show anything, use the return values to compute model values in your own application, if you wish.
LukashereLibrary "Lukashere"
TODO: add library description here
fun(x) TODO: add function description here
Parameters:
x : TODO: add parameter x description here
Returns: TODO: add what function returns
Percentual2nu()
getMA()
SymbolsTopMarketcap()
TitinhoIndicatorsLibraryOn this Library you cand find a shortcut for some indicators and just import them into your source.
Each indicator has its own input and output parameters and they are prety much self explanatory. :D
This is the list of the present indicators you can use with this library:
*Function_Adx()
*Function_Atr()
*Function_Mfi()
*Function_MovingAverage()
*Function_Sar()
*Function_Rsi()
*Function_StochasticRsi()
Have fun!!!
Ehlers_Super_SmootherThe 2 Pole and 3 Pole Super Smoother Filters were developed by John Ehlers and described in "Chapter 13: Super Smother" of his book Cybernetic Analysis for Stocks and Futures .
The 2 Pole Smoother is described as being a better approximation of price, whereas the 3 Pole Smoother has superior smoothing.
Library "Ehlers_Super_Smoother"
Provides the functions to calculate Double and Triple Exponentional Moving Averages (DEMA & TEMA)
twoPole(_source, _length) Calculates 2 Pole Ehlers Super Smoother Filter
Parameters:
_source : -> Open, Close, High, Low, etc ('close' is used if no argument is supplied)
_length : -> Ehlers Super Smoother length
Returns: 2 Pole Ehlers Super Smoothing to an input source at the specified input length
threePole(_source, _length) Calculates 3 Pole Ehlers Super Smoother Filter
Parameters:
_source : -> Open, Close, High, Low, etc ('close' is used if no argument is supplied)
_length : -> Ehlers Super Smoother length
Returns: 3 Pole Ehlers Super Smoothing to an input source at the specified input length
pandas_taLibrary "pandas_ta"
Level: 3
Background
Today is the first day of 2022 and happy new year every tradingviewers! May health and wealth go along with you all the time. I use this chance to publish my 1st PINE v5 lib : pandas_ta
This is not a piece of cake like thing, which cost me a lot of time and efforts to build this lib. Beyond 300 versions of this script was iterated in draft.
Function
Library "pandas_ta"
PINE v5 Counterpart of Pandas TA - A Technical Analysis Library in Python 3 at github.com
The Original Pandas Technical Analysis (Pandas TA) is an easy to use library that leverages the Pandas package with more than 130 Indicators and Utility functions and more than 60 TA Lib Candlestick Patterns.
I realized most of indicators except Candlestick Patterns because tradingview built-in Candlestick Patterns are even more powerful!
I use this to verify pandas_ta python version indicators for myself, but I realize that maybe many may need similar lib for pine v5 as well.
Function Brief Descriptions (Pls find details in script comments)
bton --> Binary to number
wcp --> Weighted Closing Price (WCP)
counter --> Condition counter
xbt --> Between
ebsw --> Even Better SineWave (EBSW)
ao --> Awesome Oscillator (AO)
apo --> Absolute Price Oscillator (APO)
xrf --> Dynamic shifted values
bias --> Bias (BIAS)
bop --> Balance of Power (BOP)
brar --> BRAR (BRAR)
cci --> Commodity Channel Index (CCI)
cfo --> Chande Forcast Oscillator (CFO)
cg --> Center of Gravity (CG)
cmo --> Chande Momentum Oscillator (CMO)
coppock --> Coppock Curve (COPC)
cti --> Correlation Trend Indicator (CTI)
dmi --> Directional Movement Index(DMI)
er --> Efficiency Ratio (ER)
eri --> Elder Ray Index (ERI)
fisher --> Fisher Transform (FISHT)
inertia --> Inertia (INERTIA)
kdj --> KDJ (KDJ)
kst --> 'Know Sure Thing' (KST)
macd --> Moving Average Convergence Divergence (MACD)
mom --> Momentum (MOM)
pgo --> Pretty Good Oscillator (PGO)
ppo --> Percentage Price Oscillator (PPO)
psl --> Psychological Line (PSL)
pvo --> Percentage Volume Oscillator (PVO)
qqe --> Quantitative Qualitative Estimation (QQE)
roc --> Rate of Change (ROC)
rsi --> Relative Strength Index (RSI)
rsx --> Relative Strength Xtra (rsx)
rvgi --> Relative Vigor Index (RVGI)
slope --> Slope
smi --> SMI Ergodic Indicator (SMI)
sqz* --> Squeeze (SQZ) * NOTE: code sufferred from very strange error, code was commented.
sqz_pro --> Squeeze PRO(SQZPRO)
xfl --> Condition filter
stc --> Schaff Trend Cycle (STC)
stoch --> Stochastic (STOCH)
stochrsi --> Stochastic RSI (STOCH RSI)
trix --> Trix (TRIX)
tsi --> True Strength Index (TSI)
uo --> Ultimate Oscillator (UO)
willr --> William's Percent R (WILLR)
alma --> Arnaud Legoux Moving Average (ALMA)
xll --> Dynamic rolling lowest values
dema --> Double Exponential Moving Average (DEMA)
ema --> Exponential Moving Average (EMA)
fwma --> Fibonacci's Weighted Moving Average (FWMA)
hilo --> Gann HiLo Activator(HiLo)
hma --> Hull Moving Average (HMA)
hwma --> HWMA (Holt-Winter Moving Average)
ichimoku --> Ichimoku Kinkō Hyō (ichimoku)
jma --> Jurik Moving Average Average (JMA)
kama --> Kaufman's Adaptive Moving Average (KAMA)
linreg --> Linear Regression Moving Average (linreg)
mgcd --> McGinley Dynamic Indicator
rma --> wildeR's Moving Average (RMA)
sinwma --> Sine Weighted Moving Average (SWMA)
ssf --> Ehler's Super Smoother Filter (SSF) © 2013
supertrend --> Supertrend (supertrend)
xsa --> X simple moving average
swma --> Symmetric Weighted Moving Average (SWMA)
t3 --> Tim Tillson's T3 Moving Average (T3)
tema --> Triple Exponential Moving Average (TEMA)
trima --> Triangular Moving Average (TRIMA)
vidya --> Variable Index Dynamic Average (VIDYA)
vwap --> Volume Weighted Average Price (VWAP)
vwma --> Volume Weighted Moving Average (VWMA)
wma --> Weighted Moving Average (WMA)
zlma --> Zero Lag Moving Average (ZLMA)
entropy --> Entropy (ENTP)
kurtosis --> Rolling Kurtosis
skew --> Rolling Skew
xev --> Condition all
zscore --> Rolling Z Score
adx --> Average Directional Movement (ADX)
aroon --> Aroon & Aroon Oscillator (AROON)
chop --> Choppiness Index (CHOP)
xex --> Condition any
cksp --> Chande Kroll Stop (CKSP)
dpo --> Detrend Price Oscillator (DPO)
long_run --> Long Run
psar --> Parabolic Stop and Reverse (psar)
short_run --> Short Run
vhf --> Vertical Horizontal Filter (VHF)
vortex --> Vortex
accbands --> Acceleration Bands (ACCBANDS)
atr --> Average True Range (ATR)
bbands --> Bollinger Bands (BBANDS)
donchian --> Donchian Channels (DC)
kc --> Keltner Channels (KC)
massi --> Mass Index (MASSI)
natr --> Normalized Average True Range (NATR)
pdist --> Price Distance (PDIST)
rvi --> Relative Volatility Index (RVI)
thermo --> Elders Thermometer (THERMO)
ui --> Ulcer Index (UI)
ad --> Accumulation/Distribution (AD)
cmf --> Chaikin Money Flow (CMF)
efi --> Elder's Force Index (EFI)
ecm --> Ease of Movement (EOM)
kvo --> Klinger Volume Oscillator (KVO)
mfi --> Money Flow Index (MFI)
nvi --> Negative Volume Index (NVI)
obv --> On Balance Volume (OBV)
pvi --> Positive Volume Index (PVI)
dvdi --> Dual Volume Divergence Index (DVDI)
xhh --> Dynamic rolling highest values
pvt --> Price-Volume Trend (PVT)
Remarks
I also incorporated func descriptions and func test script in commented mode, you can test the functino with the embedded test script and modify them as you wish.
This is a Level 3 free and open source indicator library.
Feedbacks are appreciated.
This is not the end of pandas_ta lib publication, but it is start point with pine v5 lib function and I will add more and more funcs into this lib for my own indicators.
Function Name List:
bton()
wcp()
count()
xbt()
ebsw()
ao()
apo()
xrf()
bias()
bop()
brar()
cci()
cfo()
cg()
cmo()
coppock()
cti()
dmi()
er()
eri()
fisher()
inertia()
kdj()
kst()
macd()
mom()
pgo()
ppo()
psl()
pvo()
qqe()
roc()
rsi()
rsx()
rvgi()
slope()
smi()
sqz_pro()
xfl()
stc()
stoch()
stochrsi()
trix()
tsi()
uo()
willr()
alma()
wcx()
xll()
dema()
ema()
fwma()
hilo()
hma()
hwma()
ichimoku()
jma()
kama()
linreg()
mgcd()
rma()
sinwma()
ssf()
supertrend()
xsa()
swma()
t3()
tema()
trima()
vidya()
vwap()
vwma()
wma()
zlma()
entropy()
kurtosis()
skew()
xev()
zscore()
adx()
aroon()
chop()
xex()
cksp()
dpo()
long_run()
psar()
short_run()
vhf()
vortex()
accbands()
atr()
bbands()
donchian()
kc()
massi()
natr()
pdist()
rvi()
thermo()
ui()
ad()
cmf()
efi()
ecm()
kvo()
mfi()
nvi()
obv()
pvi()
dvdi()
xhh()
pvt()
TimeLockedMALibrary "TimeLockedMA"
Library & function(s) which generates a moving average that stays locked to users desired time preference.
TODO - Add functionality for more moving average types. IE: smooth, weighted etc...
Example:
time_locked_ma(close, length=1, timeframe='days', type='ema')
Will generate a 1 day exponential moving average that will stay consistent across all chart intervals.
Error Handling
On small time frames with large moving averages (IE: 1min chart with a 50 week moving average), you'll get a study error that says "(function "sma") references too many candles in history" .
To fix this, make sure you have timeframe="" as an indicator() header. Next, in the indicator settings, increase the timeframe from to a higher interval until the error goes away.
By default, it's set to "Chart". Bringing the interval up to 1hr will usually solve the issue.
Furthermore, adding timeframe_gaps=false to your indicator() header will give you an approximation of real-time values.
Misc Info
For time_lock_ma() setting type='na' will return the relative length value that adjusts dynamically to user's chart time interval.
This is good for plugging into other functions where a lookback or length is required. (IE: Bollinger Bands)
time_locked_ma(source, length, timeframe, type) Creates a moving average that is locked to a desired timeframe
Parameters:
source : float, Moving average source
length : int, Moving average length
timeframe : string, Desired timeframe. Use: "minutes", "hours", "days", "weeks", "months", "chart"
type : string, string Moving average type. Use "SMA" (default) or "EMA". Value of "NA" will return relative lookback length.
Returns: moving average that is locked to desired timeframe.
timeframe_convert(t, a, b) Converts timeframe to desired timeframe. From a --> b
Parameters:
t : int, Time interval
a : string, Time period
b : string, Time period to convert to
Returns: Converted timeframe value
chart_time(timeframe_period, timeframe_multiplier) Separates timeframe.period function and returns chart interval and period
Parameters:
timeframe_period : string, timeframe.period
timeframe_multiplier : int, timeframe.multiplier
Enjoy :)
FunctionGenerateRandomPointsInShapeLibrary "FunctionGenerateRandomPointsInShape"
Generate random vector points in geometric shape (parallelogram, triangle)
random_parallelogram(vector_a, vector_b) Generate random vector point in a parallelogram shape.
Parameters:
vector_a : float array, vector of (x, y) shape.
vector_b : float array, vector of (x, y) shape.
Returns: float array, vector of (x, y) shape.
random_triangle(vector_a, vector_b) Generate random vector point in a triangle shape.
Parameters:
vector_a : float array, vector of (x, y) shape.
vector_b : float array, vector of (x, y) shape.
Returns: float array, vector of (x, y) shape.
FunctionArrayNextPreviousLibrary "FunctionArrayNextPrevious"
Methods to iterate through a array by a fixed anchor point.
array_next(array, start_index) retrieves the next value of the internal pointer index.
Parameters:
array : (any array type), array to iterate.
start_index : int, anchor index to start indexing.
array_previous(array, start_index) retrieves the previous value of the internal pointer index.
Parameters:
array : (any array type), array to iterate.
start_index : int, anchor index to start indexing.
note: regrettably is not possible to have global reference index without juggling it in the parameters and tracking it externally to switch between next/previous
VolatilityCheckerLibrary "VolatilityChecker"
Volatility is judged to be high when the range of one period is greater than the ATR of another period.
is_high(_periods, _smooth, _atr_periods, _atr_times) Return true if the volatility is high.
Parameters:
_periods : Range Period
_smooth : Smoothes the range width.
_atr_periods : ATR Period
_atr_times : Amplify the calculated ATR.
Returns: {Boolean}
is_low()
Ichimoku LibraryLibrary "Ichimoku"
Ichimoku Kinko Hyo library
calc(conversion, base, lead, displacement1, displacement2) : Calculate the Ichimoku Kinko Hyo values
Parameters:
conversion : Conversion line' periods
base : Base line's periods
lead : 2nd Leading line's periods
displacement1 : Leading line's offset
displacement2 : Lagging line's offset
Returns:
SetSessionTimesLibrary "SetSessionTimes"
Function to automatically set session times for symbols and eventually timezone.
Useful mainly for futures contracts, to differentiate between pit and overnight sessions, and for 24 hours symbols if you want to "create" sessions for them
This library only returns correct session times to the calling script and does nothing by itself on the chart. the calling script must then use the returned session times to do anything.
For example, in the attached chart this library is used by my initial balance indicator, which calls it to retrieve the correct session times for the selected symbol in the chart, given that different futures contracts have different pit session times (RTH times) and Tradingview hasn't implemented that yet.
SetSessionTimes()
Punchline_LibLibrary "Punchline_Lib"
roundSmart(float) Truncates decimal points of a float value based on the amount of digits before the decimal point
Parameters:
float : _value any number
Returns: float
tostring_smart(float) converts a float to a string, intelligently cutting off decimal points
Parameters:
float : _value any number
Returns: string
FunctionNNLayerLibrary "FunctionNNLayer"
Generalized Neural Network Layer method.
function(inputs, weights, n_nodes, activation_function, bias, alpha, scale) Generalized Layer.
Parameters:
inputs : float array, input values.
weights : float array, weight values.
n_nodes : int, number of nodes in layer.
activation_function : string, default='sigmoid', name of the activation function used.
bias : float, default=1.0, bias to pass into activation function.
alpha : float, default=na, if required to pass into activation function.
scale : float, default=na, if required to pass into activation function.
Returns: float
FunctionNNPerceptronLibrary "FunctionNNPerceptron"
Perceptron Function for Neural networks.
function(inputs, weights, bias, activation_function, alpha, scale) generalized perceptron node for Neural Networks.
Parameters:
inputs : float array, the inputs of the perceptron.
weights : float array, the weights for inputs.
bias : float, default=1.0, the default bias of the perceptron.
activation_function : string, default='sigmoid', activation function applied to the output.
alpha : float, default=na, if required for activation.
scale : float, default=na, if required for activation.
@outputs float
MLActivationFunctionsLibrary "MLActivationFunctions"
Activation functions for Neural networks.
binary_step(value) Basic threshold output classifier to activate/deactivate neuron.
Parameters:
value : float, value to process.
Returns: float
linear(value) Input is the same as output.
Parameters:
value : float, value to process.
Returns: float
sigmoid(value) Sigmoid or logistic function.
Parameters:
value : float, value to process.
Returns: float
sigmoid_derivative(value) Derivative of sigmoid function.
Parameters:
value : float, value to process.
Returns: float
tanh(value) Hyperbolic tangent function.
Parameters:
value : float, value to process.
Returns: float
tanh_derivative(value) Hyperbolic tangent function derivative.
Parameters:
value : float, value to process.
Returns: float
relu(value) Rectified linear unit (RELU) function.
Parameters:
value : float, value to process.
Returns: float
relu_derivative(value) RELU function derivative.
Parameters:
value : float, value to process.
Returns: float
leaky_relu(value) Leaky RELU function.
Parameters:
value : float, value to process.
Returns: float
leaky_relu_derivative(value) Leaky RELU function derivative.
Parameters:
value : float, value to process.
Returns: float
relu6(value) RELU-6 function.
Parameters:
value : float, value to process.
Returns: float
softmax(value) Softmax function.
Parameters:
value : float array, values to process.
Returns: float
softplus(value) Softplus function.
Parameters:
value : float, value to process.
Returns: float
softsign(value) Softsign function.
Parameters:
value : float, value to process.
Returns: float
elu(value, alpha) Exponential Linear Unit (ELU) function.
Parameters:
value : float, value to process.
alpha : float, default=1.0, predefined constant, controls the value to which an ELU saturates for negative net inputs. .
Returns: float
selu(value, alpha, scale) Scaled Exponential Linear Unit (SELU) function.
Parameters:
value : float, value to process.
alpha : float, default=1.67326324, predefined constant, controls the value to which an SELU saturates for negative net inputs. .
scale : float, default=1.05070098, predefined constant.
Returns: float
exponential(value) Pointer to math.exp() function.
Parameters:
value : float, value to process.
Returns: float
function(name, value, alpha, scale) Activation function.
Parameters:
name : string, name of activation function.
value : float, value to process.
alpha : float, default=na, if required.
scale : float, default=na, if required.
Returns: float
derivative(name, value, alpha, scale) Derivative Activation function.
Parameters:
name : string, name of activation function.
value : float, value to process.
alpha : float, default=na, if required.
scale : float, default=na, if required.
Returns: float
MLLossFunctionsLibrary "MLLossFunctions"
Methods for Loss functions.
mse(expects, predicts) Mean Squared Error (MSE) " MSE = 1/N * sum ((y - y')^2) ".
Parameters:
expects : float array, expected values.
predicts : float array, prediction values.
Returns: float
binary_cross_entropy(expects, predicts) Binary Cross-Entropy Loss (log).
Parameters:
expects : float array, expected values.
predicts : float array, prediction values.
Returns: float
Debug_Window_LibraryLibrary "Debug_Window_Library"
Provides a framework for logging debug information to a window on the chart.
consoleWrite(txt, maxLines) Adds a line of text to the debug window. The text is rolled off the bottom of the window as it fills up.
Parameters:
txt : - this is the text to be appended to the window
maxLines : - this is the size of the window in lines.
Returns: nothing
The example above shows the close value for the last 10 bars.
Here's the code.
//@version=5
indicator("Debug Library test Script", overlay=true)
import sp2432/Debug_Window_Library/1 as dbg
// add some text to the debug window
dbg .consoleWrite( str .tostring(close), 10)
PointsLibrary "Points"
Provides functions for simplifying operations with collections of x+y coordinates. Where x is typically a bar index or time (millisecond) value.
new(size) Creates two arrays. One for X (int ) and another for Y (float ).
Parameters:
size : The initial size of the arrays.
size(xA, yA) Checks the size of the arrays and if they're equal returns the size.
Parameters:
xA : The X array.
yA : The Y array.
get(xA, yA, index) Gets the X and Y values of the arrays at the index.
Parameters:
xA : The X array.
yA : The Y array.
index : The index.
Returns:
set(xA, yA, index, x, y) Sets the X and Y values of the arrays at the index.
Parameters:
xA : The X array.
yA : The Y array.
index : The index.
x : The x value.
y : The y value.
Returns:
push(xA, yA, x, y) Adds X and Y values to the end of the arrays (as the last element).
Parameters:
xA : The X array.
yA : The Y array.
x : The x value.
y : The y value.
Returns:
unshift(xA, yA, x, y) Adds X and Y values to the beginning of the arrays (as the first element).
Parameters:
xA : The X array.
yA : The Y array.
x : The x value.
y : The y value.
Returns:
insert(xA, yA, index, x, y) Inserts X and Y values to the arrays at the index.
Parameters:
xA : The X array.
yA : The Y array.
index : The index to insert at.
x : The x value.
y : The y value.
Returns:
pop(xA, yA) Removes the last element from the arrays and returns their value.
Parameters:
xA : The X array.
yA : The Y array.
Returns:
shift(xA, yA) Removes the first element from the arrays and returns their value.
Parameters:
xA : The X array.
yA : The Y array.
Returns:
remove(xA, yA) Removes the element from the arrays at the index and returns their value.
Parameters:
xA : The X array.
yA : The Y array.
Returns:
first(xA, yA) Gets the X and Y values of the first element.
Parameters:
xA : The X array.
yA : The Y array.
Returns:
last(xA, yA) Gets the X and Y values of the last element.
Parameters:
xA : The X array.
yA : The Y array.
Returns:
allIndexesBetween(xA, lo, hi, start, ordered) Gets the indexes that have values at or above the low value and below the high value.
Parameters:
xA : The X array.
lo : The inclusive low value.
hi : The excluded hi value.
start : The optional index to start the backwards search.
ordered : If true, the search ends when the first value is found that is less than the low.
lastIndexBetween(xA, lo, hi, start, ordered) Gets the first found from the end that has a value at or above the low value and below the high value.
Parameters:
xA : The X array.
lo : The inclusive low value.
hi : The excluded hi value.
start : The optional index to start the backwards search.
ordered : If true, the search ends when the first value is found that is less than the low.
lastIndexBelow(xA, hi, start) Gets the first found from the end that has a value below the high value.
Parameters:
xA : The X array.
hi : The excluded hi value.
start : The optional index to start the backwards search.
eHarmonicpatternsLibrary "eHarmonicpatterns"
Library provides an alternative method to scan harmonic patterns. This is helpful in reducing iterations
scan_xab(bcdRatio, err_min, err_max, patternArray) Checks if bcd ratio is in range of any harmonic pattern
Parameters:
bcdRatio : AB/XA ratio
err_min : minimum error threshold
err_max : maximum error threshold
patternArray : Array containing pattern check flags. Checks are made only if flags are true. Upon check flgs are overwritten.
scan_abc_axc(abcRatio, axcRatio, err_min, err_max, patternArray) Checks if abc or axc ratio is in range of any harmonic pattern
Parameters:
abcRatio : BC/AB ratio
axcRatio : XC/AX ratio
err_min : minimum error threshold
err_max : maximum error threshold
patternArray : Array containing pattern check flags. Checks are made only if flags are true. Upon check flgs are overwritten.
scan_bcd(bcdRatio, err_min, err_max, patternArray) Checks if bcd ratio is in range of any harmonic pattern
Parameters:
bcdRatio : CD/BC ratio
err_min : minimum error threshold
err_max : maximum error threshold
patternArray : Array containing pattern check flags. Checks are made only if flags are true. Upon check flgs are overwritten.
scan_xad_xcd(xadRatio, xcdRatio, err_min, err_max, patternArray) Checks if xad or xcd ratio is in range of any harmonic pattern
Parameters:
xadRatio : AD/XA ratio
xcdRatio : CD/XC ratio
err_min : minimum error threshold
err_max : maximum error threshold
patternArray : Array containing pattern check flags. Checks are made only if flags are true. Upon check flgs are overwritten.
isHarmonicPattern(x, a, c, c, d, flags, errorPercent) Checks for harmonic patterns
Parameters:
x : X coordinate value
a : A coordinate value
c : B coordinate value
c : C coordinate value
d : D coordinate value
flags : flags to check patterns. Send empty array to enable all
errorPercent : Error threshold
Returns: Array of boolean values which says whether valid pattern exist and array of corresponding pattern names
isHarmonicProjection(x, a, c, c, flags, errorPercent) Checks for harmonic pattern projection
Parameters:
x : X coordinate value
a : A coordinate value
c : B coordinate value
c : C coordinate value
flags : flags to check patterns. Send empty array to enable all
errorPercent : Error threshold
Returns: Array of boolean values which says whether valid pattern exist and array of corresponding pattern names
OteHmacSha256Library "OteHmacSha256"
Library to use HMAC SHA-256 by OgahTerkenal
hmac_sha256(string) HMAC SHA-256
Parameters:
string : msg String to be hashed
Returns: Return a hashed string in hex format and an array of 8 32 bits integer
Library to use HMAC SHA-256 for authenticating alert message going out from TradingView.
It has limitation on allowed characters (because PineScript cannot access the underlying bits of each ASCII) from ASCII 32 to 126 only.
Usage Example section at the end of the source code pretty much tell everything about this library.
General example as how to import to your PineScript code is not included (please refer to the PineScript manual).
StocksDeveloper_AutoTraderWebLibrary "StocksDeveloper_AutoTraderWeb"
AutoTrader Web trading API functions implementation for Trading View.
preparePlaceOrderJson(account, symbol, group, variety) Prepare a place order json
Parameters:
account : Pseudo or group account number
symbol : AutoTrader Web's stock/derivative symbol
group : Set it to true to use group account (Default: false)
variety : Variety (Default: REGULAR)
Returns: A json message for the given order data
preparePlaceOrderAlertUsingOrderJson(orderJsonArray) Prepare a place order alert message using order json array
Parameters:
orderJsonArray : Order json can contain one or more orders
Returns: A complete alert message to place orders
preparePlaceOrderAlertMessage(account, symbol, group, variety, validity) Prepare a place order alert json message
Parameters:
account : Pseudo or group account number
symbol : AutoTrader Web's stock/derivative symbol
group : Set it to true to use group account (Default: false)
variety : Variety (Default: REGULAR)
validity : Validity (Default: DAY)
Returns: A complete alert message to place orders