OHLC📕 LIBRARY OHLC
🔷  Introduction 
This library is a custom library designed to work with real-time bars. It allows to easily calculate OHLC values for any source.
Personally, I use this library to accurately display the highest and lowest values on visual indicators such as my progress bars.
🔷  How to Use 
◼ 1. Import the OHLC library into your TradingView script:
 
import cryptolinx/OHLC/1
 
 - or -
Instead of the library namespace, you can define a custom namespace as alias.
 
import cryptolinx/OHLC/1 as src
 
◼ 2. Create a new OHLC source using the `new()` function. 
 
varip mySrc = OHLC.new()  // It is required to use the `varip` keyword to init your ``
 
- or -
If you has set up an alias before.
 
varip mySrc = src.new()
 
===
In that case, your `` needs to be `na`, define your object like that
 
varip  mySrc = na
 
◼ 3. Call the `hydrateOHLC()` method on your OHLC source to update its values:
Basic
 
float rsi = ta.rsi(close, 14)
mySrc.hydrateOHLC(rsi)
 
- or -
Inline
 
rsi = ta.rsi(close, 14).hydrateOHLC(mySrc)
 
◼ 4. The data is accessible under their corresponding names.
 
mySrc.open
mySrc.high
mySrc.low
mySrc.close
 
🔷  Note:  This library  only  works with  real-time bars  and will not work with historical bars.
Techindicator
Lex_3CR_Functions_Library2Library   "Lex_3CR_Functions_Library2" 
This is a source code for a technical analysis library in Pine Script language, 
designed to identify and mark Bullish and Bearish Three Candle Reversal (3CR) chart patterns. 
The library provides three functions to be used in a trading algorithm. 
The first function, Bull_3crMarker, adds a dashed line and label to a Bullish 3CR chart pattern, indicating the 3CR point. 
The second function, Bear_3crMarker, adds a dashed line and label to a Bearish 3CR chart pattern. 
The third function, Bull_3CRlogicals, checks for a Bullish 3CR pattern where the first candle's low is greater than the second candle's low and the second candle's low is less than the third candle's low. 
If found, creates a line at the breakout point and a label at the fail point, 
if specified. All functions take parameters such as the chart pattern's characteristics and output colors, labels, and markers.
 Bull_3crMarker(bulllinearray, barnum, breakpoint, failpointB, failpoint, linecolorbull, bulllabelarray, labelcolor, textcolor, labelon) 
  Bull_3crMarker Adds a 3CR marker to a Bullish 3CR chart pattern
@description Adds a dashed line and label to a 3CR up chart pattern, indicating the 3CR (3 Candle Reversal) point.
  Parameters:
     bulllinearray (line ) 
     barnum (int) 
     breakpoint (float) 
     failpointB (float ) 
     failpoint (float) 
     linecolorbull (color) 
     bulllabelarray (label ) 
     labelcolor (color) 
     textcolor (color) 
     labelon (bool) 
 Bear_3crMarker(bearlinearray, barnum, breakpoint, failpointB, failpoint, linecolorbear, bearlabelarray, labelcolor, textcolor, labelon) 
  Bear_3crMarker Adds a 3CR marker to a Bearish 3CR chart pattern
@description Adds a dashed line and label to a 3CR down chart pattern, indicating the 3CR (3 Candle Reversal) point.
  Parameters:
     bearlinearray (line ) 
     barnum (int) 
     breakpoint (float) 
     failpointB (float ) 
     failpoint (float) 
     linecolorbear (color) 
     bearlabelarray (label ) 
     labelcolor (color) 
     textcolor (color) 
     labelon (bool) 
 Bull_3CRlogicals(low1, low2, low3, bulllinearray, bulllabelarray, failpointB, linecolorbull, labelcolor, textcolor, labelon) 
  Checks for a bullish three candle reversal pattern and creates a line and label at the breakout point if found
@description Checks for a bullish three candle reversal pattern where the first candle's low is greater than the second candle's low and the second candle's low is less than the third candle's low. If found, creates a line at the breakout point and a label at the fail point, if specified.
  Parameters:
     low1 (float) 
     low2 (float) 
     low3 (float) 
     bulllinearray (line ) 
     bulllabelarray (label ) 
     failpointB (float ) 
     linecolorbull (color) 
     labelcolor (color) 
     textcolor (color) 
     labelon (bool) 
 Bear_3CRlogicals(high1, high2, high3, bearlinearray, bearlabelarray, failpointB, linecolorbear, labelcolor, textcolor, labelon) 
  Checks for a Bearish 3CR pattern and draws a bearish marker on the chart at the appropriate location
@description This function checks for a Bearish 3CR (Three-Candle Reversal) pattern, which is defined as the second candle having a higher high than the first and third candles, and the third candle having a lower high than the first candle. If the pattern is detected, a bearish marker is drawn on the chart at the appropriate location, and an optional label can be added to the marker.
  Parameters:
     high1 (float) 
     high2 (float) 
     high3 (float) 
     bearlinearray (line ) 
     bearlabelarray (label ) 
     failpointB (float ) 
     linecolorbear (color) 
     labelcolor (color) 
     textcolor (color) 
     labelon (bool) 
 bullLineDelete(i, bulllinearray, failarray, bulllabelarray, labelon) 
  Removes a bullish line from a specified position in a line array, and optionally removes a label associated with that line
@description Removes a bullish line from a specified position in a line array, and optionally removes a label associated with that line.
  Parameters:
     i (int) 
     bulllinearray (line ) 
     failarray (float ) 
     bulllabelarray (label ) 
     labelon (bool) 
 bearLineDelete(i, bearlinearray, failarray, bearlabelarray, labelon) 
  Removes a bearish line from a specified position in a line array, and optionally removes a label associated with that line
@description Removes a bearish line from a specified position in a line array, and optionally removes a label associated with that line.
  Parameters:
     i (int) 
     bearlinearray (line ) 
     failarray (float ) 
     bearlabelarray (label ) 
     labelon (bool) 
 bulloffsetdelete(i, bulllinearray, failarray, bulllabelarray, labelon) 
  Removes a bullish line from a specified position in a line array, and optionally removes a label associated with that line
@description Removes a bullish line from a specified position in a line array, and optionally removes a label associated with that line.
  Parameters:
     i (int) 
     bulllinearray (line ) 
     failarray (float ) 
     bulllabelarray (label ) 
     labelon (bool) 
 bearoffsetdelete(i, bearlinearray, failarray, bearlabelarray, labelon) 
  Removes a bearish line from a specified position in a line array, and optionally removes a label associated with that line
@description Removes a bearish line from a specified position in a line array, and optionally removes a label associated with that line.
  Parameters:
     i (int) 
     bearlinearray (line ) 
     failarray (float ) 
     bearlabelarray (label ) 
     labelon (bool) 
 BullEntry_setter(i, bulllinearray, failpointB, entrystopB, entryB, entryboolB) 
  Checks if the specified value is greater than the break point of any bullish line in an array, and removes that line if true
@description Checks if the s pecified value is greater than the break point of any bullish line in an array, and removes that line if true.
  Parameters:
     i (int) 
     bulllinearray (line ) 
     failpointB (float ) 
     entrystopB (float ) 
     entryB (float ) 
     entryboolB (bool ) 
 Bull3CRchecker(close1, bulllinearray, FailpointB, rsiB, bulllabelarray, labelt, bullcolored, directionarray, rsi, secondbullline, entrystopB, entryB, entryboolB) 
  Parameters:
     close1 (float) 
     bulllinearray (line ) 
     FailpointB (float ) 
     rsiB (float ) 
     bulllabelarray (label ) 
     labelt (bool) 
     bullcolored (color) 
     directionarray (label ) 
     rsi (float) 
     secondbullline (line ) 
     entrystopB (float ) 
     entryB (float ) 
     entryboolB (bool ) 
 Bear3CRchecker(close1, bearlinearray, FailpointB, bearlabelarray, labelt, bearcolored, directionarray, rsi, secondbearline, rsiB) 
  Checks if the specified value is less than the break point of any bearish line in an array, and removes that line if true
@description Checks if the specified value is less than the break point of any bearish line in an array, and removes that line if true.
  Parameters:
     close1 (float) 
     bearlinearray (line ) 
     FailpointB (float ) 
     bearlabelarray (label ) 
     labelt (bool) 
     bearcolored (color) 
     directionarray (label ) 
     rsi (float) 
     secondbearline (line ) 
     rsiB (float ) 
 Bulloffsetcheck(FailpointB, bulllabelarray, linearray, labelt, offset) 
  Checks the offset of bullish lines and deletes them if they are beyond a certain offset from the current bar index
@description Checks the offset of bullish lines and deletes them if they are beyond a certain offset from the current bar index
  Parameters:
     FailpointB (float ) 
     bulllabelarray (label ) 
     linearray (line ) 
     labelt (bool) 
     offset (int) 
 Bearoffsetcheck(FailpointB, bearlabelarray, linearray, labelt, offset) 
  Checks the offset of bearish lines and deletes them if they are beyond a certain offset from the current bar index
@description Checks the offset of bearish lines and deletes them if they are beyond a certain offset from the current bar index
  Parameters:
     FailpointB (float ) 
     bearlabelarray (label ) 
     linearray (line ) 
     labelt (bool) 
     offset (int) 
 Bullfailchecker(close1, FailpointB, bulllabelarray, linearray, labelt) 
  Checks if the current price has crossed above a bullish fail point and deletes the corresponding line and label
@description Checks if the current price has crossed above a bullish fail point and deletes the corresponding line and label
  Parameters:
     close1 (float) 
     FailpointB (float ) 
     bulllabelarray (label ) 
     linearray (line ) 
     labelt (bool) 
 Bearfailchecker(close1, FailpointB, bearlabelarray, linearray, labelt) 
  Checks for bearish lines that have failed to trigger and removes them from the chart
@description This function checks for bearish lines that have failed to trigger (i.e., where the current price is above the fail point) and removes them from the chart along with any associated label.
  Parameters:
     close1 (float) 
     FailpointB (float ) 
     bearlabelarray (label ) 
     linearray (line ) 
     labelt (bool) 
 rsibullchecker(rsiinput, rsiBull, secondbullline) 
  Checks for bullish RSI lines that have failed to trigger and removes them from the chart
@description This function checks for bullish RSI lines that have failed to trigger (i.e., where the current RSI value is below the line's trigger level) and removes them from the chart along with any associated line.
  Parameters:
     rsiinput (float) 
     rsiBull (float ) 
     secondbullline (line ) 
 rsibearchecker(rsiinput, rsiBear, secondbearline) 
  Checks for bearish RSI lines that have failed to trigger and removes them from the chart
@description This function checks for bearish RSI lines that have failed to trigger (i.e., where the current RSI value is above the line's trigger level) and removes them from the chart along with any associated line.
  Parameters:
     rsiinput (float) 
     rsiBear (float ) 
     secondbearline (line )
TrendIndicatorsLibrary   "TrendIndicators" 
This is a library of 'Trend Indicators'. 
It aims to facilitate the grouping of this category of indicators, and also offer the customized supply of 
the source, not being restricted to just the closing price.
Indicators (this is a work in progress):
1. Absolute DI (Directional Moviment Index) (Difference between DI+ and DI-).
Used in 'DMI Stochastic Extreme' by Barbara Star.
2. DMI
 DI_Abs(lengthDI, smoothDI, typeMA, lengthMA) 
  @description Absolute DI (Directional Moviment Index). 
Used in 'DMI Stochastic Extreme' by Barbara Star.
Difference between DI+ and DI-
  Parameters:
     lengthDI : (int) Length of DI+/DI-
     smoothDI : (bool) Sets whether absolute DI should be smoothed
     typeMA : (int) Type of moving average of smoothing
     lengthMA : (int) Length for moving average of smoothing
  Returns: (float) Absolute value of DI
 dmi(diLength, adxSmoothing) 
  @description DMI (Directional Movement Index)
Same as ta.dmi()
  Parameters:
     diLength : (int) Length of DI+/DI-
     adxSmoothing : (int) ADX Smoothing
  Returns:   Tuple of three DMI series: Positive Directional 
Movement (+DI), Negative Directional Movement (-DI) and Average Directional Movement Index (ADX).
 dmi(source, diLength, adxSmoothing) 
  @description DMI (Directional Movement Index)
Customized version of ta.dmi(), with custom source
  Parameters:
     source : (float) Source for DI+/DI-
     diLength : (int) Length of DI+/DI-
     adxSmoothing : (int) ADX Smoothing
  Returns:   Tuple of three DMI series: Positive Directional 
Movement (+DI), Negative Directional Movement (-DI) and Average Directional Movement Index (ADX).
MomentumIndicatorsLibrary   "MomentumIndicators" 
This is a library of 'Momentum Indicators', also denominated as oscillators.
The purpose of this library is to organize momentum indicators in just one place, making it easy to access.
In addition, it aims to allow customized versions, not being restricted to just the price value.
An example of this use case is the popular Stochastic RSI.
# Indicators:
1. Relative Strength Index (RSI): 
Measures the relative strength of recent price gains to recent price losses of an asset.
2. Rate of Change (ROC): 
Measures the percentage change in price of an asset over a specified time period.
3. Stochastic Oscillator (Stoch): 
Compares the current price of an asset to its price range over a specified time period.
4. True Strength Index (TSI):
Measures the price change, calculating the ratio of the price change (positive or negative) in relation to the 
absolute price change.
The values of both are smoothed twice to reduce noise, and the final result is normalized 
in a range between 100 and -100.
5. Stochastic Momentum Index (SMI): 
Combination of the True Strength Index with a signal line to help identify turning points in the market.
6. Williams Percent Range (Williams %R): 
Compares the current price of an asset to its highest high and lowest low over a specified time period.
7. Commodity Channel Index (CCI): 
Measures the relationship between an asset's current price and its moving average.
8. Ultimate Oscillator (UO): 
Combines three different time periods to help identify possible reversal points.
9. Moving Average Convergence/Divergence (MACD): 
Shows the difference between short-term and long-term exponential moving averages.
10. Fisher Transform (FT): 
Normalize prices into a Gaussian normal distribution.
11. Inverse Fisher Transform (IFT): 
Transform the values of the Fisher Transform into a smaller and more easily interpretable scale is through the 
application of an inverse transformation to the hyperbolic tangent function. 
This transformation takes the values of the FT, which range from -infinity to +infinity, to a scale limited 
between -1 and +1, allowing them to be more easily visualized and compared.
12. Premier Stochastic Oscillator (PSO):
Normalizes the standard stochastic oscillator by applying a five-period double exponential smoothing average of 
the %K value, resulting in a symmetric scale of 1 to -1
# Indicators of indicators:
## Stochastic:
1. Stochastic of RSI (Relative Strengh Index)
2. Stochastic of ROC (Rate of Change)
3. Stochastic of UO (Ultimate Oscillator)
4. Stochastic of TSI (True Strengh Index)
5. Stochastic of Williams R%
6. Stochastic of CCI (Commodity Channel Index).
7. Stochastic of MACD (Moving Average Convergence/Divergence)
8. Stochastic of FT (Fisher Transform)
9. Stochastic of Volume
10. Stochastic of MFI (Money Flow Index)
11. Stochastic of On OBV (Balance Volume)
12. Stochastic of PVI (Positive Volume Index)
13. Stochastic of NVI (Negative Volume Index)
14. Stochastic of PVT (Price-Volume Trend)
15. Stochastic of VO (Volume Oscillator)
16. Stochastic of VROC (Volume Rate of Change)
## Inverse Fisher Transform:
1.Inverse Fisher Transform on RSI (Relative Strengh Index)
2.Inverse Fisher Transform on ROC (Rate of Change)
3.Inverse Fisher Transform on UO (Ultimate Oscillator)
4.Inverse Fisher Transform on Stochastic
5.Inverse Fisher Transform on TSI (True Strength Index)
6.Inverse Fisher Transform on CCI (Commodity Channel Index)
7.Inverse Fisher Transform on Fisher Transform (FT)
8.Inverse Fisher Transform on MACD (Moving Average Convergence/Divergence)
9.Inverse Fisher Transfor on Williams R% (Williams Percent Range)
10.Inverse Fisher Transfor on CMF (Chaikin Money Flow)
11.Inverse Fisher Transform on VO (Volume Oscillator)
12.Inverse Fisher Transform on VROC (Volume Rate of Change)
## Stochastic Momentum Index:
1.Stochastic Momentum Index of RSI (Relative Strength Index)
2.Stochastic Momentum Index of ROC (Rate of Change)
3.Stochastic Momentum Index of VROC (Volume Rate of Change)
4.Stochastic Momentum Index of Williams R% (Williams Percent Range)
5.Stochastic Momentum Index of FT (Fisher Transform)
6.Stochastic Momentum Index of CCI (Commodity Channel Index)
7.Stochastic Momentum Index of UO (Ultimate Oscillator)
8.Stochastic Momentum Index of MACD (Moving Average Convergence/Divergence)
9.Stochastic Momentum Index of Volume
10.Stochastic Momentum Index of MFI (Money Flow Index)
11.Stochastic Momentum Index of CMF (Chaikin Money Flow)
12.Stochastic Momentum Index of On Balance Volume (OBV)
13.Stochastic Momentum Index of Price-Volume Trend (PVT)
14.Stochastic Momentum Index of Volume Oscillator (VO)
15.Stochastic Momentum Index of Positive Volume Index (PVI)
16.Stochastic Momentum Index of Negative Volume Index (NVI)
## Relative Strength Index:
1. RSI for Volume
2. RSI for Moving Average
 rsi(source, length) 
  RSI (Relative Strengh Index). Measures the relative strength of recent price gains to recent price losses of an asset.
  Parameters:
     source : (float) Source of series (close, high, low, etc.)
     length : (int) Period of loopback
  Returns: (float) Series of RSI
 roc(source, length) 
  ROC (Rate of Change). Measures the percentage change in price of an asset over a specified time period.
  Parameters:
     source : (float) Source of series (close, high, low, etc.)
     length : (int) Period of loopback
  Returns: (float) Series of ROC
 stoch(kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD) 
  Stochastic Oscillator. Compares the current price of an asset to its price range over a specified time period.
  Parameters:
     kLength 
     kSmoothing : (int) Period for smoothig stochastic
     dSmoothing : (int) Period for signal (moving average of stochastic)
     maTypeK : (int) Type of Moving Average for Stochastic Oscillator
     maTypeD : (int) Type of Moving Average for Stochastic Oscillator Signal
     almaOffsetKD : (float) Offset for Arnaud Legoux Moving Average for Oscillator and Signal
     almaSigmaKD : (float) Sigma for Arnaud Legoux Moving Average for Oscillator and Signal
     lsmaOffSetKD : (int) Offset for Least Squares Moving Average for Oscillator and Signal
  Returns:   A tuple of Stochastic Oscillator and Moving Average of Stochastic Oscillator
 stoch(source, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD) 
  Stochastic Oscillator. Customized source. Compares the current price of an asset to its price range over a specified time period.
  Parameters:
     source : (float) Source of series (close, high, low, etc.)
     kLength : (int) Period of loopback to calculate the stochastic
     kSmoothing : (int) Period for smoothig stochastic
     dSmoothing : (int) Period for signal (moving average of stochastic)
     maTypeK : (int) Type of Moving Average for Stochastic Oscillator
     maTypeD : (int) Type of Moving Average for Stochastic Oscillator Signal
     almaOffsetKD : (float) Offset for Arnaud Legoux Moving Average for Stoch and Signal
     almaSigmaKD : (float) Sigma for Arnaud Legoux Moving Average for Stoch and Signal
     lsmaOffSetKD : (int) Offset for Least Squares Moving Average for Stoch and Signal
  Returns:   A tuple of Stochastic Oscillator and Moving Average of Stochastic Oscillator
 tsi(source, shortLength, longLength, maType, almaOffset, almaSigma, lsmaOffSet) 
  TSI (True Strengh Index). Measures the price change, calculating the ratio of the price change (positive or negative) in relation to the absolute price change.
The values of both are smoothed twice to reduce noise, and the final result is normalized in a range between 100 and -100.
  Parameters:
     source : (float) Source of series (close, high, low, etc.)
     shortLength : (int) Short length
     longLength : (int) Long length
     maType : (int) Type of Moving Average for TSI
     almaOffset : (float) Offset for Arnaud Legoux Moving Average
     almaSigma : (float) Sigma for Arnaud Legoux Moving Average
     lsmaOffSet : (int) Offset for Least Squares Moving Average
  Returns: (float) TSI
 smi(sourceTSI, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal) 
  SMI (Stochastic Momentum Index). A TSI (True Strengh Index) plus a signal line.
  Parameters:
     sourceTSI : (float) Source of series for TSI (close, high, low, etc.)
     shortLengthTSI : (int) Short length for TSI
     longLengthTSI : (int) Long length for TSI
     maTypeTSI : (int) Type of Moving Average for Signal of TSI
     almaOffsetTSI : (float) Offset for Arnaud Legoux Moving Average
     almaSigmaTSI : (float) Sigma for Arnaud Legoux Moving Average
     lsmaOffSetTSI : (int) Offset for Least Squares Moving Average
     maTypeSignal 
     smoothingLengthSignal 
     almaOffsetSignal 
     almaSigmaSignal 
     lsmaOffSetSignal 
  Returns:   A tuple with TSI, signal of TSI and histogram of difference
 wpr(source, length) 
  Williams R% (Williams Percent Range). Compares the current price of an asset to its highest high and lowest low over a specified time period.
  Parameters:
     source : (float) Source of series (close, high, low, etc.)
     length : (int) Period of loopback
  Returns: (float) Series of Williams R%
 cci(source, length, maType, almaOffset, almaSigma, lsmaOffSet) 
  CCI (Commodity Channel Index). Measures the relationship between an asset's current price and its moving average.
  Parameters:
     source : (float) Source of series (close, high, low, etc.)
     length : (int) Period of loopback
     maType : (int) Type of Moving Average
     almaOffset : (float) Offset for Arnaud Legoux Moving Average
     almaSigma : (float) Sigma for Arnaud Legoux Moving Average
     lsmaOffSet : (int) Offset for Least Squares Moving Average
  Returns: (float) Series of CCI
 ultimateOscillator(fastLength, middleLength, slowLength) 
  UO (Ultimate Oscilator). Combines three different time periods to help identify possible reversal points.
  Parameters:
     fastLength : (int) Fast period of loopback
     middleLength : (int) Middle period of loopback
     slowLength : (int) Slow period of loopback
  Returns: (float) Series of Ultimate Oscilator
 ultimateOscillator(source, fastLength, middleLength, slowLength) 
  UO (Ultimate Oscilator). Customized source. Combines three different time periods to help identify possible reversal points.
  Parameters:
     source : (float) Source of series (close, high, low, etc.)
     fastLength : (int) Fast period of loopback
     middleLength : (int) Middle period of loopback
     slowLength : (int) Slow period of loopback
  Returns: (float) Series of Ultimate Oscilator
 macd(source, fastLength, slowLength, signalLength, maTypeFast, maTypeSlow, maTypeMACD, almaOffset, almaSigma, lsmaOffSet) 
  MACD (Moving Average Convergence/Divergence). Shows the difference between short-term and long-term exponential moving averages.
  Parameters:
     source : (float) Source of series (close, high, low, etc.)
     fastLength : (int) Period for fast moving average
     slowLength : (int) Period for slow moving average
     signalLength : (int) Signal length
     maTypeFast : (int) Type of fast moving average
     maTypeSlow : (int) Type of slow moving average
     maTypeMACD : (int) Type of MACD moving average
     almaOffset : (float) Offset for Arnaud Legoux Moving Average
     almaSigma : (float) Sigma for Arnaud Legoux Moving Average
     lsmaOffSet : (int) Offset for Least Squares Moving Average
  Returns:   A tuple with MACD, Signal, and Histgram
 fisher(length) 
  Fisher Transform. Normalize prices into a Gaussian normal distribution.
  Parameters:
     length 
  Returns:   A tuple with Fisher Transform and signal
 fisher(source, length) 
  Fisher Transform. Customized source. Normalize prices into a Gaussian normal distribution.
  Parameters:
     source : (float) Source of series (close, high, low, etc.)
     length 
  Returns:   A tuple with Fisher Transform and signal
 inverseFisher(source, length, subtrahend, denominator) 
  Inverse Fisher Transform.
Transform the values of the Fisher Transform into a smaller and more easily interpretable scale is 
through the application of an inverse transformation to the hyperbolic tangent function. 
This transformation takes the values of the FT, which range from -infinity to +infinity, 
to a scale limited between -1 and +1, allowing them to be more easily visualized and compared.
  Parameters:
     source : (float) Source of series (close, high, low, etc.)
     length : (int) Period for loopback
     subtrahend : (int) Denominator. Useful in unbounded indicators. For example, in CCI.
     denominator 
  Returns: (float) Series of Inverse Fisher Transform
 premierStoch(length, smoothlen) 
  Premier Stochastic Oscillator (PSO).
Normalizes the standard stochastic oscillator by applying a five-period double exponential smoothing 
average of the %K value, resulting in a symmetric scale of 1 to -1.
  Parameters:
     length : (int) Period for loopback
     smoothlen : (int) Period for smoothing
  Returns: (float) Series of PSO
 premierStoch(source, smoothlen, subtrahend, denominator) 
  Premier Stochastic Oscillator (PSO) of custom source.
Normalizes the source by applying a five-period double exponential smoothing average.
  Parameters:
     source : (float) Source of series (close, high, low, etc.)
     smoothlen : (int) Period for smoothing
     subtrahend : (int) Denominator. Useful in unbounded indicators. For example, in CCI.
     denominator 
  Returns: (float) Series of PSO
 stochRsi(sourceRSI, lengthRSI, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD) 
  Parameters:
     sourceRSI 
     lengthRSI 
     kLength 
     kSmoothing 
     dSmoothing 
     maTypeK 
     maTypeD 
     almaOffsetKD 
     almaSigmaKD 
     lsmaOffSetKD 
 stochRoc(sourceROC, lengthROC, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD) 
  Parameters:
     sourceROC 
     lengthROC 
     kLength 
     kSmoothing 
     dSmoothing 
     maTypeK 
     maTypeD 
     almaOffsetKD 
     almaSigmaKD 
     lsmaOffSetKD 
 stochUO(fastLength, middleLength, slowLength, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD) 
  Parameters:
     fastLength 
     middleLength 
     slowLength 
     kLength 
     kSmoothing 
     dSmoothing 
     maTypeK 
     maTypeD 
     almaOffsetKD 
     almaSigmaKD 
     lsmaOffSetKD 
 stochTSI(source, shortLength, longLength, maType, almaOffset, almaSigma, lsmaOffSet, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD) 
  Parameters:
     source 
     shortLength 
     longLength 
     maType 
     almaOffset 
     almaSigma 
     lsmaOffSet 
     kLength 
     kSmoothing 
     dSmoothing 
     maTypeK 
     maTypeD 
     almaOffsetKD 
     almaSigmaKD 
     lsmaOffSetKD 
 stochWPR(source, length, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD) 
  Parameters:
     source 
     length 
     kLength 
     kSmoothing 
     dSmoothing 
     maTypeK 
     maTypeD 
     almaOffsetKD 
     almaSigmaKD 
     lsmaOffSetKD 
 stochCCI(source, length, maType, almaOffset, almaSigma, lsmaOffSet, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD) 
  Parameters:
     source 
     length 
     maType 
     almaOffset 
     almaSigma 
     lsmaOffSet 
     kLength 
     kSmoothing 
     dSmoothing 
     maTypeK 
     maTypeD 
     almaOffsetKD 
     almaSigmaKD 
     lsmaOffSetKD 
 stochMACD(source, fastLength, slowLength, signalLength, maTypeFast, maTypeSlow, maTypeMACD, almaOffset, almaSigma, lsmaOffSet, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD) 
  Parameters:
     source 
     fastLength 
     slowLength 
     signalLength 
     maTypeFast 
     maTypeSlow 
     maTypeMACD 
     almaOffset 
     almaSigma 
     lsmaOffSet 
     kLength 
     kSmoothing 
     dSmoothing 
     maTypeK 
     maTypeD 
     almaOffsetKD 
     almaSigmaKD 
     lsmaOffSetKD 
 stochFT(length, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD) 
  Parameters:
     length 
     kLength 
     kSmoothing 
     dSmoothing 
     maTypeK 
     maTypeD 
     almaOffsetKD 
     almaSigmaKD 
     lsmaOffSetKD 
 stochVolume(kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD) 
  Parameters:
     kLength 
     kSmoothing 
     dSmoothing 
     maTypeK 
     maTypeD 
     almaOffsetKD 
     almaSigmaKD 
     lsmaOffSetKD 
 stochMFI(source, length, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD) 
  Parameters:
     source 
     length 
     kLength 
     kSmoothing 
     dSmoothing 
     maTypeK 
     maTypeD 
     almaOffsetKD 
     almaSigmaKD 
     lsmaOffSetKD 
 stochOBV(source, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD) 
  Parameters:
     source 
     kLength 
     kSmoothing 
     dSmoothing 
     maTypeK 
     maTypeD 
     almaOffsetKD 
     almaSigmaKD 
     lsmaOffSetKD 
 stochPVI(source, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD) 
  Parameters:
     source 
     kLength 
     kSmoothing 
     dSmoothing 
     maTypeK 
     maTypeD 
     almaOffsetKD 
     almaSigmaKD 
     lsmaOffSetKD 
 stochNVI(source, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD) 
  Parameters:
     source 
     kLength 
     kSmoothing 
     dSmoothing 
     maTypeK 
     maTypeD 
     almaOffsetKD 
     almaSigmaKD 
     lsmaOffSetKD 
 stochPVT(source, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD) 
  Parameters:
     source 
     kLength 
     kSmoothing 
     dSmoothing 
     maTypeK 
     maTypeD 
     almaOffsetKD 
     almaSigmaKD 
     lsmaOffSetKD 
 stochVO(shortLen, longLen, maType, almaOffset, almaSigma, lsmaOffSet, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD) 
  Parameters:
     shortLen 
     longLen 
     maType 
     almaOffset 
     almaSigma 
     lsmaOffSet 
     kLength 
     kSmoothing 
     dSmoothing 
     maTypeK 
     maTypeD 
     almaOffsetKD 
     almaSigmaKD 
     lsmaOffSetKD 
 stochVROC(length, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD) 
  Parameters:
     length 
     kLength 
     kSmoothing 
     dSmoothing 
     maTypeK 
     maTypeD 
     almaOffsetKD 
     almaSigmaKD 
     lsmaOffSetKD 
 iftRSI(sourceRSI, lengthRSI, lengthIFT) 
  Parameters:
     sourceRSI 
     lengthRSI 
     lengthIFT 
 iftROC(sourceROC, lengthROC, lengthIFT) 
  Parameters:
     sourceROC 
     lengthROC 
     lengthIFT 
 iftUO(fastLength, middleLength, slowLength, lengthIFT) 
  Parameters:
     fastLength 
     middleLength 
     slowLength 
     lengthIFT 
 iftStoch(kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD, lengthIFT) 
  Parameters:
     kLength 
     kSmoothing 
     dSmoothing 
     maTypeK 
     maTypeD 
     almaOffsetKD 
     almaSigmaKD 
     lsmaOffSetKD 
     lengthIFT 
 iftTSI(source, shortLength, longLength, maType, almaOffset, almaSigma, lsmaOffSet, lengthIFT) 
  Parameters:
     source 
     shortLength 
     longLength 
     maType 
     almaOffset 
     almaSigma 
     lsmaOffSet 
     lengthIFT 
 iftCCI(source, length, maType, almaOffset, almaSigma, lsmaOffSet, lengthIFT) 
  Parameters:
     source 
     length 
     maType 
     almaOffset 
     almaSigma 
     lsmaOffSet 
     lengthIFT 
 iftFisher(length, lengthIFT) 
  Parameters:
     length 
     lengthIFT 
 iftMACD(source, fastLength, slowLength, signalLength, maTypeFast, maTypeSlow, maTypeMACD, almaOffset, almaSigma, lsmaOffSet, lengthIFT) 
  Parameters:
     source 
     fastLength 
     slowLength 
     signalLength 
     maTypeFast 
     maTypeSlow 
     maTypeMACD 
     almaOffset 
     almaSigma 
     lsmaOffSet 
     lengthIFT 
 iftWPR(source, length, lengthIFT) 
  Parameters:
     source 
     length 
     lengthIFT 
 iftMFI(source, length, lengthIFT) 
  Parameters:
     source 
     length 
     lengthIFT 
 iftCMF(length, lengthIFT) 
  Parameters:
     length 
     lengthIFT 
 iftVO(shortLen, longLen, maType, almaOffset, almaSigma, lsmaOffSet, lengthIFT) 
  Parameters:
     shortLen 
     longLen 
     maType 
     almaOffset 
     almaSigma 
     lsmaOffSet 
     lengthIFT 
 iftVROC(length, lengthIFT) 
  Parameters:
     length 
     lengthIFT 
 smiRSI(source, length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal) 
  Parameters:
     source 
     length 
     shortLengthTSI 
     longLengthTSI 
     maTypeTSI 
     almaOffsetTSI 
     almaSigmaTSI 
     lsmaOffSetTSI 
     maTypeSignal 
     smoothingLengthSignal 
     almaOffsetSignal 
     almaSigmaSignal 
     lsmaOffSetSignal 
 smiROC(source, length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal) 
  Parameters:
     source 
     length 
     shortLengthTSI 
     longLengthTSI 
     maTypeTSI 
     almaOffsetTSI 
     almaSigmaTSI 
     lsmaOffSetTSI 
     maTypeSignal 
     smoothingLengthSignal 
     almaOffsetSignal 
     almaSigmaSignal 
     lsmaOffSetSignal 
 smiVROC(length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal) 
  Parameters:
     length 
     shortLengthTSI 
     longLengthTSI 
     maTypeTSI 
     almaOffsetTSI 
     almaSigmaTSI 
     lsmaOffSetTSI 
     maTypeSignal 
     smoothingLengthSignal 
     almaOffsetSignal 
     almaSigmaSignal 
     lsmaOffSetSignal 
 smiWPR(source, length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal) 
  Parameters:
     source 
     length 
     shortLengthTSI 
     longLengthTSI 
     maTypeTSI 
     almaOffsetTSI 
     almaSigmaTSI 
     lsmaOffSetTSI 
     maTypeSignal 
     smoothingLengthSignal 
     almaOffsetSignal 
     almaSigmaSignal 
     lsmaOffSetSignal 
 smiFT(length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal) 
  Parameters:
     length 
     shortLengthTSI 
     longLengthTSI 
     maTypeTSI 
     almaOffsetTSI 
     almaSigmaTSI 
     lsmaOffSetTSI 
     maTypeSignal 
     smoothingLengthSignal 
     almaOffsetSignal 
     almaSigmaSignal 
     lsmaOffSetSignal 
 smiFT(source, length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal) 
  Parameters:
     source 
     length 
     shortLengthTSI 
     longLengthTSI 
     maTypeTSI 
     almaOffsetTSI 
     almaSigmaTSI 
     lsmaOffSetTSI 
     maTypeSignal 
     smoothingLengthSignal 
     almaOffsetSignal 
     almaSigmaSignal 
     lsmaOffSetSignal 
 smiCCI(source, length, maTypeCCI, almaOffsetCCI, almaSigmaCCI, lsmaOffSetCCI, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal) 
  Parameters:
     source 
     length 
     maTypeCCI 
     almaOffsetCCI 
     almaSigmaCCI 
     lsmaOffSetCCI 
     shortLengthTSI 
     longLengthTSI 
     maTypeTSI 
     almaOffsetTSI 
     almaSigmaTSI 
     lsmaOffSetTSI 
     maTypeSignal 
     smoothingLengthSignal 
     almaOffsetSignal 
     almaSigmaSignal 
     lsmaOffSetSignal 
 smiUO(fastLength, middleLength, slowLength, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal) 
  Parameters:
     fastLength 
     middleLength 
     slowLength 
     shortLengthTSI 
     longLengthTSI 
     maTypeTSI 
     almaOffsetTSI 
     almaSigmaTSI 
     lsmaOffSetTSI 
     maTypeSignal 
     smoothingLengthSignal 
     almaOffsetSignal 
     almaSigmaSignal 
     lsmaOffSetSignal 
 smiMACD(source, fastLength, slowLength, signalLength, maTypeFast, maTypeSlow, maTypeMACD, almaOffset, almaSigma, lsmaOffSet, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal) 
  Parameters:
     source 
     fastLength 
     slowLength 
     signalLength 
     maTypeFast 
     maTypeSlow 
     maTypeMACD 
     almaOffset 
     almaSigma 
     lsmaOffSet 
     shortLengthTSI 
     longLengthTSI 
     maTypeTSI 
     almaOffsetTSI 
     almaSigmaTSI 
     lsmaOffSetTSI 
     maTypeSignal 
     smoothingLengthSignal 
     almaOffsetSignal 
     almaSigmaSignal 
     lsmaOffSetSignal 
 smiVol(shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal) 
  Parameters:
     shortLengthTSI 
     longLengthTSI 
     maTypeTSI 
     almaOffsetTSI 
     almaSigmaTSI 
     lsmaOffSetTSI 
     maTypeSignal 
     smoothingLengthSignal 
     almaOffsetSignal 
     almaSigmaSignal 
     lsmaOffSetSignal 
 smiMFI(source, length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal) 
  Parameters:
     source 
     length 
     shortLengthTSI 
     longLengthTSI 
     maTypeTSI 
     almaOffsetTSI 
     almaSigmaTSI 
     lsmaOffSetTSI 
     maTypeSignal 
     smoothingLengthSignal 
     almaOffsetSignal 
     almaSigmaSignal 
     lsmaOffSetSignal 
 smiCMF(length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal) 
  Parameters:
     length 
     shortLengthTSI 
     longLengthTSI 
     maTypeTSI 
     almaOffsetTSI 
     almaSigmaTSI 
     lsmaOffSetTSI 
     maTypeSignal 
     smoothingLengthSignal 
     almaOffsetSignal 
     almaSigmaSignal 
     lsmaOffSetSignal 
 smiOBV(source, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal) 
  Parameters:
     source 
     shortLengthTSI 
     longLengthTSI 
     maTypeTSI 
     almaOffsetTSI 
     almaSigmaTSI 
     lsmaOffSetTSI 
     maTypeSignal 
     smoothingLengthSignal 
     almaOffsetSignal 
     almaSigmaSignal 
     lsmaOffSetSignal 
 smiPVT(source, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal) 
  Parameters:
     source 
     shortLengthTSI 
     longLengthTSI 
     maTypeTSI 
     almaOffsetTSI 
     almaSigmaTSI 
     lsmaOffSetTSI 
     maTypeSignal 
     smoothingLengthSignal 
     almaOffsetSignal 
     almaSigmaSignal 
     lsmaOffSetSignal 
 smiVO(shortLen, longLen, maType, almaOffset, almaSigma, lsmaOffSet, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal) 
  Parameters:
     shortLen 
     longLen 
     maType 
     almaOffset 
     almaSigma 
     lsmaOffSet 
     shortLengthTSI 
     longLengthTSI 
     maTypeTSI 
     almaOffsetTSI 
     almaSigmaTSI 
     lsmaOffSetTSI 
     maTypeSignal 
     smoothingLengthSignal 
     almaOffsetSignal 
     almaSigmaSignal 
     lsmaOffSetSignal 
 smiPVI(source, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal) 
  Parameters:
     source 
     shortLengthTSI 
     longLengthTSI 
     maTypeTSI 
     almaOffsetTSI 
     almaSigmaTSI 
     lsmaOffSetTSI 
     maTypeSignal 
     smoothingLengthSignal 
     almaOffsetSignal 
     almaSigmaSignal 
     lsmaOffSetSignal 
 smiNVI(source, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal) 
  Parameters:
     source 
     shortLengthTSI 
     longLengthTSI 
     maTypeTSI 
     almaOffsetTSI 
     almaSigmaTSI 
     lsmaOffSetTSI 
     maTypeSignal 
     smoothingLengthSignal 
     almaOffsetSignal 
     almaSigmaSignal 
     lsmaOffSetSignal 
 rsiVolume(length) 
  Parameters:
     length 
 rsiMA(sourceMA, lengthMA, maType, almaOffset, almaSigma, lsmaOffSet, lengthRSI) 
  Parameters:
     sourceMA 
     lengthMA 
     maType 
     almaOffset 
     almaSigma 
     lsmaOffSet 
     lengthRSI
Commission-aware Trade LabelsCommission-aware Trade Labels 
 Description: 
This library provides an easy way to visualize take-profit and stop-loss levels on your chart, taking into account trading commissions. The library calculates and displays the net profit or loss, along with other useful information such as risk/reward ratio, shares, and position size.
 Features: 
Configurable take-profit and stop-loss prices or percentages.
Set entry amount or shares.
Calculates and displays the risk/reward ratio.
Shows net profit or loss, considering trading commissions.
Customizable label appearance.
 Usage: 
Add the script to your chart.
Create an Order object for take-profit and stop-loss with desired configurations.
Call target_label() and stop_label() methods for each order object.
 Example: 
target_order = Order.new(take_profit_price=27483, stop_loss_price=28000, shares=0.2)
stop_order = Order.new(stop_loss_price=29000, shares=1)
target_order.target_label()
stop_order.stop_label()
This script is a powerful tool for visualizing your trading strategy's performance and helps you make better-informed decisions by considering trading commissions in your profit and loss calculations.
Library   "tradelabels" 
 entry_price(this) 
  Parameters:
     this : Order object
@return entry_price
 take_profit_price(this) 
  Parameters:
     this : Order object
@return take_profit_price
 stop_loss_price(this) 
  Parameters:
     this : Order object
@return stop_loss_price
 is_long(this) 
  Parameters:
     this : Order object
@return entry_price
 is_short(this) 
  Parameters:
     this : Order object
@return entry_price
 percent_to_target(this, target) 
  Parameters:
     this : Order object
     target : Target price
@return percent
 risk_reward(this) 
  Parameters:
     this : Order object
@return risk_reward_ratio
 shares(this) 
  Parameters:
     this : Order object
@return shares
 position_size(this) 
  Parameters:
     this : Order object
@return position_size
 commission_cost(this, target_price) 
  Parameters:
     this : Order object
@return commission_cost
     target_price 
 net_result(this, target_price) 
  Parameters:
     this : Order object
     target_price : The target price to calculate net result for (either take_profit_price or stop_loss_price)
@return net_result
 create_take_profit_label(this, prefix, size, offset_x, bg_color, text_color) 
  Parameters:
     this 
     prefix 
     size 
     offset_x 
     bg_color 
     text_color 
 create_stop_loss_label(this, prefix, size, offset_x, bg_color, text_color) 
  Parameters:
     this 
     prefix 
     size 
     offset_x 
     bg_color 
     text_color 
 create_entry_label(this, prefix, size, offset_x, bg_color, text_color) 
  Parameters:
     this 
     prefix 
     size 
     offset_x 
     bg_color 
     text_color 
 create_line(this, target_price, line_color, offset_x, line_style, line_width, draw_entry_line) 
  Parameters:
     this 
     target_price 
     line_color 
     offset_x 
     line_style 
     line_width 
     draw_entry_line 
 Order 
  Order
  Fields:
     entry_price : Entry price
     stop_loss_price : Stop loss price
     stop_loss_percent : Stop loss percent, default 2%
     take_profit_price : Take profit price
     take_profit_percent : Take profit percent, default 6%
     entry_amount : Entry amount, default 5000$
     shares : Shares
     commission : Commission, default 0.04%
Bitwise, Encode, DecodeLibrary   "Bitwise, Encode, Decode" 
Bitwise, Encode, Decode, and more Library
 docs() 
      Hover-Over Documentation for inside Text Editor
 bAnd(a, b) 
  Returns the bitwise AND of two integers  
  Parameters:
     a : `int` - The first integer
     b : `int` - The second integer
  Returns: `int` - The bitwise AND of the two integers
 bOr(a, b) 
  Performs a bitwise OR operation on two integers.  
  Parameters:
     a : `int` - The first integer.
     b : `int` - The second integer.
  Returns: `int` - The result of the bitwise OR operation.
 bXor(a, b) 
  Performs a bitwise Xor operation on two integers.  
  Parameters:
     a : `int` - The first integer.
     b : `int` - The second integer.
  Returns: `int` - The result of the bitwise Xor operation.
 bNot(n) 
  Performs a bitwise NOT operation on an integer.  
  Parameters:
     n : `int` - The integer to perform the bitwise NOT operation on.
  Returns: `int` - The result of the bitwise NOT operation.
 bShiftLeft(n, step) 
  Performs a bitwise left shift operation on an integer.  
  Parameters:
     n : `int` - The integer to perform the bitwise left shift operation on.
     step : `int` - The number of positions to shift the bits to the left.
  Returns: `int` - The result of the bitwise left shift operation.
 bShiftRight(n, step) 
  Performs a bitwise right shift operation on an integer.  
  Parameters:
     n : `int` - The integer to perform the bitwise right shift operation on.
     step : `int` - The number of bits to shift by.
  Returns: `int` - The result of the bitwise right shift operation.
 bRotateLeft(n, step) 
  Performs a bitwise right shift operation on an integer.
  Parameters:
     n : `int` - The int to perform the bitwise Left rotation on the bits.                        
     step : `int` - The number of bits to shift by.
  Returns: `int`- The result of the bitwise right shift operation.
 bRotateRight(n, step) 
  Performs a bitwise right shift operation on an integer.
  Parameters:
     n : `int` - The int to perform the bitwise Right rotation on the bits.
     step : `int` - The number of bits to shift by.
  Returns: `int` - The result of the bitwise right shift operation.
 bSetCheck(n, pos) 
  Checks if the bit at the given position is set to 1.
  Parameters:
     n : `int` - The integer to check.
     pos : `int` - The position of the bit to check.
  Returns: `bool` - True if the bit is set to 1, False otherwise.
 bClear(n, pos) 
  Clears a particular bit of an integer (changes from 1 to 0) passes if bit at pos is 0.
  Parameters:
     n : `int` - The integer to clear a bit from.
     pos : `int` - The zero-based index of the bit to clear.
  Returns: `int` - The result of clearing the specified bit.
 bFlip0s(n) 
  Flips all 0 bits in the number to 1.
  Parameters:
     n : `int` - The integer to flip the bits of.
  Returns: `int` - The result of flipping all 0 bits in the number.
 bFlip1s(n) 
  Flips all 1 bits in the number to 0.
  Parameters:
     n : `int` - The integer to flip the bits of.
  Returns: `int` - The result of flipping all 1 bits in the number.
 bFlipAll(n) 
  Flips all bits in the number.
  Parameters:
     n : `int` - The integer to flip the bits of.
  Returns: `int` - The result of flipping all bits in the number.
 bSet(n, pos, newBit) 
  Changes the value of the bit at the given position.
  Parameters:
     n : `int` - The integer to modify.
     pos : `int` - The position of the bit to change.
     newBit : `int` - na = flips bit at pos reguardless 1 or 0 | The new value of the bit (0 or 1).
  Returns: `int` - The modified integer.
 changeDigit(n, pos, newDigit) 
  Changes the value of the digit at the given position.
  Parameters:
     n : `int` - The integer to modify.
     pos : `int` - The position of the digit to change.
     newDigit : `int` - The new value of the digit (0-9).
  Returns: `int` - The modified integer.
 bSwap(n, i, j) 
  Switch the position of 2 bits of an int
  Parameters:
     n : `int` - int to manipulate
     i : `int` - bit pos to switch with j
     j : `int` - bit pos to switch with i
  Returns: `int` - new int with bits switched
 bPalindrome(n) 
  Checks to see if the binary form is a Palindrome (reads the same left to right and vice versa)
  Parameters:
     n : `int` - int to check
  Returns: `bool` - result of check
 bEven(n) 
  Checks if n is Even
  Parameters:
     n : `int` - The integer to check.
  Returns: `bool` - result.
 bOdd(n) 
  checks if n is Even if not even Odd
  Parameters:
     n : `int` - The integer to check.
  Returns: `bool` - result.
 bPowerOfTwo(n) 
  Checks if n is a Power of 2.
  Parameters:
     n : `int` - number to check.
  Returns: `bool` - result.
 bCount(n, to_count) 
  Counts the number of bits that are equal to 1 in an integer.
  Parameters:
     n : `int` - The integer to count the bits in.
     to_count  `string` -   the bits to count
  Returns: `int` - The number of bits that are equal to 1 in n.
 GCD(a, b) 
  Finds the greatest common divisor (GCD) of two numbers.
  Parameters:
     a : `int` - The first number.
     b : `int` - The second number.
  Returns: `int` - The GCD of a and b.
 LCM(a, b) 
  Finds the least common multiple (LCM) of two integers.
  Parameters:
     a : `int` - The first integer.
     b : `int` - The second integer.
  Returns: `int` - The LCM of a and b.
 aLCM(nums) 
  Finds the LCM of an array of integers.
  Parameters:
     nums : `int ` - The list of integers.
  Returns: `int` - The LCM of the integers in nums.
 adjustedLCM(nums, LCM) 
  adjust an array of integers to Least Common Multiple (LCM)
  Parameters:
     nums : `int ` - The first integer
     LCM : `int` - The second integer
  Returns: `int ` - array of ints with LCM
 charAt(str, pos) 
  gets a Char at a given position.
  Parameters:
     str : `string` - string to pull char from.
     pos : `int` - pos to get char from string (left to right index).
  Returns: `string` - char from pos of string or "" if pos is not within index range
 decimalToBinary(num) 
  Converts a decimal number to binary
  Parameters:
     num : `int` - The decimal number to convert to binary
  Returns: `string` - The binary representation of the decimal number
 decimalToBinary(num, to_binary_int) 
  Converts a decimal number to binary
  Parameters:
     num : `int` - The decimal number to convert to binary
     to_binary_int : `bool` - bool to convert to int or to string (true for int, false for string)
  Returns: `string` - The binary representation of the decimal number
 binaryToDecimal(binary) 
  Converts a binary number to decimal
  Parameters:
     binary : `string` - The binary number to convert to decimal
  Returns: `int` - The decimal representation of the binary number
 decimal_len(n) 
  way of finding decimal length using arithmetic
  Parameters:
     n  `float` - floating decimal point to get length of.
  Returns: `int` - number of decimal places
 int_len(n) 
  way of finding number length using arithmetic
  Parameters:
     n : `int`- value to find length of number
  Returns: `int` - lenth of nunber i.e. 23 == 2
 float_decimal_to_whole(n) 
  Converts a float decimal number to an integer `0.365 to 365`.
  Parameters:
     n : `string` - The decimal number represented as a string.
  Returns: `int` - The integer obtained by removing the decimal point and leading zeroes from s.
 fractional_part(x) 
  Returns the fractional part of a float.
  Parameters:
     x : `float` - The float to get the fractional part of.
  Returns: `float` - The fractional part of the float.
 form_decimal(a, b, zero_fix) 
  helper to form 2 ints into 1 float seperated by the decimal
  Parameters:
     a : `int` - a int
     b : `int` - b int
     zero_fix : `bool` - fix for trailing zeros being truncated when converting to float
  Returns: ` ` - float = float decimal of ints | string = string version of b for future use to ref length
 bEncode(n1, n2) 
  Encodes two numbers into one using bit OR. (fastest)
  Parameters:
     n1 : `int` - The first number to Encodes.
     n2 : `int` - The second number to Encodes.
  Returns: `int` - The result of combining the two numbers using bit OR.
 bDecode(n) 
  Decodes an integer created by the bCombine function.(fastest)
  Parameters:
     n : `int` - The integer to decode.
  Returns: ` ` - A tuple containing the two decoded components of the integer.
 Encode(a, b) 
  Encodes by seperating ints into left and right of decimal float
  Parameters:
     a : `int` - a int
     b : `int` - b int
  Returns: `float` - new float of encoded ints one on left of decimal point one on right
 Decode(encoded) 
  Decodes float of 2 ints seperated by decimal point
  Parameters:
     encoded : `float` - the encoded float value
  Returns: ` ` - tuple of the 2 ints from encoded float
 encode_heavy(a, b) 
  Encodes by combining numbers and tracking size in the
decimal of a floating number (slowest)
  Parameters:
     a : `int` - a int
     b : `int` - b int
  Returns: `float` - new decimal of encoded ints
 decode_heavy(encoded) 
  Decodes encoded float that tracks size of ints in float decimal 
  Parameters:
     encoded : `float` - encoded float
  Returns: ` ` - tuple of decoded ints
 decimal of float (slowest) 
  Parameters:
     encoded : `float` - the encoded float value
  Returns: ` ` - tuple of the 2 ints from encoded float
 Bitwise, Encode, Decode Docs  
 
  In the documentation you may notice the word decimal   
not used as normal this is because when referring to   
binary a decimal number is a number that  
can be represented with base 10 numbers 0-9   
(the wiki below explains better)  
  A rule of thumb for the two integers being   
encoded it to keep both numbers   
less than 65535 this is because anything lower uses 16 bits or less   
this will maintain 100% accuracy when decoding   
although it is possible to do numbers up to 2147483645 with   
this library doesnt seem useful enough  
to explain or demonstrate.  
  The functions provided work within this 32-bit range,   
where the highest number is all 1s and   
the lowest number is all 0s. These functions were created   
to overcome the lack of built-in bitwise functions in Pinescript.   
By combining two integers into a single number,  
the code can access both values i.e when   
indexing only one array index  
for a matrices row/column, thus improving execution time.   
This technique can be applied to various coding   
scenarios to enhance performance.  
  Bitwise functions are a way to use integers in binary form      
that can be used to speed up several different processes      
most languages have operators to perform these function such as      
`<<, >>, &, ^, |, ~` 
 
 en.wikipedia.org  
Simple Trendlines📈  Trendlines, made easy. 
Simple Trendlines is a carefully made library that provides an easy and accessible way to draw trendlines on the chart.
Containing only 10 properties and 2 methods, the implementation is designed to be understandable through an object-oriented structure and provides developers the opportunity to expand without having to deal with slope calculation while also ensuring that there's no leakage between the trendlines before they're drawn.
Developers only need to provide 5 expressions to get everything up in running. This includes the following but is not limited to
 
  The x-axis
  Point A (Y1 Value)
  Point B (Y2 Value)
  A condition to draw the line
  A condition to keep the trendline under continuation
 
Automatic x-axis calculation is not a built-in feature due to the inconsistency it could bring.
📕  Quick Example 
 
import HoanGhetti/SimpleTrendlines/1 as tl
input_len = input.int(defval = 10)
pivotLow = fixnan(ta.pivotlow(input_len, input_len))
xAxis = ta.valuewhen(ta.change(pivotLow), bar_index, 0) - ta.valuewhen(ta.change(pivotLow), bar_index, 1)
prevPivot = ta.valuewhen(ta.change(pivotLow), pivotLow, 1)
pivotCondition = ta.change(pivotLow) and pivotLow > prevPivot 
plData = tl.new(x_axis = xAxis, offset = input_len)
plData.drawLine(pivotCondition, prevPivot, pivotLow)
plData.drawTrendline(close > 0)
plData.lines.trendline.set_style(line.style_dashed)
plData.lines.trendline.set_width(2)
plData.lines.startline.set_width(2)
 
Excluding the styling at the bottom, that was only 8 lines of code which yields the following result.
  
⏳  Before continuing 
 
  The library does not support block-scoped execution. Conditions must be declared before and integrated as a parameter. This doesn't limit any capabilities and only involves thinking logically about precedence. It was made this way for code readability and to keep things organized.
  The offset value inside the TrendlineSettings object can potentially affect performance (although very minimal) if you're using strict mode. When using strict mode, it loops through historical values to then do backend calculations.
 
🔽 Getting Started 🔽
Creating trendlines without a library isn't a hard task. However, the library features a built-in system called strict mode. We'll dive further into this below.
 Creating an Instance 
You can create an instance of the library by calling the new() function. Passing an identifier is conventionally mandatory in this case so you can reference properties and methods.
 
import HoanGhetti/SimpleTrendlines/2 as tl 
lineData = tl.new(int x_axis, int offset, bool strictMode, int strictType)
___
int x_axis (Required) The distance between point A and point B provided by the user.
int offset (Optional) The offset from x2 and the current bar_index. Used in situations where conditions execute ahead of where the x2 location is such as pivót events.
bool strictMode (Optional) Strict mode works in the backend of things to ensure that the price hasn't closed below the trendline before the trendline is drawn.
int strictType (Optional) Only accepts 0 and 1, 0 ensures that the price during slope calculation is above the line, and 1 ensures that the price during slope calculation is below the line.
 
 The Initial Line 
After instantiating the library, we can go ahead use the identifer we made above and create an instance of our initial line by calling the drawLine() method.
 
lineData.drawLine(bool condition, float y1, float y2, float src)
___
bool condition (Required) The condition in order to draw a new line.
float y1 (Required) The y-value of point A.
float y2 (Required) The y-value of point B.
float src (Optional) Determines which value strict mode will actively check for leakage before a trendline is drawn.
Typically used if you're not referencing OHLC values for your y-values, or you want to check for another value to exceed the line besides using the close value.
 
 The Trendline 
The trendline that gets drawn solely uses the values of the initial line and can be called using the drawTrendline() method. The library enforces a condition as a parameter in order to maintain simplicity.
 
lineData.drawTrendline(bool condition)
___
bool condition (Required) The condition in order to maintain and continue drawing the trendline.
 
⚙️ Features 
🔹 Automatic Slope Calculation 
In the background, the library calculates the next Y2 and X2 values on every tick for the trendline. Preventing the developer from having to do such a process themself.
🔹 Object-Oriented 
Each object contains manipulative properties that allow the developer to debug and have the freedom they want.
🔹 Enforced Error Checking 
Runtime errors have been put in place to ensure you're doing things correctly.
🔹 Strict Mode & Offset 
Strict mode can only be used when the offset value is over 0. It's a feature that's only meant to function under scenarios where a condition executes further than where the X2 is relative to the current bar_index value.
Let's think about pivot systems. As you're aware, pivot events are detected based on historical factors. If a swing low occurred nth bars ago, then the pivot condition will execute at the current bar_index instead of executing nth bars back.
Now because of this, what if you wanted to draw a trendline when the pivot event is executed? The offset value takes care of this just as you would when developing your other scripts, basically how we always do bar_index - n. However, what does this mean for strict mode?
The photo below represents the logic behind the execution.
  
When looking at this image, imagine this just happened, the event just executed and the trendline is now drawn. Pay attention to all the values inside the surrounding box. As you can see there are some candles that closed below the trendline before the trendline was drawn.
From what I can see 5-6 candles closed below the trendline during slope calculation. The goal of strict mode is to be a provisional system that prevents such occurrences from happening.
Here's a photo with strict mode on.
  
🔹 Strict Type 
A parameter used in the new() function that acts as a representation of what strict mode should calculate for. It accepts only two values, 0 and 1.
 
0 - Ensures that all candles have closed above the trendline before the trendline is drawn.
1 - Ensures that all candles have closed below the trendline before the trendline is drawn.
 
In the most recent photo above, I used 0 for strict type, since I was wanting to have a clean trendline and ensure that not a single candlestick closed below.
If you want to reference something else besides the close value during strict mode calculation, you can change it in the drawLine() method. 
If it's still difficult to understand, think 0 for pivot lows, and 1 for pivot highs.
📕  Methods and Property Inheritance 
  
The library isn't crazy, but hopefully, it helps.
That is all.👍
f_maSelectLibrary   "f_maSelect" 
Easy to use drop-in facade function to lots of different moving average calculations, including some that are not natively available in PineScript v5 such as Zero-Lag EMA. Simply call f_maSelect(series float serie, simple string ma_type="sma", ma_length=14) instead of a ta.*ma() call and you get access to all MAs offered by PineScript and more.
 zema(src, len) 
  Zero-lag EMA (ZLMA)
  Parameters:
     src : Input series
     len : Lookback period
  Returns: Series smoothed with ZLMA
 approximate_sma(x, ma_length) 
  Approximate Standard Moving Average, which substracts the average instead of popping the oldest element, hence losing the base frequency and is why it is approximative. For some reason, this appears to give the same results as a standard RMA
  Parameters:
     x : Input series.
     ma_length : Lookback period.
  Returns: Approximate SMA series.
 f_maSelect(serie, ma_type, ma_length) 
  Generalized moving average selector
  Parameters:
     serie : Input series
     ma_type : String describing which moving average to use
     ma_length : Lookback period
  Returns: Serie smoothed with the selected moving average.
 generalized_dev(src, length, avg, lmode) 
  Generalized deviation calculation: Whereas other Bollinger Bands often just change the basis but not the stdev calculation, the correct way to change the basis is to also change it inside the stdev calculation.
  Parameters:
     src : Series to use (default: close)
     length : Lookback period
     avg : Average basis to use to calculate the standard deviation
     lmode : L1 or L2 regularization? (ie, lmode=1 uses abs() to cutoff negative values hence it calculates the Mean Absolute Deviation as does the ta.dev(), lmode=2 uses sum of squares hence it calculates the true Standard Deviation as the ta.stdev() function does). See also the research works of everget: 
  Returns: stdev Standard deviation series
 generalized_dev_discount(src, length, avg, lmode, temporal_discount) 
  Standard deviation calculation but with different probabilities assigned to each bar, with newer bars having more weights en.wikipedia.org
  Parameters:
     src : Series to use (default: close)
     length : Lookback period
     avg : Average basis to use to calculate the standard deviation
     lmode : L1 or L2 regularization? (ie, lmode=1 uses abs() to cutoff negative values hence it calculates the Mean Absolute Deviation as does the ta.dev(), lmode=2 uses sum of squares hence it calculates the true Standard Deviation as the ta.stdev() function does). See also the research works of everget: 
     temporal_discount : Probabilistic gamma factor to discount old values in favor of new ones, higher value = more weight to newer bars
  Returns: stdev Standard deviation series
 median_absdev(src, length, median) 
  Median Absolute Deviation
  Parameters:
     src : Input series
     length : Lookback period
     median : Median already calculated on the input series
  Returns: mad, the median absolute deviation value
wbburgin_utilsLibrary   "wbburgin_utils" 
 trendUp(source) 
  Parameters:
     source 
 smoothrng(source, sampling_period, range_mult) 
  Parameters:
     source 
     sampling_period 
     range_mult 
 rngfilt(source, smoothrng) 
  Parameters:
     source 
     smoothrng 
 fusion(overallLength, rsiLength, mfiLength, macdLength, cciLength, tsiLength, rviLength, atrLength, adxLength) 
  Parameters:
     overallLength 
     rsiLength 
     mfiLength 
     macdLength 
     cciLength 
     tsiLength 
     rviLength 
     atrLength 
     adxLength 
 zonestrength(amplitude, wavelength) 
  Parameters:
     amplitude 
     wavelength 
 atr_anysource(source, atr_length) 
  Parameters:
     source 
     atr_length 
 supertrend_anysource(source, factor, atr_length) 
  Parameters:
     source 
     factor 
     atr_length
VolumeIndicatorsLibrary   "VolumeIndicators" 
This is a library of 'Volume Indicators'. 
It aims to facilitate the grouping of this category of indicators, and also offer the customized supply of the source, not being restricted to just the closing price.
 Indicators: 
1. Volume Moving Average (VMA): 
Moving average of volume. Identify trends in trading volume.
2. Money Flow Index (MFI): Measures volume pressure in a range of 0 to 100. 
Calculates the ratio of volume when the price goes up and when the price goes down
3. On-Balance Volume (OBV): 
Identify divergences between trading volume and an asset's price. 
Sum of trading volume when the price rises and subtracts volume when the price falls.
4. Accumulation/Distribution (A/D): 
Identifies buying and selling pressure by tracking the flow of money into and out of an asset based on volume patterns.
5. Chaikin Money Flow (CMF):
A variation of A/D that takes into account the daily price variation and weighs trading volume accordingly.
6. Volume Oscillator (VO):
Identify divergences between trading volume and an asset's price. Ratio of change of volume, from a fast period in relation to a long period.
7. Positive Volume Index (PVI):
Identify the upward strength of an asset. Volume when price rises divided by total volume.
8. Negative Volume Index (NVI):
Identify the downward strength of an asset. Volume when price falls divided by total volume.
9. Price-Volume Trend (PVT):
Identify the strength of an asset's price trend based on its trading volume. Cumulative change in price with volume factor
 vma(length, maType, almaOffset, almaSigma, lsmaOffSet) 
  @description Volume Moving Average (VMA)
  Parameters:
     length : (int) Length for moving average
     maType : (int) Type of moving average for smoothing
     almaOffset : (float) Offset for Arnauld Legoux Moving Average
     almaSigma : (float) Sigma for Arnauld Legoux Moving Average
     lsmaOffSet : (float) Offset for Least Squares Moving Average
  Returns: (float) Moving average of Volume
 mfi(source, length) 
  @description MFI (Money Flow Index).
Uses both price and volume to measure buying and selling pressure in an asset.
  Parameters:
     source : (float) Source of series (close, high, low, etc.)
     length 
  Returns: (float) Money Flow series
 obv(source) 
  @description On Balance Volume (OBV)
Same as ta.obv(), but with customized type of source
  Parameters:
     source : (float) Series
  Returns: (float) OBV
 ad() 
  @description Accumulation/Distribution (A/D)
  Returns: (float) Accumulation/Distribution (A/D) series
 cmf(length) 
  @description CMF (Chaikin Money Flow).
Measures the flow of money into or out of an asset over time, using a combination of price and volume, and is used to identify the strength and direction of a trend.
  Parameters:
     length 
  Returns: (float) Chaikin Money Flow series
 vo(shortLen, longLen, maType, almaOffset, almaSigma, lsmaOffSet) 
  @description Volume Oscillator (VO)
  Parameters:
     shortLen : (int) Fast period for volume
     longLen : (int) Slow period for volume
     maType : (int) Type of moving average for smoothing
     almaOffset 
     almaSigma 
     lsmaOffSet 
  Returns: (float) Volume oscillator
 pvi(source) 
  @description Positive Volume Index (PVI)
Same as ta.pvi(), but with customized type of source
  Parameters:
     source : (float) Series
  Returns: (float) PVI
 nvi(source) 
  @description Negative Volume Index (NVI)
Same as ta.nvi(), but with customized type of source
  Parameters:
     source : (float) Series
  Returns: (float) PVI
 pvt(source) 
  @description Price-Volume Trend (PVT)
Same as ta.pvt(), but with customized type of source
  Parameters:
     source : (float) Series
  Returns: (float) PVI
SILLibrary   "SIL" 
 mean_src(x, y) 
  calculates moving average :  x is the source of price (OHLC) & y = the lookback period
  Parameters:
     x 
     y 
 stan_dev(x, y, z) 
  calculates standard deviation,  x = source of price (OHLC), y = the average lookback, z = average given prior two float and intger inputs, call the f_avg_src() function in f_stan_dev()
  Parameters:
     x 
     y 
     z 
 vawma(x, y) 
  calculates volume weighted moving average, x = source of price (OHLC), y = loookback period
  Parameters:
     x 
     y 
 gethurst(x, y, z) 
  calculates the Hurst Exponent and Hurst Exponent average, x = source of price (OHLC), y = lookback period for Hurst Exponent Calculation, z = lookback period for average Hurst Exponent
  Parameters:
     x 
     y 
     z
OfekIndicatorsLibLibrary   "OfekIndicatorsLib" 
TODO: add library description here
 ichiClouds(conversionPeriods, basePeriods, laggingSpan2Periods) 
  Parameters:
     conversionPeriods 
     basePeriods 
     laggingSpan2Periods 
 trama(tramaSrc, tramaLength) 
  Parameters:
     tramaSrc 
     tramaLength 
 kdj(ilong, isig, startFrom) 
  Parameters:
     ilong 
     isig 
     startFrom(look into history)
ulibLibrary   "ulib" 
 Stochastic(length, d_smooth) 
  Parameters:
     length 
     d_smooth 
 bull_stoch_condition(k, d) 
  Parameters:
     k 
     d 
 ema_condition(ema_1, ema_2, ema_3) 
  Parameters:
     ema_1 
     ema_2 
     ema_3 
 bull_fractal_condition(n) 
  Parameters:
     n 
 Bull(Fractal, ema, stochastic_osc) 
  Parameters:
     Fractal 
     ema 
     stochastic_osc
PitchforkMethodsLibrary   "PitchforkMethods" 
Methods associated with Pitchfork and Pitchfork Drawing. Depends on the library PitchforkTypes for Pitchfork/PitchforkDrawing objects which in turn use DrawingTypes for basic objects Point/Line/LineProperties. Also depends on DrawingMethods for related methods
 tostring(this) 
  Converts PitchforkTypes/Fork object to string representation
  Parameters:
     this : PitchforkTypes/Fork object
  Returns: string representation of PitchforkTypes/Fork
 tostring(this) 
  Converts Array of PitchforkTypes/Fork object to string representation
  Parameters:
     this : Array of PitchforkTypes/Fork object
  Returns: string representation of PitchforkTypes/Fork array
 tostring(this, sortKeys, sortOrder) 
  Converts PitchforkTypes/PitchforkProperties object to string representation
  Parameters:
     this : PitchforkTypes/PitchforkProperties object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
  Returns: string representation of PitchforkTypes/PitchforkProperties
 tostring(this, sortKeys, sortOrder) 
  Converts PitchforkTypes/PitchforkDrawingProperties object to string representation
  Parameters:
     this : PitchforkTypes/PitchforkDrawingProperties object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
  Returns: string representation of PitchforkTypes/PitchforkDrawingProperties
 tostring(this, sortKeys, sortOrder) 
  Converts PitchforkTypes/Pitchfork object to string representation
  Parameters:
     this : PitchforkTypes/Pitchfork object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
  Returns: string representation of PitchforkTypes/Pitchfork
 createDrawing(this) 
  Creates PitchforkTypes/PitchforkDrawing from PitchforkTypes/Pitchfork object
  Parameters:
     this : PitchforkTypes/Pitchfork object
  Returns: PitchforkTypes/PitchforkDrawing object created
 createDrawing(this) 
  Creates PitchforkTypes/PitchforkDrawing array from PitchforkTypes/Pitchfork array of objects
  Parameters:
     this : array of PitchforkTypes/Pitchfork object
  Returns: array of PitchforkTypes/PitchforkDrawing object created
 draw(this) 
  draws from PitchforkTypes/PitchforkDrawing object
  Parameters:
     this : PitchforkTypes/PitchforkDrawing object
  Returns: PitchforkTypes/PitchforkDrawing object drawn
 delete(this) 
  deletes PitchforkTypes/PitchforkDrawing object
  Parameters:
     this : PitchforkTypes/PitchforkDrawing object
  Returns: PitchforkTypes/PitchforkDrawing object deleted
 delete(this) 
  deletes underlying drawing of PitchforkTypes/Pitchfork object
  Parameters:
     this : PitchforkTypes/Pitchfork object
  Returns: PitchforkTypes/Pitchfork object deleted
 delete(this) 
  deletes array of PitchforkTypes/PitchforkDrawing objects
  Parameters:
     this : Array of PitchforkTypes/PitchforkDrawing object
  Returns: Array of PitchforkTypes/PitchforkDrawing object deleted
 delete(this) 
  deletes underlying drawing in array of PitchforkTypes/Pitchfork objects
  Parameters:
     this : Array of PitchforkTypes/Pitchfork object
  Returns: Array of PitchforkTypes/Pitchfork object deleted
 clear(this) 
  deletes array of PitchforkTypes/PitchforkDrawing objects and clears the array
  Parameters:
     this : Array of PitchforkTypes/PitchforkDrawing object
  Returns: void
 clear(this) 
  deletes array of PitchforkTypes/Pitchfork objects and clears the array
  Parameters:
     this : Array of Pitchfork/Pitchfork object
  Returns: void
PitchforkTypesLibrary   "PitchforkTypes" 
User Defined Types to be used for Pitchfork and Drawing elements of Pitchfork. Depends on DrawingTypes for Point, Line, and LineProperties objects
 PitchforkDrawingProperties 
  Pitchfork Drawing Properties object
  Fields:
     extend : If set to true, forks are extended towards right. Default is true
     fill : Fill forklines with transparent color. Default is true
     fillTransparency : Transparency at which fills are made. Only considered when fill is set. Default is 80
     forceCommonColor : Force use of common color for forks and fills. Default is false
     commonColor : common fill color. Used only if ratio specific fill colors are not available or if forceCommonColor is set to true.
 PitchforkDrawing 
  Pitchfork drawing components
  Fields:
     medianLine : Median line of the pitchfork
     baseLine : Base line of the pitchfork
     forkLines : fork lines of the pitchfork
     linefills : Linefills between forks
 Fork 
  Fork object property
  Fields:
     ratio : Fork ratio
     forkColor : color of fork. Default is blue
     include : flag to include the fork in drawing. Default is true
 PitchforkProperties 
  Pitchfork Properties
  Fields:
     forks : Array of Fork objects
     type : Pitchfork type. Supported values are "regular", "schiff", "mschiff", Default is regular
     inside : Flag to identify if to draw inside fork. If set to true, inside fork will be drawn
 Pitchfork 
  Pitchfork object
  Fields:
     a : Pivot Point A of pitchfork
     b : Pivot Point B of pitchfork
     c : Pivot Point C of pitchfork
     properties : PitchforkProperties object which determines type and composition of pitchfork
     dProperties : Drawing properties for pitchfork
     lProperties : Common line properties for Pitchfork lines
     drawing : PitchforkDrawing object
ZigzagMethodsLibrary   "ZigzagMethods" 
Object oriented implementation of Zigzag methods. Please refer to ZigzagTypes library for User defined types used in this library
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts ZigzagTypes/Pivot object to string representation
  Parameters:
     this : ZigzagTypes/Pivot
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of ZigzagTypes/Pivot
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts Array of Pivot objects to string representation
  Parameters:
     this : Pivot object array
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of Pivot object array
 tostring(this) 
  Converts ZigzagFlags object to string representation
  Parameters:
     this : ZigzagFlags object
  Returns: string representation of ZigzagFlags
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts ZigzagTypes/Zigzag object to string representation
  Parameters:
     this : ZigzagTypes/Zigzagobject
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of ZigzagTypes/Zigzag
 calculate(this, ohlc, indicators, indicatorNames) 
  Calculate zigzag based on input values and indicator values
  Parameters:
     this : Zigzag object
     ohlc : Array containing OHLC values. Can also have custom values for which zigzag to be calculated
     indicators : Array of indicator values
     indicatorNames : Array of indicator names for which values are present. Size of indicators array should be equal to that of indicatorNames
  Returns: current Zigzag object
 calculate(this) 
  Calculate zigzag based on properties embedded within Zigzag object
  Parameters:
     this : Zigzag object
  Returns: current Zigzag object
 nextlevel(this) 
  Calculate Next Level Zigzag based on the current calculated zigzag object
  Parameters:
     this : Zigzag object
  Returns: Next Level Zigzag object
 clear(this) 
  Clears zigzag drawings array
  Parameters:
     this : array
  Returns: void
 drawfresh(this) 
  draws fresh zigzag based on properties embedded in ZigzagDrawing object
  Parameters:
     this : ZigzagDrawing object
  Returns: ZigzagDrawing object
 drawcontinuous(this) 
  draws zigzag based on the zigzagmatrix input
  Parameters:
     this : ZigzagDrawing object
  Returns: 
ZigzagTypesLibrary   "ZigzagTypes" 
Zigzag related user defined types. Depends on DrawingTypes library for basic types
 Indicator 
  Indicator is collection of indicator values applied on high, low and close
  Fields:
     indicatorHigh : Indicator Value applied on High
     indicatorLow : Indicator Value applied on Low
 PivotCandle 
  PivotCandle represents data of the candle which forms either pivot High or pivot low or both
  Fields:
     _high : High price of candle forming the pivot
     _low : Low price of candle forming the pivot
     length : Pivot length
     pHighBar : represents number of bar back the pivot High occurred.
     pLowBar : represents number of bar back the pivot Low occurred.
     pHigh : Pivot High Price
     pLow : Pivot Low Price
     indicators : Array of Indicators - allows to add multiple
 Pivot 
  Pivot refers to zigzag pivot. Each pivot can contain various data
  Fields:
     point : pivot point coordinates
     dir : direction of the pivot. Valid values are 1, -1, 2, -2
     level : is used for multi level zigzags. For single level, it will always be 0
     ratio : Price Ratio based on previous two pivots
     indicatorNames : Names of the indicators applied on zigzag
     indicatorValues : Values of the indicators applied on zigzag
     indicatorRatios : Ratios of the indicators applied on zigzag based on previous 2 pivots
 ZigzagFlags 
  Flags required for drawing zigzag. Only used internally in zigzag calculation. Should not set the values explicitly
  Fields:
     newPivot : true if the calculation resulted in new pivot
     doublePivot : true if the calculation resulted in two pivots on same bar
     updateLastPivot : true if new pivot calculated replaces the old one.
 Zigzag 
  Zigzag object which contains whole zigzag calculation parameters and pivots
  Fields:
     length : Zigzag length. Default value is 5
     numberOfPivots : max number of pivots to hold in the calculation. Default value is 20
     offset : Bar offset to be considered for calculation of zigzag. Default is 0 - which means calculation is done based on the latest bar.
     level : Zigzag calculation level - used in multi level recursive zigzags
     zigzagPivots : array which holds the last n pivots calculated. 
     flags : ZigzagFlags object which is required for continuous drawing of zigzag lines.
 ZigzagObject 
  Zigzag Drawing Object
  Fields:
     zigzagLine : Line joining two pivots
     zigzagLabel : Label which can be used for drawing the values, ratios, directions etc.
 ZigzagProperties 
  Object which holds properties of zigzag drawing. To be used along with ZigzagDrawing
  Fields:
     lineColor : Zigzag line color. Default is color.blue
     lineWidth : Zigzag line width. Default is 1
     lineStyle : Zigzag line style. Default is line.style_solid. 
     showLabel : If set, the drawing will show labels on each pivot. Default is false
     textColor : Text color of the labels. Only applicable if showLabel is set to true.
     maxObjects : Max number of zigzag lines to display. Default is 300
     xloc : Time/Bar reference to be used for zigzag drawing. Default is Time - xloc.bar_time.
 ZigzagDrawing 
  Object which holds complete zigzag drawing objects and properties.
  Fields:
     properties : ZigzagProperties object which is used for setting the display styles of zigzag
     drawings : array which contains lines and labels of zigzag drawing.
     zigzag : Zigzag object which holds the calculations.
DrawingMethodsLibrary   "DrawingMethods" 
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/Point object to string representation
  Parameters:
     this : DrawingTypes/Point object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/Point
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/LineProperties object to string representation
  Parameters:
     this : DrawingTypes/LineProperties object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/LineProperties
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/Line object to string representation
  Parameters:
     this : DrawingTypes/Line object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/Line
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/LabelProperties object to string representation
  Parameters:
     this : DrawingTypes/LabelProperties object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/LabelProperties
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/Label object to string representation
  Parameters:
     this : DrawingTypes/Label object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/Label
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/Linefill object to string representation
  Parameters:
     this : DrawingTypes/Linefill object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/Linefill
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/BoxProperties object to string representation
  Parameters:
     this : DrawingTypes/BoxProperties object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/BoxProperties
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/BoxText object to string representation
  Parameters:
     this : DrawingTypes/BoxText object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/BoxText
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/Box object to string representation
  Parameters:
     this : DrawingTypes/Box object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/Box
 delete(this) 
  Deletes line from DrawingTypes/Line object
  Parameters:
     this : DrawingTypes/Line object
  Returns: Line object deleted
 delete(this) 
  Deletes label from DrawingTypes/Label object
  Parameters:
     this : DrawingTypes/Label object
  Returns: Label object deleted
 delete(this) 
  Deletes Linefill from DrawingTypes/Linefill object
  Parameters:
     this : DrawingTypes/Linefill object
  Returns: Linefill object deleted
 delete(this) 
  Deletes box from DrawingTypes/Box object
  Parameters:
     this : DrawingTypes/Box object
  Returns: DrawingTypes/Box object deleted
 delete(this) 
  Deletes lines from array of DrawingTypes/Line objects
  Parameters:
     this : Array of DrawingTypes/Line objects
  Returns: Array of DrawingTypes/Line objects
 delete(this) 
  Deletes labels from array of DrawingTypes/Label objects
  Parameters:
     this : Array of DrawingTypes/Label objects
  Returns: Array of DrawingTypes/Label objects
 delete(this) 
  Deletes linefill from array of DrawingTypes/Linefill objects
  Parameters:
     this : Array of DrawingTypes/Linefill objects
  Returns: Array of DrawingTypes/Linefill objects
 delete(this) 
  Deletes boxes from array of DrawingTypes/Box objects
  Parameters:
     this : Array of DrawingTypes/Box objects
  Returns: Array of DrawingTypes/Box objects
 clear(this) 
  clear items from array of DrawingTypes/Line while deleting underlying objects
  Parameters:
     this : array
  Returns: void
 clear(this) 
  clear items from array of DrawingTypes/Label while deleting underlying objects
  Parameters:
     this : array
  Returns: void
 clear(this) 
  clear items from array of DrawingTypes/Linefill while deleting underlying objects
  Parameters:
     this : array
  Returns: void
 clear(this) 
  clear items from array of DrawingTypes/Box while deleting underlying objects
  Parameters:
     this : array
  Returns: void
 draw(this) 
  Creates line from DrawingTypes/Line object
  Parameters:
     this : DrawingTypes/Line object
  Returns: line created from DrawingTypes/Line object
 draw(this) 
  Creates lines from array of DrawingTypes/Line objects
  Parameters:
     this : Array of DrawingTypes/Line objects
  Returns: Array of DrawingTypes/Line objects
 draw(this) 
  Creates label from DrawingTypes/Label object
  Parameters:
     this : DrawingTypes/Label object
  Returns: label created from DrawingTypes/Label object
 draw(this) 
  Creates labels from array of DrawingTypes/Label objects
  Parameters:
     this : Array of DrawingTypes/Label objects
  Returns: Array of DrawingTypes/Label objects
 draw(this) 
  Creates linefill object from DrawingTypes/Linefill
  Parameters:
     this : DrawingTypes/Linefill objects
  Returns: linefill object created
 draw(this) 
  Creates linefill objects from array of DrawingTypes/Linefill objects
  Parameters:
     this : Array of DrawingTypes/Linefill objects
  Returns: Array of DrawingTypes/Linefill used for creating linefills
 draw(this) 
  Creates box from DrawingTypes/Box object
  Parameters:
     this : DrawingTypes/Box object
  Returns: box created from DrawingTypes/Box object
 draw(this) 
  Creates labels from array of DrawingTypes/Label objects
  Parameters:
     this : Array of DrawingTypes/Label objects
  Returns: Array of DrawingTypes/Label objects
 createLabel(this, lblText, tooltip, properties) 
  Creates DrawingTypes/Label object from DrawingTypes/Point
  Parameters:
     this : DrawingTypes/Point object
     lblText : Label text
     tooltip : Tooltip text. Default is na
     properties : DrawingTypes/LabelProperties object. Default is na - meaning default values are used.
  Returns: DrawingTypes/Label object
 createLine(this, other, properties) 
  Creates DrawingTypes/Line object from one DrawingTypes/Point to other
  Parameters:
     this : First DrawingTypes/Point object
     other : Second DrawingTypes/Point object
     properties : DrawingTypes/LineProperties object. Default set to na - meaning default values are used.
  Returns: DrawingTypes/Line object
 createLinefill(this, other, fillColor, transparency) 
  Creates DrawingTypes/Linefill object from DrawingTypes/Line object to other DrawingTypes/Line object
  Parameters:
     this : First DrawingTypes/Line object
     other : Other DrawingTypes/Line object
     fillColor : fill color of linefill. Default is color.blue
     transparency : fill transparency for linefill. Default is 80
  Returns: Array of DrawingTypes/Linefill object
 createBox(this, other, properties, textProperties) 
  Creates DrawingTypes/Box object from one DrawingTypes/Point to other
  Parameters:
     this : First DrawingTypes/Point object
     other : Second DrawingTypes/Point object
     properties : DrawingTypes/BoxProperties object. Default set to na - meaning default values are used.
     textProperties : DrawingTypes/BoxText object. Default is na - meaning no text will be drawn
  Returns: DrawingTypes/Box object
 createBox(this, properties, textProperties) 
  Creates DrawingTypes/Box object from DrawingTypes/Line as diagonal line
  Parameters:
     this : Diagonal DrawingTypes/PoLineint object
     properties : DrawingTypes/BoxProperties object. Default set to na - meaning default values are used.
     textProperties : DrawingTypes/BoxText object. Default is na - meaning no text will be drawn
  Returns: DrawingTypes/Box object
DrawingTypesLibrary   "DrawingTypes" 
User Defined Types for basic drawing structure. Other types and methods will be built on these.
 Point 
  Point refers to point on chart
  Fields:
     price : pivot price
     bar : pivot bar
     bartime : pivot bar time
 LineProperties 
  Properties of line object
  Fields:
     xloc : X Reference - can be either xloc.bar_index or xloc.bar_time. Default is xloc.bar_index
     extend : Property which sets line to extend towards either right or left or both. Valid values are extend.right, extend.left, extend.both, extend.none. Default is extend.none
     color : Line color
     style : Line style, valid values are line.style_solid, line.style_dashed, line.style_dotted, line.style_arrow_left, line.style_arrow_right, line.style_arrow_both. Default is line.style_solid
     width : Line width. Default is 1
 Line 
  Line object created from points
  Fields:
     start : Starting point of the line
     end : Ending point of the line
     properties : LineProperties object which defines the style of line
     object : Derived line object
 LabelProperties 
  Properties of label object
  Fields:
     xloc : X Reference - can be either xloc.bar_index or xloc.bar_time. Default is xloc.bar_index
     yloc : Y reference - can be yloc.price, yloc.abovebar, yloc.belowbar. Default is yloc.price
     color : Label fill color
     style : Label style as defined in www.tradingview.com Default is label.style_none
     textcolor : text color. Default is color.black
     size : Label text size. Default is size.normal. Other values are size.auto, size.tiny, size.small, size.normal, size.large, size.huge
     textalign : Label text alignment. Default if text.align_center. Other allowed values - text.align_right, text.align_left, text.align_top, text.align_bottom
     text_font_family : The font family of the text. Default value is font.family_default. Other available option is font.family_monospace
 Label 
  Label object
  Fields:
     point : Point where label is drawn
     lblText : label text
     tooltip : Tooltip text. Default is na
     properties : LabelProperties object
     object : Pine label object
 Linefill 
  Linefill object
  Fields:
     line1 : First line to create linefill
     line2 : Second line to create linefill
     fillColor : Fill color
     transparency : Fill transparency range from 0 to 100
     object : linefill object created from wrapper
 BoxProperties 
  BoxProperties object
  Fields:
     border_color : Box border color. Default is color.blue
     bgcolor : box background color
     border_width : Box border width. Default is 1
     border_style : Box border style. Default is line.style_solid
     extend : Extend property of box. default is extend.none
     xloc : defines if drawing needs to be done based on bar index or time. default is xloc.bar_index
 BoxText 
  Box Text properties.
  Fields:
     boxText : Text to be printed on the box
     text_size : Text size. Default is size.auto
     text_color : Box text color. Default is color.yellow. 
     text_halign : horizontal align style - default is text.align_center
     text_valign : vertical align style - default is text.align_center
     text_wrap : text wrap style - default is text.wrap_auto
     text_font_family : Text font. Default is
 Box 
  Box object
  Fields:
     p1 : Diagonal point one
     p2 : Diagonal point two
     properties : Box properties
     textProperties : Box text properties
     object : Box object created
Liquidation_linesLibrary   "Liquidationline" 
 f_calculateLeverage(_leverage, _maintainance, _value, _direction) 
  Parameters:
     _leverage 
     _maintainance 
     _value 
     _direction 
 f_liqline_update(_Liqui_Line, _killonlowhigh) 
  Parameters:
     _Liqui_Line 
     _killonlowhigh 
 f_liqline_draw(_Liqui_Line, _priceorliq) 
  Parameters:
     _Liqui_Line 
     _priceorliq 
 f_liqline_add(_Liqui_Line, linetoadd, _limit) 
  Parameters:
     _Liqui_Line 
     linetoadd 
     _limit 
 Liquidationline 
  Fields:
     creationtime 
     stoptime 
     price 
     leverage 
     maintainance 
     line_active 
     line_color 
     line_thickness 
     line_style 
     line_direction 
     line_finished 
     text_active 
     text_size 
     text_color 
this library can draw typical liquidation lines, which can be called e.g. by indicator signals
You can see the default implementation in the lower part of the code, starting with RUNTIME
Don't forget to increase max lines to 500 in your script.
It can look like this screenshot here, with only minor changes to your executing script. 
The base is the same
AntaresLibrary   "Antares" 
this library contains some utility functions that I use in my open source scripts including moving average helpers, candlstick helpers, money management, formatters, convertors, webhook integration, analysis, filters and drawing helpers
 ma(type, length, source) 
  Wraps all ma functions
  Parameters:
     type : Either SMA or EMA or RMA or WMA or VWMA
     length : Number of bars (length).
     source : Series of values to process.
  Returns: Moving average of `source` for `length` bars back by the of MA.
 bb(ma, length, mult, source) 
  Overwrites `ta.bb` duo to limitations of simple int.float mult. Bollinger Bands. A Bollinger Band is a technical analysis tool defined by a set of lines plotted two standard deviations (positively and negatively) away from a simple moving average (SMA) of the security's price, but can be adjusted to user preferences.
  Parameters:
     ma : Either SMA or EMA or RMA or WMA or VWMA
     length : Number of bars (length).
     mult : Standard deviation factor.
     source : Series of values to process.
  Returns: Bollinger Bands.
 atr(length, h, l, c) 
  Overwrites `ta.atr` duo to limitations of simple int length. Function atr (average true range) returns the RMA of true range. True range is max(high - low, abs(high - close ), abs(low - close )).
  Parameters:
     length : Number of bars (length).
     h : High price high price.
     l : low price.
     c : Close price close price.
  Returns: Average true range.
 rsi(length, source) 
  Overwrites `ta.rsi` duo to limitations of simple int length. Relative strength index. It is calculated using the `ta.rma()` of upward and downward changes of `source` over the last `length` bars.
  Parameters:
     length : Number of bars (length).
     source : Series of values to process.
  Returns: Relative strength index.
 lowest(length, source, start) 
  Lowest value for a given number of bars back.
  Parameters:
     length : Number of bars (length).
     source : Series of values to process.
     start : Series number of bars that should be skipped before process.
  Returns: Lowest value in the series.
 highest(length, source, start) 
  Highest value for a given number of bars back.
  Parameters:
     length : Number of bars (length).
     source : Series of values to process.
     start : Series number of bars that should be skipped before process.
  Returns: Highest value in the series.
 atr_multiplier(rsi, atr_max_multiplier) 
  Dynamic atr multiplier calculated by RSI.
  Parameters:
     rsi : Relative strength index.
     atr_max_multiplier : The maximum multiplier of atr
  Returns: Dynamic multiplier of ATR
 offset(atr, atr_multiplier) 
  Safe dynamic offset you need to use in your stoploss, stop buy/sell, etc.
  Parameters:
     atr : Average true range.
     atr_multiplier : ATR multiplier got from `atr_multiplier(rsi, atr_max_multiplier)`
  Returns: Dynamic offset
 rsi_emotional(rsi, bottom, top) 
  Tells you if RSI is in emotional zone.
  Parameters:
     rsi : Relative Strength Index
     bottom : The zone that below it market reacts emotionally
     top : The zone that above it market reacts emotionally
  Returns: false if RSI was between `bottom` and `top` otherwise true
 rsi_signal(rsi, bottom, top) 
  Tells you if RSI is in good point to check your other strategy conditions.
  Parameters:
     rsi : Relative Strength Index
     bottom : The zone that below it market reacts emotionally
     top : The zone that above it market reacts emotionally
  Returns: 1 if RSI crossed out 30, 50 or 70. -1 if RSI crossed under 70, 50, 30. otherwise is 0
MLExtensionsLibrary   "MLExtensions" 
 normalizeDeriv(src, quadraticMeanLength) 
  Returns the smoothed hyperbolic tangent of the input series.
  Parameters:
     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.
 normalize(src, min, max) 
  Rescales a source value with an unbounded range to a target range.
  Parameters:
     src :  The input series
     min :  The minimum value of the unbounded range
     max :  The maximum value of the unbounded range
  Returns:  The normalized series
 rescale(src, oldMin, oldMax, newMin, newMax) 
  Rescales a source value with a bounded range to anther bounded range
  Parameters:
     src :  The input series
     oldMin :  The minimum value of the range to rescale from
     oldMax :  The maximum value of the range to rescale from
     newMin :  The minimum value of the range to rescale to
     newMax :  The maximum value of the range to rescale to 
  Returns:  The rescaled series
 color_green(prediction) 
  Assigns varying shades of the color green based on the KNN classification
  Parameters:
     prediction : Value (int|float) of the prediction 
  Returns: color 
 color_red(prediction) 
  Assigns varying shades of the color red based on the KNN classification
  Parameters:
     prediction : Value of the prediction
  Returns: color
 tanh(src) 
  Returns the the hyperbolic tangent of the input series. The sigmoid-like hyperbolic tangent function is used to compress the input to a value between -1 and 1.
  Parameters:
     src :  The input series (i.e., the normalized derivative).
  Returns: tanh  The hyperbolic tangent of the input series.
 dualPoleFilter(src, lookback) 
  Returns the smoothed hyperbolic tangent of the input series.
  Parameters:
     src :  The input series (i.e., the hyperbolic tangent).
     lookback :  The lookback window for the smoothing.
  Returns: filter  The smoothed hyperbolic tangent of the input series.
 tanhTransform(src, smoothingFrequency, quadraticMeanLength) 
  Returns the tanh transform of the input series.
  Parameters:
     src :  The input series (i.e., the result of the tanh calculation).
     smoothingFrequency 
     quadraticMeanLength 
  Returns: signal  The smoothed hyperbolic tangent transform of the input series.
 n_rsi(src, n1, n2) 
  Returns the normalized RSI ideal for use in ML algorithms.
  Parameters:
     src :  The input series (i.e., the result of the RSI calculation).
     n1 :  The length of the RSI.
     n2 :  The smoothing length of the RSI.
  Returns: signal  The normalized RSI.
 n_cci(src, n1, n2) 
  Returns the normalized CCI ideal for use in ML algorithms.
  Parameters:
     src :  The input series (i.e., the result of the CCI calculation).
     n1 :  The length of the CCI.
     n2 :  The smoothing length of the CCI.
  Returns: signal  The normalized CCI.
 n_wt(src, n1, n2) 
  Returns the normalized WaveTrend Classic series ideal for use in ML algorithms.
  Parameters:
     src :  The input series (i.e., the result of the WaveTrend Classic calculation).
     n1 
     n2 
  Returns: signal  The normalized WaveTrend Classic series.
 n_adx(highSrc, lowSrc, closeSrc, n1) 
  Returns the normalized ADX ideal for use in ML algorithms.
  Parameters:
     highSrc :  The input series for the high price.
     lowSrc :  The input series for the low price.
     closeSrc :  The input series for the close price.
     n1 :  The length of the ADX.
 regime_filter(src, threshold, useRegimeFilter) 
  Parameters:
     src 
     threshold 
     useRegimeFilter 
 filter_adx(src, length, adxThreshold, useAdxFilter) 
  filter_adx
  Parameters:
     src :  The source series.
     length :  The length of the ADX.
     adxThreshold :  The ADX threshold.
     useAdxFilter :  Whether to use the ADX filter.
  Returns:  The ADX.
 filter_volatility(minLength, maxLength, useVolatilityFilter) 
  filter_volatility
  Parameters:
     minLength :  The minimum length of the ATR.
     maxLength :  The maximum length of the ATR.
     useVolatilityFilter :  Whether to use the volatility filter.
  Returns:  Boolean indicating whether or not to let the signal pass through the filter.
 backtest(high, low, open, startLongTrade, endLongTrade, startShortTrade, endShortTrade, isStopLossHit, maxBarsBackIndex, thisBarIndex) 
  Performs a basic backtest using the specified parameters and conditions.
  Parameters:
     high :  The input series for the high price.
     low :  The input series for the low price.
     open :  The input series for the open price.
     startLongTrade :  The series of conditions that indicate the start of a long trade.`
     endLongTrade :  The series of conditions that indicate the end of a long trade.
     startShortTrade :  The series of conditions that indicate the start of a short trade.
     endShortTrade :  The series of conditions that indicate the end of a short trade.
     isStopLossHit :  The stop loss hit indicator.
     maxBarsBackIndex :  The maximum number of bars to go back in the backtest.
     thisBarIndex :  The current bar index.
  Returns:  A tuple containing backtest values
 init_table() 
  init_table()
  Returns: tbl  The backtest results.
 update_table(tbl, tradeStatsHeader, totalTrades, totalWins, totalLosses, winLossRatio, winrate, stopLosses) 
  update_table(tbl, tradeStats)
  Parameters:
     tbl :  The backtest results table.
     tradeStatsHeader :  The trade stats header.
     totalTrades :  The total number of trades.
     totalWins :  The total number of wins.
     totalLosses :  The total number of losses.
     winLossRatio :  The win loss ratio.
     winrate :  The winrate.
     stopLosses :  The total number of stop losses.
  Returns:  Updated backtest results table.
BasicVisibleChartBasic library for the visible range chart; with functions to allow plotting Fibs from body high/low as well as wick high/low
-Thanks to code from @PineCoders Visible Chart library (PineCoders/VisibleChart/4), which is a much more comprehensive library than this, but which does not include some functions that I find useful:
-Added the following exportable functions: highest/lowest body, highest/lowest close, highest/lowest open. These allow one to anchor fibs from bodies rather than wicks
-Added a Fib Box function in the example code
The above chart shows the example code plotting a Fib range drawn from bodies and a highlighted retracement zone  (61.8 % - 78.6% )
~~All Exportable Functions~~
 barIsVisible() 
 highestClose() 
 highestOpen() 
 highestBody() 
 lowestClose() 
 lowestOpen() 
 lowestBody() 
 high() 
 highBarTime() 
 low() 
 lowBarTime() 
 open() 
 close() 






















