OrderBlocksLibrary   "OrderBlocks" 
This is a library I created that creates order blocks. It's originated from my indicator "Order blocks" (). It will return a Zone object that can be used to draw an order block. If you want to see how that is done you can check out my indicar that uses the same logic.
 Create(settings) 
  Creates an order block if one is found according to the settings parameter.
  Parameters:
     settings (Settings) : set all values in this parameter to define the settings for the order block creation.
  Returns: a Zone object if an order block is found, na otherwise
 Zone 
  Fields:
     Time (series int) 
     TimeClose (series int) 
     High (series float) 
     Low (series float) 
     ReactionLimit (series float) 
     TouchedZone (Zone type from mickes/Touched/14) 
     Type (series int) 
 Zones 
  Fields:
     Index (series int) 
     Maximum (series int) 
     Zones (array) 
     Remove (Zone) 
 Settings 
  Fields:
     TakeOut (series bool) 
     ReactionFactor (series float) 
     Type (series string) 
     ConsecutiveRisingOrFalling (series bool) 
     FairValueGap (series bool)
Indicators and strategies
OutofOptionsHelperLibraryLibrary   "OutofOptionsHelperLibrary" 
Helper library for my indicators/strategies
 isUp(i) 
  is Up candle
  Parameters:
     i (int) 
  Returns: bool
 isDown(i) 
  is Down candle
  Parameters:
     i (int) 
  Returns: bool
 TF(t) 
  format time into date/time string
  Parameters:
     t (int) 
  Returns: string
 S(s) 
  format data to string
  Parameters:
     s (float) 
  Returns: string
 S(s) 
  format data to string
  Parameters:
     s (int) 
  Returns: string
 S(s) 
  format data to string
  Parameters:
     s (bool) 
  Returns: string
 barClose(price, up, strict) 
  Determine if candle closed above/below price
  Parameters:
     price (float) 
     up (bool) 
     strict (bool) : bool if close over is required or if close at the price is good enough
  Returns: bool
 processSweep(L, price, up, leftB) 
  Determine how many liquidity sweeps were made
  Parameters:
     L (array) 
     price (float) 
     up (bool) 
     leftB (int) 
  Returns: int
 liquidity 
  Fields:
     price (series float) 
     time (series int) 
     oprice (series float) 
     otime (series int) 
     sweeps (series int) 
     bars_swept (series int)
MonthlyReturnsTableLibrary   "MonthlyReturnsTable" 
 showMonthlyReturns(show) 
  显示月度和年度收益率表格
  Parameters:
     show (bool) : (bool) 是否显示表格
  Returns:   返回一个数组,包含是否显示表格的状态和当前月度收益率
TimeLibraryLibrary   "TimeLibrary" 
TODO: add library description here
 Line_Type_Control(Type) 
  Line_Type_Control: This function changes between common line types options available are "Solid","Dashed","Dotted"
  Parameters:
     Type (string) : : The string to choose the line type from
  Returns: Line_Type         : returns the pine script equivalent of the string input
 Text_Size_Switch(Text_Size) 
  Text_Size_Switch : This function changes between common text sizes options are "Normal", "Tiny", "Small", "Large", "Huge", "Auto"
  Parameters:
     Text_Size (string) : : The string to choose the text type from
  Returns: Text_Type         : returns the pine script equivalent of the string input
 TF(TF_Period, TF_Multip) 
  TF  generates a string representation of a time frame based on the provided time frame unit (`TF_Period`) and multiplier (`TF_Multip`).
  Parameters:
     TF_Period (simple string) 
     TF_Multip (simple int) 
  Returns: A string that represents the time frame in Pine Script format, depending on the `TF_Period`:
- For "Minute", it returns the multiplier as a string (e.g., "5" for 5 minutes).
- For "Hour", it returns the equivalent number of minutes (e.g., "120" for 2 hours).
- For "Day", it appends "D" to the multiplier (e.g., "2D" for 2 days).
- For "Week", it appends "W" to the multiplier (e.g., "1W" for 1 week).
- For "Month", it appends "M" to the multiplier (e.g., "3M" for 3 months).
If none of these cases match, it returns the current chart's time frame.
 TF_Display(Chart_as_Timeframe, TF_Period, TF_Multip) 
  TF_Display  generates a string representation of a time frame based on user-defined inputs or the current chart's time frame settings.
  Parameters:
     Chart_as_Timeframe (bool) : (bool): Determines whether to use the current chart's time frame or a custom time frame.
TF_Period` (string): The time frame unit (e.g., "Minute", "Hour", "Day", "Week", "Month").
TF_Multip` (int): The multiplier for the time frame (e.g., 15 for 15 minutes, 2 for 2 days).
     TF_Period (string) 
     TF_Multip (int) 
  Returns: If `Chart_as_Timeframe` is `false`, the function returns a time frame string based on the provided `TF_Period` and `TF_Multip` values (e.g., "5Min", "2D").
If `Chart_as_Timeframe` is `true`, the function determines the current chart's time frame and returns it as a string:
For minute-based time frames, it returns the number of minutes with "Min" (e.g., "15Min") unless it's an exact hour, in which case it returns the hour (e.g., "1H").
For daily, weekly, and monthly time frames, it returns the multiplier with the appropriate unit (e.g., "1D" for daily, "1W" for weekly, "1M" for monthly).
 MTF_MS_Display(Chart_as_Timeframe, TF_Period, TF_Multip, Swing_Length) 
  MTF_MS_Display  This function calculates and returns a modified swing length value based on the selected time frame and current chart's time frame.
  Parameters:
     Chart_as_Timeframe (bool) 
     TF_Period (string) 
     TF_Multip (int) 
     Swing_Length (int) 
 HTF_Structure_Control(Chart_as_Timeframe, Show_Only_On_Lower_Timeframes, TF_Period, TF_Multip) 
  Parameters:
     Chart_as_Timeframe (bool) 
     Show_Only_On_Lower_Timeframes (bool) 
     TF_Period (string) 
     TF_Multip (int)
GaussianDistributionLibrary   "GaussianDistribution" 
This library defines a custom type `distr` representing a Gaussian (or other statistical) distribution.
It provides methods to calculate key statistical moments and scores, including mean, median, mode, standard deviation, variance, skewness, kurtosis, and Z-scores.
This library is useful for analyzing probability distributions in financial data.
Disclaimer:
I am not a mathematician, but I have implemented this library to the best of my understanding and capacity. Please be indulgent as I tried to translate statistical concepts into code as accurately as possible. Feedback, suggestions, and corrections are welcome to improve the reliability and robustness of this library.
 mean(source, length) 
  Calculate the mean (average) of the distribution
  Parameters:
     source (float) : Distribution source (typically a price or indicator series)
     length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
  Returns: Mean (μ)
 stdev(source, length) 
  Calculate the standard deviation (σ) of the distribution
  Parameters:
     source (float) : Distribution source (typically a price or indicator series)
     length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
  Returns: Standard deviation (σ)
 skewness(source, length, mean, stdev) 
  Calculate the skewness (γ₁) of the distribution
  Parameters:
     source (float) : Distribution source (typically a price or indicator series)
     length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
     mean (float) : the mean (average) of the distribution
     stdev (float) : the standard deviation (σ) of the distribution
@return Skewness (γ₁)
 skewness(source, length) 
  Overloaded skewness to calculate from source and length
  Parameters:
     source (float) : Distribution source (typically a price or indicator series)
     length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
@return Skewness (γ₁)
 mode(mean, stdev, skewness) 
  Estimate mode - Most frequent value in the distribution (approximation based on skewness)
  Parameters:
     mean (float) : the mean (average) of the distribution
     stdev (float) : the standard deviation (σ) of the distribution
     skewness (float) : the skewness (γ₁) of the distribution
@return Mode
 mode(source, length) 
  Overloaded mode to calculate from source and length
  Parameters:
     source (float) : Distribution source (typically a price or indicator series)
     length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
@return Mode
 median(mean, stdev, skewness) 
  Estimate median - Middle value of the distribution (approximation)
  Parameters:
     mean (float) : the mean (average) of the distribution
     stdev (float) : the standard deviation (σ) of the distribution
     skewness (float) : the skewness (γ₁) of the distribution
@return Median
 median(source, length) 
  Overloaded median to calculate from source and length
  Parameters:
     source (float) : Distribution source (typically a price or indicator series)
     length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
@return Median
 variance(stdev) 
  Calculate variance (σ²) - Square of the standard deviation
  Parameters:
     stdev (float) : the standard deviation (σ) of the distribution
@return Variance (σ²)
 variance(source, length) 
  Overloaded variance to calculate from source and length
  Parameters:
     source (float) : Distribution source (typically a price or indicator series)
     length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
@return Variance (σ²)
 kurtosis(source, length, mean, stdev) 
  Calculate kurtosis (γ₂) - Degree of "tailedness" in the distribution
  Parameters:
     source (float) : Distribution source (typically a price or indicator series)
     length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
     mean (float) : the mean (average) of the distribution
     stdev (float) : the standard deviation (σ) of the distribution
@return Kurtosis (γ₂)
 kurtosis(source, length) 
  Overloaded kurtosis to calculate from source and length
  Parameters:
     source (float) : Distribution source (typically a price or indicator series)
     length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
@return Kurtosis (γ₂)
 normal_score(source, mean, stdev) 
  Calculate Z-score (standard score) assuming a normal distribution
  Parameters:
     source (float) : Distribution source (typically a price or indicator series)
     mean (float) : the mean (average) of the distribution
     stdev (float) : the standard deviation (σ) of the distribution
@return Z-Score
 normal_score(source, length) 
  Overloaded normal_score to calculate from source and length
  Parameters:
     source (float) : Distribution source (typically a price or indicator series)
     length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
@return Z-Score
 non_normal_score(source, mean, stdev, skewness, kurtosis) 
  Calculate adjusted Z-score considering skewness and kurtosis
  Parameters:
     source (float) : Distribution source (typically a price or indicator series)
     mean (float) : the mean (average) of the distribution
     stdev (float) : the standard deviation (σ) of the distribution
     skewness (float) : the skewness (γ₁) of the distribution
     kurtosis (float) : the "tailedness" in the distribution
@return Z-Score
 non_normal_score(source, length) 
  Overloaded non_normal_score to calculate from source and length
  Parameters:
     source (float) : Distribution source (typically a price or indicator series)
     length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
@return Z-Score
 method init(this) 
  Initialize all statistical fields of the `distr` type
  Namespace types: distr
  Parameters:
     this (distr) 
 method init(this, source, length) 
  Overloaded initializer to set source and length
  Namespace types: distr
  Parameters:
     this (distr) 
     source (float) 
     length (int) 
 distr 
  Custom type to represent a Gaussian distribution
  Fields:
     source (series float) : Distribution source (typically a price or indicator series)
     length (series int) : Window length for the distribution (must be >= 30 for meaningful statistics)
     mode (series float) : Most frequent value in the distribution
     median (series float) : Middle value separating the greater and lesser halves of the distribution
     mean (series float) : μ (1st central moment) - Average of the distribution
     stdev (series float) : σ or standard deviation (square root of the variance) - Measure of dispersion
     variance (series float) : σ² (2nd central moment) - Squared standard deviation
     skewness (series float) : γ₁ (3rd central moment) - Asymmetry of the distribution
     kurtosis (series float) : γ₂ (4th central moment) - Degree of "tailedness" relative to a normal distribution
     normal_score (series float) : Z-score assuming normal distribution
     non_normal_score (series float) : Adjusted Z-score considering skewness and kurtosis
MathHelpersLibrary   "MathHelpers" 
 Overview 
A collection of helper functions for designing indicators and strategies. 
 calculateATR(length, log) 
  Calculates the Average True Range (ATR) or Log ATR based on the 'log' parameter. Sans Wilder's Smoothing
  Parameters:
     length (simple int) 
     log (simple bool) 
  Returns: float The calculated ATR value. Returns Log ATR if `log` is true, otherwise returns standard ATR.
 CDF(z) 
  Computes the Cumulative Distribution Function (CDF) for a given value 'z', mimicking the CDF function in "Statistically Sound Indicators" by Timothy Masters.
  Parameters:
     z (simple float) 
  Returns: float The CDF value corresponding to the input `z`, ranging between 0 and 1.
 logReturns(lookback) 
  Calculates the logarithmic returns over a specified lookback period.
  Parameters:
     lookback (simple int) 
  Returns: float The calculated logarithmic return. Returns `na` if insufficient data is available.
ToolsMapLibrary   "ToolsMap" 
Helper functions for map type operations
 map_def(container, key, default) 
  Returns Map key's value with default return value option
  Parameters:
     container (map) : Map object
     key (string) : Key to be checked
     default (bool) : Default return value when key not found. Default: false
  Returns: bool
 map_def(container, key, default) 
  Returns Map key's value with default return value option
  Parameters:
     container (map) : Map object
     key (string) : Key to be checked
     default (int) : Default return value when key not found. Default: -1
  Returns: int
 map_def(container, key, default) 
  Returns Map key's value with default return value option
  Parameters:
     container (map) : Map object
     key (string) : Key to be checked
     default (float) : Default return value when key not found. Default: -1
  Returns: float
 map_def(container, key, default) 
  Returns Map key's value with default return value option
  Parameters:
     container (map) : Map object
     key (string) : Key to be checked
     default (string) : Default return value when key not found. Default: ''
  Returns: string
 map_def(container, key, default) 
  Returns Map key's value with default return value option
  Parameters:
     container (map) : Map object
     key (string) : Key to be checked
     default (color) : Default return value when key not found. Default: color.white
  Returns: color
 map_def(container, key, default) 
  Returns Map key's value with default return value option
  Parameters:
     container (map) : Map object
     key (int) : Key to be checked
     default (bool) : Default return value when key not found. Default: false
  Returns: bool
 map_def(container, key, default) 
  Returns Map key's value with default return value option
  Parameters:
     container (map) : Map object
     key (int) : Key to be checked
     default (int) : Default return value when key not found. Default: -1
  Returns: int
 map_def(container, key, default) 
  Returns Map key's value with default return value option
  Parameters:
     container (map) : Map object
     key (int) : Key to be checked
     default (float) : Default return value when key not found. Default: -1
  Returns: float
 map_def(container, key, default) 
  Returns Map key's value with default return value option
  Parameters:
     container (map) : Map object
     key (int) : Key to be checked
     default (string) : Default return value when key not found. Default: ''
  Returns: string
 map_def(container, key, default) 
  Returns Map key's value with default return value option
  Parameters:
     container (map) : Map object
     key (int) : Key to be checked
     default (color) : Default return value when key not found. Default: color.white
  Returns: color
RHR_CANDLELibrary   "RHR_CANDLE" 
Library for Expansion Contraction Indicator, a zero-lag dual perspective indicator based on Jake Bernstein’s principles of Moving Average Channel system.
 calc(shortLookback, longLookback) 
  Calculates Expansion Contraction values.
  Parameters:
     shortLookback (int) : Integer for the short lookback calculation, defaults to 8
     longLookback (int) : Integer for the long lookback calculation, defaults to 32
@return Returns array of Expansion Contraction values
 stdevCalc(positiveShort, negativeShort, positiveLong, negativeLong, stdevLookback) 
  Calculates standard deviation lines based on Expansion Contraction Long and Short values.
  Parameters:
     positiveShort (float) : Float for the positive short XC value from calculation
     negativeShort (float) : Float for the negative short XC value from calculation
     positiveLong (float) : Float for the positive long XC value from calculation
     negativeLong (float) : Float for the negative long XC value from calculation
     stdevLookback (int) : Integer for the standard deviation lookback, defaults to 500
@return Returns array of standard deviation values
 trend(positiveShort, negativeShort, positiveLong, negativeLong) 
  Determines if trend is strong or weak based on Expansion Contraction values.
  Parameters:
     positiveShort (float) : Float for the positive short XC value from calculation
     negativeShort (float) : Float for the negative short XC value from calculation
     positiveLong (float) : Float for the positive long XC value from calculation
     negativeLong (float) : Float for the negative long XC value from calculation
@return Returns array of boolean values indicating strength or weakness of trend
lib_momentumLibrary   "lib_momentum" 
This library calculates the momentum, derived from a sample range of prior candles. Depending on set MomentumType it either deduces the momentum from the price, volume, or a product of both. If price/product are selected, you can choose from SampleType if only candle body, full range from high to low or a combination of both (body counts full, wicks half for each direction) should be used. Optional: You can choose to normalize the results, dividing each value by its average (normalization_ma_length, normalization_ma). This will allow comparison between different instruments. For the normalization Moving Average you can choose any currently supported in my lib_no_delay.
 get_momentum(momentum_type, sample_type, sample_length, normalization_ma_length, normalization_ma) 
  Parameters:
     momentum_type (series MomentumType) : select one of MomentumType.  to sample the price, volume or a product of both
     sample_type (series SampleType) : select one of SampleType.  to sample the body, total range from high to low or a combination of both (body count full, wicks half for each direction)
     sample_length (simple int) : how many candles should be sampled (including the current)
     normalization_ma_length (simple int) : if you want to normalize results (momentum / momentum average) this sets the period for the average. (default = 0 => no normalization)
     normalization_ma (simple MovingAverage enum from robbatt/lib_no_delay/9) : is the type of moving average to normalize / compare with
  Returns: returns the current momentum   where the total line is not just (up - down) but also sampled over the sample_length and can therefore be used as trend indicator. If up/down fail to reach total's level it's a sign of decreasing momentum, if up/down exceed total the trend it's a sign of increasing momentum.
ToolsLibrary   "Tools" 
Common tools
 movingAverage(maType, maSource, maLength) 
  dynamically returns MA
  Parameters:
     maType (string) : ma type
     maSource (float) : ma source
     maLength (simple int) : ma length
  Returns: ta.{sma,rma,ema,wma,vwma,hma}
yptestrsilibLibrary   "RSIBackgroundLib" 
RSI 배경색 라이브러리
 rsi_background(_symbol, _timeframe) 
  RSI 계산 및 배경색 반환
  Parameters:
     _symbol (simple string) : string 심볼
     _timeframe (simple string) : string 타임프레임
  Returns:   RSI, RSI MA, RSI MA10, 배경색
RawCuts_01Library   "RawCuts_01" 
A collection of functions by:
 mutantdog 
The majority of these are used within published projects, some useful variants have been included here aswell.
This is volume one consisting mainly of smaller functions, predominantly the filters and standard deviations from Weight Gain 4000.
Also included at the bottom are various snippets of related code for demonstration. These can be copied and adjusted according to your needs.
 A full up-to-date table of contents is located at the top of the main script.
 
 WEIGHT GAIN FILTERS
 
A collection of moving average type filters with adjustable volume weighting.
Based upon the two most common methods of volume weighting.
'Simple' uses the standard method in which a basic VWMA is analogous to SMA.
'Elastic' uses exponential method found in EVWMA which is analogous to RMA.
Volume weighting is applied according to an exponent multiplier of input volume.
0 >> volume^0 (unweighted), 1 >> volume^1 (fully weighted), use float values for intermediate weighting.
Additional volume filter switch for smoothing of outlier events.
 DIVA MODULAR DEVIATIONS
 
A small collection of standard and absolute deviations.
Includes the weightgain functionality as above.
Basic modular functionality for more creative uses.
Optional input (ct) for external central tendency (aka: estimator).
Can be assigned to alternative filter or any float value. Will default to internal filter when no ct input is received.
Some other useful or related functions included at the bottom along with basic demonstration use.
 weightgain_sma(src, len, xVol, fVol) 
  Simple Moving Average (SMA):                Weight Gain (Simple Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
  Returns: Standard Simple Moving Average with Simple Weight Gain applied.
 weightgain_hsma(src, len, xVol, fVol) 
  Harmonic Simple Moving Average (hSMA):      Weight Gain (Simple Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
  Returns: Harmonic Simple Moving Average with Simple Weight Gain applied.
 weightgain_gsma(src, len, xVol, fVol) 
  Geometric Simple Moving Average (gSMA):      Weight Gain (Simple Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
  Returns: Geometric Simple Moving Average with Simple Weight Gain applied.
 weightgain_wma(src, len, xVol, fVol) 
  Linear Weighted Moving Average (WMA):       Weight Gain (Simple Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
  Returns: Basic Linear Weighted Moving Average with Simple Weight Gain applied.
 weightgain_hma(src, len, xVol, fVol) 
  Hull Moving Average (HMA):                  Weight Gain (Simple Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
  Returns: Basic Hull Moving Average with Simple Weight Gain applied.
 diva_sd_sma(src, len, xVol, fVol, ct) 
  Standard Deviation (SD SMA):        		Diva / Weight Gain (Simple Volume)
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
     ct (float) : Central tendency (optional, na = bypass).   Internal: weightgain_sma().
  Returns:  
 diva_sd_wma(src, len, xVol, fVol, ct) 
  Standard Deviation (SD WMA):        		Diva / Weight Gain (Simple Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
     ct (float) : Central tendency (optional, na = bypass).   Internal: weightgain_wma().
  Returns:  
 diva_aad_sma(src, len, xVol, fVol, ct) 
  Average Absolute Deviation (AAD SMA): 		Diva / Weight Gain (Simple Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
     ct (float) : Central tendency (optional, na = bypass).   Internal: weightgain_sma().
  Returns:  
 diva_aad_wma(src, len, xVol, fVol, ct) 
  Average Absolute Deviation (AAD WMA):  		Diva / Weight Gain (Simple Volume) .
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
     ct (float) : Central tendency (optional, na = bypass).   Internal: weightgain_wma().
  Returns:  
 weightgain_ema(src, len, xVol, fVol) 
  Exponential Moving Average (EMA):           Weight Gain (Elastic Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
  Returns: Exponential Moving Average with Elastic Weight Gain applied.
 weightgain_dema(src, len, xVol, fVol) 
  Double Exponential Moving Average (DEMA):   Weight Gain (Elastic Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
  Returns: Double Exponential Moving Average with Elastic Weight Gain applied.
 weightgain_tema(src, len, xVol, fVol) 
  Triple Exponential Moving Average (TEMA):   Weight Gain (Elastic Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
  Returns: Triple Exponential Moving Average with Elastic Weight Gain applied.
 weightgain_rma(src, len, xVol, fVol) 
  Rolling Moving Average (RMA):               Weight Gain (Elastic Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
  Returns: Rolling Moving Average with Elastic Weight Gain applied.
 weightgain_drma(src, len, xVol, fVol) 
  Double Rolling Moving Average (DRMA):       Weight Gain (Elastic Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
  Returns: Double Rolling Moving Average with Elastic Weight Gain applied.
 weightgain_trma(src, len, xVol, fVol) 
  Triple Rolling Moving Average (TRMA):       Weight Gain (Elastic Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
  Returns: Triple Rolling Moving Average with Elastic Weight Gain applied.
 diva_sd_ema(src, len, xVol, fVol, ct) 
  Standard Deviation (SD EMA):           		Diva / Weight Gain: (Elastic Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
     ct (float) : Central tendency (optional, na = bypass).   Internal: weightgain_ema().
  Returns:  
 diva_sd_rma(src, len, xVol, fVol, ct) 
  Standard Deviation (SD RMA):           		Diva / Weight Gain: (Elastic Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
     ct (float) : Central tendency (optional, na = bypass).   Internal: weightgain_rma().
  Returns:  
 weightgain_vidya_rma(src, len, xVol, fVol) 
  VIDYA v1 RMA base (VIDYA-RMA):           	Weight Gain (Elastic Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
  Returns: VIDYA v1, RMA base with Elastic Weight Gain applied.
 weightgain_vidya_ema(src, len, xVol, fVol) 
  VIDYA v1 EMA base (VIDYA-EMA):           	Weight Gain (Elastic Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
  Returns: VIDYA v1, EMA base with Elastic Weight Gain applied.
 diva_sd_vidya_rma(src, len, xVol, fVol, ct) 
  Standard Deviation (SD VIDYA-RMA):          Diva / Weight Gain: (Elastic Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
     ct (float) : Central tendency (optional, na = bypass).   Internal: weightgain_vidya_rma().
  Returns:  
 diva_sd_vidya_ema(src, len, xVol, fVol, ct) 
  Standard Deviation (SD VIDYA-EMA):          Diva / Weight Gain: (Elastic Volume).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     xVol (float) : Volume exponent multiplier 					(0 = unweighted, 1 = fully weighted).
     fVol (bool) : Volume smoothing filter.
     ct (float) : Central tendency (optional, na = bypass).   Internal: weightgain_vidya_ema().
  Returns:  
 weightgain_sema(src, len, xVol, fVol) 
  Parameters:
     src (float) 
     len (simple int) 
     xVol (float) 
     fVol (bool) 
 diva_sd_sema(src, len, xVol, fVol) 
  Parameters:
     src (float) 
     len (simple int) 
     xVol (float) 
     fVol (bool) 
 diva_mad_mm(src, len, ct) 
  Median Absolute Deviation (MAD MM):         Diva (no volume weighting).
  Parameters:
     src (float) : Source input.
     len (int) : Length (number of bars).
     ct (float) : Central tendency (optional, na = bypass).   Internal: ta.median()
  Returns:  
 source_switch(slct, aux1, aux2, aux3, aux4) 
  Custom Source Selector/Switch function. Features standard & custom 'weighted' sources with additional aux inputs.
  Parameters:
     slct (string) : Choose from custom set of string values.
     aux1 (float) : Additional input for user-defined source, eg: standard input.source(). Optional, use na to bypass.
     aux2 (float) : Additional input for user-defined source, eg: standard input.source(). Optional, use na to bypass.
     aux3 (float) : Additional input for user-defined source, eg: standard input.source(). Optional, use na to bypass.
     aux4 (float) : Additional input for user-defined source, eg: standard input.source(). Optional, use na to bypass.
  Returns: Float value, to be used as src input for other functions.
 colour_gradient_ma_div(ma1, ma2, div, bull, bear, mid, mult) 
  Colour Gradient for plot fill between two moving averages etc, with seperate bull/bear and divergence strength.
  Parameters:
     ma1 (float) : Input for fast moving average 	(eg: bullish when above ma2).
     ma2 (float) : Input for slow moving average 	(eg: bullish when below ma1).
     div (float) : Input deviation/divergence value used to calculate strength of colour.
     bull (color) : Colour when ma1 above ma2.
     bear (color) : Colour when ma1 below ma2.
     mid (color) : Neutral colour when ma1 = ma2.
     mult (int) : Opacity multiplier. 			100 = maximum, 0 = transparent.
  Returns: Colour with transparency (according to specified inputs)
CandlestickPatternsLibrary   "CandlestickPatterns" 
 zigzag(_low, _high, depth, deviation, backstep) 
  Parameters:
     _low (float) 
     _high (float) 
     depth (int) 
     deviation (int) 
     backstep (int) 
 getTrend(trendType, currentClose, zz_downtrend, zz_uptrend, ema14, ema28) 
  Parameters:
     trendType (string) 
     currentClose (float) 
     zz_downtrend (bool) 
     zz_uptrend (bool) 
     ema14 (float) 
     ema28 (float) 
 isInside(currentHigh, currentLow, currentClose, currentOpen, prevHigh, prevLow) 
  Parameters:
     currentHigh (float) 
     currentLow (float) 
     currentClose (float) 
     currentOpen (float) 
     prevHigh (float) 
     prevLow (float) 
 checkMorningStar(open0, high0, low0, close0, open1, high1, low1, close1, open2, high2, low2, close2, innerCandleThreshold, closingMinThreshold, closingMaxThreshold, useDojiFilter, dojiSize, downTrend) 
  Parameters:
     open0 (float) 
     high0 (float) 
     low0 (float) 
     close0 (float) 
     open1 (float) 
     high1 (float) 
     low1 (float) 
     close1 (float) 
     open2 (float) 
     high2 (float) 
     low2 (float) 
     close2 (float) 
     innerCandleThreshold (float) 
     closingMinThreshold (float) 
     closingMaxThreshold (float) 
     useDojiFilter (bool) 
     dojiSize (float) 
     downTrend (bool) 
 checkEveningStar(open0, high0, low0, close0, open1, high1, low1, close1, open2, high2, low2, close2, innerCandleThreshold, closingMinThreshold, closingMaxThreshold, useDojiFilter, dojiSize, upTrend) 
  Parameters:
     open0 (float) 
     high0 (float) 
     low0 (float) 
     close0 (float) 
     open1 (float) 
     high1 (float) 
     low1 (float) 
     close1 (float) 
     open2 (float) 
     high2 (float) 
     low2 (float) 
     close2 (float) 
     innerCandleThreshold (float) 
     closingMinThreshold (float) 
     closingMaxThreshold (float) 
     useDojiFilter (bool) 
     dojiSize (float) 
     upTrend (bool) 
 checkHammerPattern(open, high, low, close, bodyAvg, shadowFactor, downTrend) 
  Parameters:
     open (float) 
     high (float) 
     low (float) 
     close (float) 
     bodyAvg (float) 
     shadowFactor (float) 
     downTrend (bool) 
 checkInvertedHammerPattern(open, high, low, close, bodyAvg, shadowFactor, downTrend) 
  Parameters:
     open (float) 
     high (float) 
     low (float) 
     close (float) 
     bodyAvg (float) 
     shadowFactor (float) 
     downTrend (bool) 
 checkHangingManPattern(open, high, low, close, bodyAvg, shadowFactor, upTrend) 
  Parameters:
     open (float) 
     high (float) 
     low (float) 
     close (float) 
     bodyAvg (float) 
     shadowFactor (float) 
     upTrend (bool) 
 checkShootingStarPattern(open, high, low, close, bodyAvg, shadowFactor, upTrend) 
  Parameters:
     open (float) 
     high (float) 
     low (float) 
     close (float) 
     bodyAvg (float) 
     shadowFactor (float) 
     upTrend (bool) 
 checkLevels(high0, high1, high2, low0, low1, low2, lookbackPeriod) 
  Parameters:
     high0 (float) 
     high1 (float) 
     high2 (float) 
     low0 (float) 
     low1 (float) 
     low2 (float) 
     lookbackPeriod (int)
CustomAlertLibLibrary   "CustomAlertLib" 
Custom alert formatting library
 customAlert(format, message, freq) 
  Formats and triggers custom alerts with placeholders
  Parameters:
     format (string) : String containing the alert format template
     message (string) : String containing the alert message
     freq (simple string) : (optional) Alert frequency as string, defaults to "once_per_bar_close"
  Returns: void
DRKMetricsLibrary   "DRKMetrics" 
TODO: add library description here
 curve(disp_ind) 
  Call function to get a certain curve of your strategy.
  Parameters:
     disp_ind (string) 
  Returns: Returns type of curve plot.
 cleaner(disp_ind, plot) 
  Call function to filter out your Strategy plots
  Parameters:
     disp_ind (string) 
     plot (float) 
 cobraTable(option, position) 
  Assign this function to a random variable to get the "Performance Table"
  Parameters:
     option (simple string) 
     position (simple string)
PineConnectorLibrary   "PineConnector" 
This library is a comprehensive alert webhook text generator for PineConnector. It contains every possible alert syntax variation from the documentation, along with some debugging functions.
To use it, just import the library (eg. "import ZenAndTheArtOfTrading/PineConnector/1 as pc") and use pc.buy(licenseID) to send an alert off to PineConnector - assuming all your webhooks etc are set up correctly.
View the PineConnector documentation for more information on how to send the commands you're looking to send (all of this library's function names match the documentation).
 all() 
  Usage: pc.buy(pc_id, freq=pc.all())
  Returns: "all"
 once_per_bar() 
  Usage: pc.buy(pc_id, freq=pc.once_per_bar())
  Returns: "once_per_bar"
 once_per_bar_close() 
  Usage: pc.buy(pc_id, freq=pc.once_per_bar_close())
  Returns: "once_per_bar_close"
 na0(value) 
  Checks if given value is either 'na' or 0. Useful for streamlining scripts with float user setting inputs which default values to 0 since na is unavailable as a user input default.
  Parameters:
     value (float) : The value to check
  Returns: True if the given value is 0 or na
 getDecimals() 
  Calculates how many decimals are on the quote price of the current market.
  Returns: The current decimal places on the market quote price
 truncate(number, decimals) 
  Truncates the given number. Required params: mumber.
  Parameters:
     number (float) : Number to truncate
     decimals (int) : Decimal places to cut down to
  Returns: The input number, but as a string truncated to X decimals
 getPipSize(multiplier) 
  Calculates the pip size of the current market.
  Parameters:
     multiplier (int) : The mintick point multiplier (1 by default, 10 for FX/Crypto/CFD but can be used to override when certain markets require)
  Returns: The pip size for the current market
 toWhole(number) 
  Converts pips into whole numbers. Required params: number.
  Parameters:
     number (float) : The pip number to convert into a whole number
  Returns: The converted number
 toPips(number) 
  Converts whole numbers back into pips. Required params: number.
  Parameters:
     number (float) : The whole number to convert into pips
  Returns: The converted number
 debug(txt, tooltip, displayLabel) 
  Prints to console and generates a debug label with the given text. Required params: txt.
  Parameters:
     txt (string) : Text to display
     tooltip (string) : Tooltip to display (optional)
     displayLabel (bool) : Turns on/off chart label (default: off)
  Returns: Nothing
 order(licenseID, command, symbol, parameters, accfilter, comment, secret, freq, debug) 
  Generates an alert string. Required params: licenseID, command.
  Parameters:
     licenseID (string) : Your PC license ID
     command (string) : Command to send
     symbol (string) : The symbol to trigger this order on
     parameters (string) : Other optional parameters to include
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: An alert string with valid PC syntax based on supplied parameters
 market_order(licenseID, buy, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Generates a market entry alert with relevant syntax commands. Required params: licenseID, buy, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     buy (bool) : true=buy/long, false=sell/short
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A market order alert string with valid PC syntax based on supplied parameters
 buy(licenseID, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Generates a market buy alert with relevant syntax commands. Required params: licenseID, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A market order alert string with valid PC syntax based on supplied parameters
 sell(licenseID, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Generates a market sell alert with relevant syntax commands. Required params: licenseID, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A market order alert string with valid PC syntax based on supplied parameters
 closeall(licenseID, comment, secret, freq, debug) 
  Closes all open trades at market regardless of symbol. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closealleaoff(licenseID, comment, secret, freq, debug) 
  Closes all open trades at market regardless of symbol, and turns the EA off. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closelong(licenseID, symbol, comment, secret, freq, debug) 
  Closes all long trades at market for the given symbol. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     symbol (string) : Symbol to act on (defaults to current symbol)
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closeshort(licenseID, symbol, comment, secret, freq, debug) 
  Closes all open short trades at market for the given symbol. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     symbol (string) : Symbol to act on (defaults to current symbol)
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closelongshort(licenseID, symbol, comment, secret, freq, debug) 
  Closes all open trades at market for the given symbol. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     symbol (string) : Symbol to act on (defaults to current symbol)
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closelongbuy(licenseID, risk, symbol, comment, secret, freq, debug) 
  Close all long positions and open a new long at market for the given symbol with given risk/contracts. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     risk (float) : Risk or contracts (according to EA settings)
     symbol (string) : Symbol to act on (defaults to current symbol)
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closeshortsell(licenseID, risk, symbol, comment, secret, freq, debug) 
  Close all short positions and open a new short at market for the given symbol with given risk/contracts. Required params: licenseID, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     risk (float) : Risk or contracts (according to EA settings)
     symbol (string) : Symbol to act on (defaults to current symbol)
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 newsltplong(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug) 
  Updates the stop loss and/or take profit of any open long trades on the given symbol with the given values. Required params: licenseID, sl and/or tp.
  Parameters:
     licenseID (string) : Your PC license ID
     sl (float) : Stop loss pips or price (according to EA settings)
     tp (float) : Take profit pips or price (according to EA settings)
     symbol (string) : Symbol to act on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 newsltpshort(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug) 
  Updates the stop loss and/or take profit of any open short trades on the given symbol with the given values. Required params: licenseID, sl and/or tp.
  Parameters:
     licenseID (string) : Your PC license ID
     sl (float) : Stop loss pips or price (according to EA settings)
     tp (float) : Take profit pips or price (according to EA settings)
     symbol (string) : Symbol to act on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closelongpct(licenseID, symbol, comment, secret, freq, debug) 
  Close a percentage of open long positions (according to EA settings). Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     symbol (string) : Symbol to act on (defaults to current symbol)
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closeshortpct(licenseID, symbol, comment, secret, freq, debug) 
  Close a percentage of open short positions (according to EA settings). Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     symbol (string) : Symbol to act on (defaults to current symbol)
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closelongvol(licenseID, risk, symbol, comment, secret, freq, debug) 
  Close all open long contracts on the current symbol until the given risk value is remaining. Required params: licenseID, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     risk (float) : The quantity to leave remaining
     symbol (string) : Symbol to act on (defaults to current symbol)
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 closeshortvol(licenseID, risk, symbol, comment, secret, freq, debug) 
  Close all open short contracts on the current symbol until the given risk value is remaining. Required params: licenseID, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     risk (float) : The quantity to leave remaining
     symbol (string) : Symbol to act on (defaults to current symbol)
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 limit_order(licenseID, buy, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Generates a limit order alert with relevant syntax commands. Required params: licenseID, buy, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     buy (bool) : true=buy/long, false=sell/short
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A limit order alert string with valid PC syntax based on supplied parameters
 buylimit(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Generates a buylimit order alert with relevant syntax commands. Required params: licenseID, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A limit order alert string with valid PC syntax based on supplied parameters
 selllimit(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Generates a selllimit order alert with relevant syntax commands. Required params: licenseID, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A limit order alert string with valid PC syntax based on supplied parameters
 stop_order(licenseID, buy, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Generates a stop order alert with relevant syntax commands. Required params: licenseID, buy, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     buy (bool) : true=buy/long, false=sell/short
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A stop order alert string with valid PC syntax based on supplied parameters
 buystop(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Generates a buystop order alert with relevant syntax commands. Required params: licenseID, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A stop order alert string with valid PC syntax based on supplied parameters
 sellstop(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Generates a sellstop order alert with relevant syntax commands. Required params: licenseID, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A stop order alert string with valid PC syntax based on supplied parameters
 cancel_neworder(licenseID, order, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Cancel + place new order template function.
  Parameters:
     licenseID (string) : Your PC license ID
     order (string) : Cancel order type
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A stop order alert string with valid PC syntax based on supplied parameters
 cancellongbuystop(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Cancels all long orders with the specified symbol and places a new buystop order. Required params: licenseID, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A stop order alert string with valid PC syntax based on supplied parameters
 cancellongbuylimit(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Cancels all long orders with the specified symbol and places a new buylimit order. Required params: licenseID, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A stop order alert string with valid PC syntax based on supplied parameters
 cancelshortsellstop(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Cancels all short orders with the specified symbol and places a sellstop order. Required params: licenseID, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A stop order alert string with valid PC syntax based on supplied parameters
 cancelshortselllimit(licenseID, price, risk, sl, tp, betrigger, beoffset, spread, trailtrig, traildist, trailstep, atrtimeframe, atrperiod, atrmultiplier, atrshift, atrtrigger, symbol, accfilter, comment, secret, freq, debug) 
  Cancels all short orders with the specified symbol and places a selllimit order. Required params: licenseID, price, risk.
  Parameters:
     licenseID (string) : Your PC license ID
     price (float) : Price or pips to set limit order (according to EA settings)
     risk (float) : Risk quantity (according to EA settings)
     sl (float) : Stop loss distance in pips or price
     tp (float) : Take profit distance in pips or price
     betrigger (float) : Breakeven will be activated after the position gains this number of pips
     beoffset (float) : Offset from entry price. This is the amount of pips you'd like to protect
     spread (float) : Enter the position only if the spread is equal or less than the specified value in pips
     trailtrig (float) : Trailing stop-loss will be activated after a trade gains this number of pips
     traildist (float) : Distance of the trailing stop-loss from current price
     trailstep (float) : Moves trailing stop-loss once price moves to favourable by a specified number of pips
     atrtimeframe (int) : ATR Trailing Stop timeframe, only updates once per bar close. Options: 1, 5, 15, 30, 60, 240, 1440
     atrperiod (int) : ATR averaging period
     atrmultiplier (float) : Multiple of ATR to utilise in the new SL computation, default = 1
     atrshift (int) : Relative shift of price information, 0 uses latest candle, 1 uses second last, etc. Default = 0
     atrtrigger (int) : Activate the trigger of ATR Trailing after market moves favourably by a number of pips. Default = 0 (instant)
     symbol (string) : The symbol to trigger this order on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment (maximum 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A stop order alert string with valid PC syntax based on supplied parameters
 cancellong(licenseID, symbol, accfilter, comment, secret, freq, debug) 
  Cancels all pending long orders with the specified symbol. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     symbol (string) : Symbol to act on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A cancel long alert command
 cancelshort(licenseID, symbol, accfilter, comment, secret, freq, debug) 
  Cancels all pending short orders with the specified symbol. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     symbol (string) : Symbol to act on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: A cancel short alert command
 newsltpbuystop(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug) 
  Updates the stop loss and/or take profit of any pending buy stop orders on the given symbol. Required params: licenseID, sl and/or tp.
  Parameters:
     licenseID (string) : Your PC license ID
     sl (float) : Stop loss pips or price (according to EA settings)
     tp (float) : Take profit pips or price (according to EA settings)
     symbol (string) : Symbol to act on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 newsltpbuylimit(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug) 
  Updates the stop loss and/or take profit of any pending buy limit orders on the given symbol. Required params: licenseID, sl and/or tp.
  Parameters:
     licenseID (string) : Your PC license ID
     sl (float) : Stop loss pips or price (according to EA settings)
     tp (float) : Take profit pips or price (according to EA settings)
     symbol (string) : Symbol to act on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 newsltpsellstop(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug) 
  Updates the stop loss and/or take profit of any pending sell stop orders on the given symbol. Required params: licenseID, sl and/or tp.
  Parameters:
     licenseID (string) : Your PC license ID
     sl (float) : Stop loss pips or price (according to EA settings)
     tp (float) : Take profit pips or price (according to EA settings)
     symbol (string) : Symbol to act on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 newsltpselllimit(licenseID, sl, tp, symbol, accfilter, comment, secret, freq, debug) 
  Updates the stop loss and/or take profit of any pending sell limit orders on the given symbol. Required params: licenseID, sl and/or tp.
  Parameters:
     licenseID (string) : Your PC license ID
     sl (float) : Stop loss pips or price (according to EA settings)
     tp (float) : Take profit pips or price (according to EA settings)
     symbol (string) : Symbol to act on (defaults to current symbol)
     accfilter (float) : Optional minimum account balance filter
     comment (string) : Optional comment to include (max 20 characters)
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 eaoff(licenseID, secret, freq, debug) 
  Turns the EA off. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
 eaon(licenseID, secret, freq, debug) 
  Turns the EA on. Required params: licenseID.
  Parameters:
     licenseID (string) : Your PC license ID
     secret (string) : Optional secret key (must be enabled in dashboard)
     freq (string) : Alert frequency. Default = "all", options = "once_per_bar", "once_per_bar_close" and "none"
     debug (bool) : Turns on/off debug label
  Returns: The required alert syntax as a string
UtilityLibrary   "Utility" 
A utility library for various trading tools such as signal generation, custom indicators, and multi-condition crossovers.
 multiCrossover(source1, source2, threshold1, threshold2) 
  multiCrossover
@description Detects multi-condition crossovers between two sources with threshold filters.
  Parameters:
     source1 (float) : The first data series to compare.
     source2 (float) : The second data series to compare.
     threshold1 (float) : A value that source1 must exceed to trigger the crossover.
     threshold2 (float) : A value that source2 must exceed to trigger the crossunder.
  Returns: A tuple: (crossUp, crossDown) where crossUp is a boolean for upward crossover, and crossDown is for downward crossover.
 macdCustom(source, fastLength, slowLength, signalLength, macdThresh) 
  macdCustom
@description Calculates custom MACD signals based on thresholds.
  Parameters:
     source (float) : The price data or input series.
     fastLength (simple int) : The length of the fast EMA.
     slowLength (simple int) : The length of the slow EMA.
     signalLength (simple int) : The signal line length.
     macdThresh (float) : A threshold for the MACD line to confirm buy/sell signals.
  Returns: A tuple: (macdBuySignal, macdSellSignal) where macdBuySignal is true when MACD crosses above, and macdSellSignal is true when MACD crosses below the signal line.
 combinedMacdRsi(source, fastLength, slowLength, signalLength, rsiLength, macdThresh, rsiThresh) 
  combinedMacdRsi
@description Generates combined signals from MACD and RSI indicators.
  Parameters:
     source (float) : The price data or input series.
     fastLength (simple int) : The length of the fast EMA for MACD.
     slowLength (simple int) : The length of the slow EMA for MACD.
     signalLength (simple int) : The signal line length for MACD.
     rsiLength (simple int) : The length of the RSI calculation.
     macdThresh (float) : The threshold for MACD signals.
     rsiThresh (float) : The threshold for RSI signals.
  Returns: A tuple: (buySignal, sellSignal) where buySignal is generated when MACD is positive and RSI is below the threshold, and sellSignal when MACD is negative and RSI is above the threshold.
 movingAverageCrossover(source, shortLength, longLength) 
  movingAverageCrossover
@description Detects crossovers between short-term and long-term moving averages.
  Parameters:
     source (float) : The price data or input series.
     shortLength (int) : The length of the short-term moving average.
     longLength (int) : The length of the long-term moving average.
  Returns: A tuple: (crossUp, crossDown) where crossUp is true when the short-term MA crosses above the long-term MA, and crossDown when the reverse occurs.
Trading IQ - ICT LibraryLibrary   "ICTlibrary" 
Used to calculate various ICT related price levels and strategies. An ongoing project.
Hello Coders!
This library is meant for sourcing ICT related concepts. While some functions might generate more output than you require, you can specify "Lite Mode" as "true" in applicable functions to slim down necessary inputs.
 isLastBar(userTF) 
  Identifies the last bar on the chart before a timeframe change
  Parameters:
     userTF (simple int) : the timeframe you wish to calculate the last bar for, must be converted to integer using 'timeframe.in_seconds()'
  Returns: bool true if bar on chart is last bar of higher TF, dalse if bar on chart is not last bar of higher TF
 necessaryData(atrTF) 
  returns necessaryData UDT for historical data access
  Parameters:
     atrTF (float) : user-selected timeframe ATR value.
  Returns: logZ. log return Z score, used for calculating order blocks.
 method gradBoxes(gradientBoxes, idColor, timeStart, bottom, top, rightCoordinate) 
  creates neon like effect for box drawings
  Namespace types: array
  Parameters:
     gradientBoxes (array) : an array.new() to store the gradient boxes
     idColor (color) 
     timeStart (int) : left point of box
     bottom (float) : bottom of box price point
     top (float) : top of box price point
     rightCoordinate (int) : right point of box
  Returns: void
 checkIfTraded(tradeName) 
  checks if recent trade is of specific name
  Parameters:
     tradeName (string) 
  Returns: bool true if recent trade id matches target name, false otherwise
 checkIfClosed(tradeName) 
  checks if recent closed trade is of specific name
  Parameters:
     tradeName (string) 
  Returns: bool true if recent closed trade id matches target name, false otherwise
 IQZZ(atrMult, finalTF) 
  custom ZZ to quickly determine market direction.
  Parameters:
     atrMult (float) : an atr multiplier used to determine the required price move for a ZZ direction change
     finalTF (string) : the timeframe used for the atr calcuation
  Returns: dir market direction. Up => 1, down => -1
 method drawBos(id, startPoint, getKeyPointTime, getKeyPointPrice, col, showBOS, isUp) 
  calculates and draws Break Of Structure
  Namespace types: array
  Parameters:
     id (array) 
     startPoint (chart.point) 
     getKeyPointTime (int) : the actual time of startPoint, simplystartPoint.time
     getKeyPointPrice (float) : the actual time of startPoint, simplystartPoint.price
     col (color) : color of the BoS line / label
     showBOS (bool) : whether to show label/line. This function still calculates internally for other ICT related concepts even if not drawn.
     isUp (bool) : whether BoS happened during price increase or price decrease.
  Returns: void
 method drawMSS(id, startPoint, getKeyPointTime, getKeyPointPrice, col, showMSS, isUp, upRejections, dnRejections, highArr, lowArr, timeArr, closeArr, openArr, atrTFarr, upRejectionsPrices, dnRejectionsPrices) 
  calculates and draws Market Structure Shift. This data is also used to calculate Rejection Blocks.
  Namespace types: array
  Parameters:
     id (array) 
     startPoint (chart.point) 
     getKeyPointTime (int) : the actual time of startPoint, simplystartPoint.time
     getKeyPointPrice (float) : the actual time of startPoint, simplystartPoint.price
     col (color) : color of the MSS line / label
     showMSS (bool) : whether to show label/line. This function still calculates internally for other ICT related concepts even if not drawn.
     isUp (bool) : whether MSS happened during price increase or price decrease.
     upRejections (array) 
     dnRejections (array) 
     highArr (array) : array containing historical highs, should be taken from the UDT "necessaryData" defined above
     lowArr (array) : array containing historical lows, should be taken from the UDT "necessaryData" defined above
     timeArr (array) : array containing historical times, should be taken from the UDT "necessaryData" defined above
     closeArr (array) : array containing historical closes, should be taken from the UDT "necessaryData" defined above
     openArr (array) : array containing historical opens, should be taken from the UDT "necessaryData" defined above
     atrTFarr (array) : array containing historical atr values (of user-selected TF), should be taken from the UDT "necessaryData" defined above
     upRejectionsPrices (array) : array containing up rejections prices. Is sorted and used to determine selective looping for invalidations.
     dnRejectionsPrices (array) : array containing down rejections prices. Is sorted and used to determine selective looping for invalidations.
  Returns: void
 method getTime(id, compare, timeArr) 
  gets time of inputted price (compare) in an array of data
this is useful when the user-selected timeframe for ICT concepts is greater than the chart's timeframe
  Namespace types: array
  Parameters:
     id (array) : the array of data to search through, to find which index has the same value as "compare"
     compare (float) : the target data point to find in the array
     timeArr (array) : array of historical times
  Returns: the time that the data point in the array was recorded
 method OB(id, highArr, signArr, lowArr, timeArr, sign) 
  store bullish orderblock data
  Namespace types: array
  Parameters:
     id (array) 
     highArr (array) : array of historical highs
     signArr (array) : array of historical price direction "math.sign(close - open)"
     lowArr (array) : array of historical lows
     timeArr (array) : array of historical times
     sign (int) : orderblock direction, -1 => bullish, 1 => bearish
  Returns: void
 OTEstrat(OTEstart, future, closeArr, highArr, lowArr, timeArr, longOTEPT, longOTESL, longOTElevel, shortOTEPT, shortOTESL, shortOTElevel, structureDirection, oteLongs, atrTF, oteShorts) 
  executes the OTE strategy
  Parameters:
     OTEstart (chart.point) 
     future (int) : future time point for drawings
     closeArr (array) : array of historical closes
     highArr (array) : array of historical highs
     lowArr (array) : array of historical lows
     timeArr (array) : array of historical times
     longOTEPT (string) : user-selected long OTE profit target, please create an input.string() for this using the example below
     longOTESL (int) : user-selected long OTE stop loss, please create an input.string() for this using the example below
     longOTElevel (float) : long entry price of selected retracement ratio for OTE
     shortOTEPT (string) : user-selected short OTE profit target, please create an input.string() for this using the example below
     shortOTESL (int) : user-selected short OTE stop loss, please create an input.string() for this using the example below
     shortOTElevel (float) : short entry price of selected retracement ratio for OTE
     structureDirection (string) : current market structure direction, this should be "Up" or "Down". This is used to cancel pending orders if market structure changes
     oteLongs (bool) : input.bool() for whether OTE longs can be executed
     atrTF (float) : atr of the user-seleceted TF
     oteShorts (bool) : input.bool() for whether OTE shorts can be executed
@exampleInputs
oteLongs        = input.bool(defval = false, title = "OTE Longs", group = "Optimal Trade Entry")
longOTElevel    = input.float(defval = 0.79, title = "Long Entry Retracement Level", options =  , group = "Optimal Trade Entry")
longOTEPT       = input.string(defval = "-0.5", title = "Long TP", options =  , group = "Optimal Trade Entry")
longOTESL       = input.int(defval = 0, title = "How Many Ticks Below Swing Low For Stop Loss", group = "Optimal Trade Entry")
oteShorts       = input.bool(defval = false, title = "OTE Shorts", group = "Optimal Trade Entry")
shortOTElevel   = input.float(defval = 0.79, title = "Short Entry Retracement Level", options =  , group = "Optimal Trade Entry")
shortOTEPT      = input.string(defval = "-0.5", title = "Short TP", options =  , group = "Optimal Trade Entry")
shortOTESL      = input.int(defval = 0, title = "How Many Ticks Above Swing Low For Stop Loss", group = "Optimal Trade Entry")
  Returns: void (0)
 displacement(logZ, atrTFreg, highArr, timeArr, lowArr, upDispShow, dnDispShow, masterCoords, labelLevels, dispUpcol, rightCoordinate, dispDncol, noBorders) 
  calculates and draws dispacements
  Parameters:
     logZ (float) : log return of current price, used to determine a "significant price move" for a displacement
     atrTFreg (float) : atr of user-seleceted timeframe
     highArr (array) : array of historical highs
     timeArr (array) : array of historical times
     lowArr (array) : array of historical lows
     upDispShow (int) : amount of historical upside displacements to show
     dnDispShow (int) : amount of historical downside displacements to show
     masterCoords (map) : a  map to push the most recent displacement prices into, useful for having key levels in one data structure
     labelLevels (string) : used to determine label placement for the displacement, can be inside box, outside box, or none, example below
     dispUpcol (color) : upside displacement color
     rightCoordinate (int) : future time for displacement drawing, best is "last_bar_time"
     dispDncol (color) : downside displacement color
     noBorders (bool) : input.bool() to remove box borders, example below
@exampleInputs
labelLevels     = input.string(defval = "Inside" , title = "Box Label Placement", options =  )
noBorders       = input.bool(defval = false, title = "No Borders On Levels")
  Returns: void
 method getStrongLow(id, startIndex, timeArr, lowArr, strongLowPoints) 
  unshift strong low data to array id
  Namespace types: array
  Parameters:
     id (array) 
     startIndex (int) : the starting index for the timeArr array of the UDT "necessaryData".
this point should start from at least 1 pivot prior to find the low before an upside BoS
     timeArr (array) : array of historical times
     lowArr (array) : array of historical lows
     strongLowPoints (array) : array of strong low prices. Used to retrieve highest strong low price and see if need for
removal of invalidated strong lows
  Returns: void
 method getStrongHigh(id, startIndex, timeArr, highArr, strongHighPoints) 
  unshift strong high data to array id
  Namespace types: array
  Parameters:
     id (array) 
     startIndex (int) : the starting index for the timeArr array of the UDT "necessaryData".
this point should start from at least 1 pivot prior to find the high before a downside BoS
     timeArr (array) : array of historical times
     highArr (array) : array of historical highs
     strongHighPoints (array) 
  Returns: void
 equalLevels(highArr, lowArr, timeArr, rightCoordinate, equalHighsCol, equalLowsCol, liteMode) 
  used to calculate recent equal highs or equal lows
  Parameters:
     highArr (array) : array of historical highs
     lowArr (array) : array of historical lows
     timeArr (array) : array of historical times
     rightCoordinate (int) : a future time (right for boxes, x2 for lines)
     equalHighsCol (color) : user-selected color for equal highs drawings
     equalLowsCol (color) : user-selected color for equal lows drawings
     liteMode (bool) : optional for a lite mode version of an ICT strategy. For more control over drawings leave as "True", "False" will apply neon effects
  Returns: void
 quickTime(timeString) 
  used to quickly determine if a user-inputted time range is currently active in NYT time
  Parameters:
     timeString (string) : a time range
  Returns: true if session is active, false if session is inactive
 macros(showMacros, noBorders) 
  used to calculate and draw session macros
  Parameters:
     showMacros (bool) : an input.bool() or simple bool to determine whether to activate the function
     noBorders (bool) : an input.bool() to determine whether the box anchored to the session should have borders
  Returns: void
 po3(tf, left, right, show) 
  use to calculate HTF po3 candle
@tip only call this function on "barstate.islast"
  Parameters:
     tf (simple string) 
     left (int) : the left point of the candle, calculated as bar_index + left,
     right (int) : :the right point of the candle, calculated as bar_index + right,
     show (bool) : input.bool() whether to show the po3 candle or not
  Returns: void
 silverBullet(silverBulletStratLong, silverBulletStratShort, future, userTF, H, L, H2, L2, noBorders, silverBulletLongTP, historicalPoints, historicalData, silverBulletLongSL, silverBulletShortTP, silverBulletShortSL) 
  used to execute the Silver Bullet Strategy
  Parameters:
     silverBulletStratLong (simple bool) 
     silverBulletStratShort (simple bool) 
     future (int) : a future time, used for drawings, example "last_bar_time"
     userTF (simple int) 
     H (float) : the high price of the user-selected TF
     L (float) : the low price of the user-selected TF
     H2 (float) : the high  price of the user-selected TF
     L2 (float) : the low  price of the user-selected TF
     noBorders (bool) : an input.bool() used to remove the borders from box drawings
     silverBulletLongTP (series silverBulletLevels) 
     historicalPoints (array) 
     historicalData (necessaryData) 
     silverBulletLongSL (series silverBulletLevels) 
     silverBulletShortTP (series silverBulletLevels) 
     silverBulletShortSL (series silverBulletLevels) 
  Returns: void
 method invalidFVGcheck(FVGarr, upFVGpricesSorted, dnFVGpricesSorted) 
  check if existing FVGs are still valid
  Namespace types: array
  Parameters:
     FVGarr (array) 
     upFVGpricesSorted (array) : an array of bullish FVG prices, used to selective search through FVG array to remove invalidated levels
     dnFVGpricesSorted (array) : an array of bearish FVG prices, used to selective search through FVG array to remove invalidated levels
  Returns: void (0)
 method drawFVG(counter, FVGshow, FVGname, FVGcol, data, masterCoords, labelLevels, borderTransp, liteMode, rightCoordinate) 
  draws FVGs on last bar
  Namespace types: map
  Parameters:
     counter (map) : a counter, as map, keeping count of the number of FVGs drawn, makes sure that there aren't more FVGs drawn
than int FVGshow
     FVGshow (int) : the number of FVGs to show. There should be a bullish FVG show and bearish FVG show. This function "drawFVG" is used separately
for bearish FVG and bullish FVG.
     FVGname (string) : the name of the FVG, "FVG Up" or "FVG Down"
     FVGcol (color) : desired FVG color
     data (FVG) 
     masterCoords (map) : a map containing the names and price points of key levels. Used to define price ranges.
     labelLevels (string) : an input.string with options "Inside", "Outside", "Remove". Determines whether FVG labels should be inside box, outside,
or na.
     borderTransp (int) 
     liteMode (bool) 
     rightCoordinate (int) : the right coordinate of any drawings. Must be a time point.
  Returns: void
 invalidBlockCheck(bullishOBbox, bearishOBbox, userTF) 
  check if existing order blocks are still valid
  Parameters:
     bullishOBbox (array) : an array declared using the UDT orderBlock that contains bullish order block related data
     bearishOBbox (array) : an array declared using the UDT orderBlock that contains bearish order block related data
     userTF (simple int) 
  Returns: void (0)
 method lastBarRejections(id, rejectionColor, idShow, rejectionString, labelLevels, borderTransp, liteMode, rightCoordinate, masterCoords) 
  draws rejectionBlocks on last bar
  Namespace types: array
  Parameters:
     id (array) : the array, an array of rejection block data declared using the UDT rejection block
     rejectionColor (color) : the desired color of the rejection box
     idShow (int) 
     rejectionString (string) : the desired name of the rejection blocks
     labelLevels (string) : an input.string() to determine if labels for the block should be inside the box, outside, or none.
     borderTransp (int) 
     liteMode (bool) : an input.bool(). True = neon effect, false = no neon.
     rightCoordinate (int) : atime for the right coordinate of the box
     masterCoords (map) : a map  that stores the price of key levels and assigns them a name, used to determine price ranges
  Returns: void
 method OBdraw(id, OBshow, BBshow, OBcol, BBcol, bullishString, bearishString, isBullish, labelLevels, borderTransp, liteMode, rightCoordinate, masterCoords) 
  draws orderblocks and breaker blocks for data stored in UDT array()
  Namespace types: array
  Parameters:
     id (array) : the array, an array of order block data declared using the UDT orderblock
     OBshow (int) : the number of order blocks to show
     BBshow (int) : the number of breaker blocks to show
     OBcol (color) : color of order blocks
     BBcol (color) : color of breaker blocks
     bullishString (string) : the title of bullish blocks, which is a regular bullish orderblock or a bearish orderblock that's converted to breakerblock
     bearishString (string) : the title of bearish blocks, which is a regular bearish orderblock or a bullish orderblock that's converted to breakerblock
     isBullish (bool) : whether the array contains bullish orderblocks or bearish orderblocks. If bullish orderblocks,
the array will naturally contain bearish BB, and if bearish OB, the array will naturally contain bullish BB
     labelLevels (string) : an input.string() to determine if labels for the block should be inside the box, outside, or none.
     borderTransp (int) 
     liteMode (bool) : an input.bool(). True = neon effect, false = no neon.
     rightCoordinate (int) : atime for the right coordinate of the box
     masterCoords (map) : a map  that stores the price of key levels and assigns them a name, used to determine price ranges
  Returns: void
 FVG 
  UDT for FVG calcualtions
  Fields:
     H (series float) : high price of user-selected timeframe
     L (series float) : low price of user-selected timeframe
     direction (series string) : FVG direction => "Up" or "Down"
     T (series int) : => time of bar on user-selected timeframe where FVG was created
     fvgLabel (series label) : optional label for FVG
     fvgLineTop (series line) : optional line for top of FVG
     fvgLineBot (series line) : optional line for bottom of FVG
     fvgBox (series box) : optional box for FVG
 labelLine 
  quickly pair a line and label together as UDT
  Fields:
     lin (series line) : Line you wish to pair with label
     lab (series label) : Label you wish to pair with line
 orderBlock 
  UDT for order block calculations
  Fields:
     orderBlockData (array) : array containing order block x and y points
     orderBlockBox (series box) : optional order block box
     vioCount (series int) : = 0    violation count of the order block. 0 = Order Block, 1 = Breaker Block
     traded (series bool) 
     status (series string) : = "OB"   status == "OB" => Level is order block. status == "BB" => Level is breaker block.
     orderBlockLab (series label) : options label for the order block / breaker block.
 strongPoints 
  UDT for strong highs and strong lows
  Fields:
     price (series float) : price of the strong high or strong low
     timeAtprice (series int) : time of the strong high or strong low
     strongPointLabel (series label) : optional label for strong point
     strongPointLine (series line) : optional line for strong point
     overlayLine (series line) : optional lines for strong point to enhance visibility
     overlayLine2 (series line) : optional lines for strong point to enhance visibility
 displacement 
  UDT for dispacements
  Fields:
     highPrice (series float) : high price of displacement
     lowPrice (series float) : low price of displacement
     timeAtPrice (series int) : time of bar where displacement occurred
     displacementBox (series box) : optional box to draw displacement
     displacementLab (series label) : optional label for displacement
 po3data 
  UDT for po3 calculations
  Fields:
     dHigh (series float) : higher timeframe high price
     dLow (series float) : higher timeframe low price
     dOpen (series float) : higher timeframe open price
     dClose (series float) : higher timeframe close price
     po3box (series box) : box to draw po3 candle body
     po3line (array) : line array to draw po3 wicks
     po3Labels (array) : label array to label price points of po3 candle
 macros 
  UDT for session macros
  Fields:
     sessions (array) : Array of sessions, you can populate this array using the "quickTime" function located above "export macros".
     prices (matrix) : Matrix of session data -> open, high, low, close, time
     sessionTimes (array) : Array of session names. Pairs with array sessions.
     sessionLines (matrix) : Optional array for sesion drawings.
 OTEtimes 
  UDT for data storage and drawings associated with OTE strategy
  Fields:
     upTimes (array) : time of highest point before trade is taken
     dnTimes (array) : time of lowest point before trade is taken
     tpLineLong (series line) : line to mark tp level long
     tpLabelLong (series label) : label to mark tp level long
     slLineLong (series line) : line to mark sl level  long
     slLabelLong (series label) : label to mark sl level long
     tpLineShort (series line) : line to mark tp level short
     tpLabelShort (series label) : label to mark tp level short
     slLineShort (series line) : line to mark sl level  short
     slLabelShort (series label) : label to mark sl level short
 sweeps 
  UDT for data storage and drawings associated with liquidity sweeps
  Fields:
     upSweeps (matrix) : matrix containing liquidity sweep price points and time points for up sweeps
     dnSweeps (matrix) : matrix containing liquidity sweep price points and time points for down sweeps
     upSweepDrawings (array) : optional up sweep box array. Pair the size of this array with the rows or columns,
     dnSweepDrawings (array) : optional up sweep box array. Pair the size of this array with the rows or columns,
 raidExitDrawings 
  UDT for drawings associated with the Liquidity Raid Strategy
  Fields:
     tpLine (series line) : tp line for the liquidity raid entry
     tpLabel (series label) : tp label for the liquidity raid entry
     slLine (series line) : sl line for the liquidity raid entry
     slLabel (series label) : sl label for the liquidity raid entry
 m2022 
  UDT for data storage and drawings associated with the Model 2022 Strategy
  Fields:
     mTime (series int) : time of the FVG where entry limit order is placed
     mIndex (series int) : array index of FVG where entry limit order is placed. This requires an array of FVG data, which is defined above.
     mEntryDistance (series float) : the distance of the FVG to the 50% range. M2022 looks for the fvg closest to 50% mark of range.
     mEntry (series float) : the entry price for the most eligible fvg
     fvgHigh (series float) : the high point of the eligible fvg
     fvgLow (series float) : the low point of the eligible fvg
     longFVGentryBox (series box) : long FVG box, used to draw the eligible FVG
     shortFVGentryBox (series box) : short FVG box, used to draw the eligible FVG
     line50P (series line) : line used to mark 50% of the range
     line100P (series line) : line used to mark 100% (top) of the range
     line0P (series line) : line used to mark 0% (bottom) of the range
     label50P (series label) : label used to mark 50% of the range
     label100P (series label) : label used to mark 100% (top) of the range
     label0P (series label) : label used to mark 0% (bottom) of the range
     sweepData (array) 
 silverBullet 
  UDT for data storage and drawings associated with the Silver Bullet Strategy
  Fields:
     session (series bool) 
     sessionStr (series string) : name of the session for silver bullet
     sessionBias (series string) 
     sessionHigh (series float) : = high   high of session // use math.max(silverBullet.sessionHigh, high)
     sessionLow (series float) : = low    low of session  // use math.min(silverBullet.sessionLow, low)
     sessionFVG (series float) : if applicable, the FVG created during the session
     sessionFVGdraw (series box) : if applicable, draw the FVG created during the session
     traded (series bool) 
     tp (series float) : tp of trade entered at the session FVG
     sl (series float) : sl of trade entered at the session FVG
     sessionDraw (series box) : optional draw session with box
     sessionDrawLabel (series label) : optional label session with label
 silverBulletDrawings 
  UDT for trade exit drawings associated with the Silver Bullet Strategy
  Fields:
     tpLine (series line) : tp line drawing for strategy
     tpLabel (series label) : tp label drawing for strategy
     slLine (series line) : sl line drawing for strategy
     slLabel (series label) : sl label drawing for strategy
 unicornModel 
  UDT for data storage and drawings associated with the Unicorn Model Strategy
  Fields:
     hPoint (chart.point) 
     hPoint2 (chart.point) 
     hPoint3 (chart.point) 
     breakerBlock (series box) : used to draw the breaker block required for the Unicorn Model
     FVG (series box) : used to draw the FVG required for the Unicorn model
     topBlock (series float) : price of top of breaker block, can be used to detail trade entry
     botBlock (series float) : price of bottom of breaker block, can be used to detail trade entry
     startBlock (series int) : start time of the breaker block, used to set the "left = " param for the box
     includes (array) : used to store the time of the breaker block, or FVG, or the chart point sequence that setup the Unicorn Model.
     entry (series float) : // eligible entry price, for longs"math.max(topBlock, FVG.get_top())",
     tpLine (series line) : optional line to mark PT
     tpLabel (series label) : optional label to mark PT
     slLine (series line) : optional line to mark SL
     slLabel (series label) : optional label to mark SL
 rejectionBlocks 
  UDT for data storage and drawings associated with rejection blocks
  Fields:
     rejectionPoint (chart.point) 
     bodyPrice (series float) : candle body price closest to the rejection point, for "Up" rejections => math.max(open, close),
     rejectionBox (series box) : optional box drawing of the rejection block
     rejectionLabel (series label) : optional label for the rejection block
 equalLevelsDraw 
  UDT for data storage and drawings associated with equal highs / equal lows
  Fields:
     connector (series line) : single line placed at the first high or low, y = avgerage of distinguished equal highs/lows
     connectorLab (series label) : optional label to be placed at the highs or lows
     levels (array) : array containing the equal highs or lows prices
     times (array) : array containing the equal highs or lows individual times
     startTime (series int) : the time of the first high or low that forms a sequence of equal highs or lows
     radiate (array) : options label to "radiate" the label in connector lab. Can be used for anything
 necessaryData 
  UDT for data storage of historical price points.
  Fields:
     highArr (array) : array containing historical high points
     lowArr (array) : array containing historical low points
     timeArr (array) : array containing historical time points
     logArr (array) : array containing historical log returns
     signArr (array) : array containing historical price directions
     closeArr (array) : array containing historical close points
     binaryTimeArr (array) : array containing historical time points, uses "push" instead of "unshift" to allow for binary search
     binaryCloseArr (array) : array containing historical close points, uses "push" instead of "unshift" to allow the correct
     binaryOpenArr (array) : array containing historical optn points, uses "push" instead of "unshift" to allow the correct
     atrTFarr (array) : array containing historical user-selected TF atr points
     openArr (array) : array containing historical open points
HTFCandlesLibLibrary   "HTFCandlesLib" 
Library to get detailed higher timeframe candle information
 method tostring(this, delimeter) 
  Returns OHLC values, BarIndex of higher and lower timeframe candles in string format
  Namespace types: Candle
  Parameters:
     this (Candle) : Current Candle object
     delimeter (string) : delimeter to join the string components of the candle
  Returns: String representation of the Candle
 method draw(this, bullishColor, bearishColor, printDescription) 
  Draws the current candle using boxes and lines for body and wicks
  Namespace types: Candle
  Parameters:
     this (Candle) : Current Candle object
     bullishColor (color) : color for bullish representation
     bearishColor (color) : color for bearish representation
     printDescription (bool) : if set to true prints the description
  Returns: Current candle object
 getCurrentCandle(ltfCandles) 
  Gets the current candle along with reassigned ltf components. To be used with request.security to capture higher timeframe candle data
  Parameters:
     ltfCandles (array) : Lower timeframe Candles array
  Returns: Candle object with embedded lower timeframe key candles in them
 Candle 
  Candle represents the data related to a candle
  Fields:
     o (series float) : Open price of the candle
     h (series float) : High price of the candle
     l (series float) : Low price of the candle
     c (series float) : Close price of the candle
     lo (Candle) : Lower timeframe candle that records the open price of the current candle.
     lh (Candle) : Lower timeframe candle that records the high price of the current candle.
     ll (Candle) : Lower timeframe candle that records the low price of the current candle.
     lc (Candle) : Lower timeframe candle that records the close price of the current candle.
     barindex (series int) : Bar Index of the candle
     bartime (series int) : Bar time of the candle
     last (Candle) : Link to last candle of the series if any
NumberOfVisibleBarsLibrary   "NumberOfVisibleBars" 
TODO: add library description here
 NumberOfVisibleBars() 
  Calculates the number of visible bars on the user screen
  Returns: The numbers of visible bars on the user screen (int)
lib_setLibrary   "lib_set" 
This is a convenience lib that bundles different setter functions allowing to update all coordinates and of line/box in one call, and coordinates and text for label.
 method set_xy_text(this, x, y, txt, tooltip) 
  Updates a label object with new data (equals redrawing it)
  Namespace types: series label
  Parameters:
     this (label) 
     x (int) : reassigns the x coordinate, optional param, no effect if x = na (same as draw(extend_only = true) for Line objects). Avoiding to reassign x can prevent errors for invalid params passed to set_x***
     y (float) : reassigns the y coordinate
     txt (string) : reassigns the label text
     tooltip (string) : reassigns the label tooltip
 method set_xy1_xy2(this, x1, y1, x2, y2) 
  Updates a line object with new data (equals redrawing it)
  Namespace types: series line
  Parameters:
     this (line) 
     x1 (int) : reassigns the x1 coordinate, optional param, no effect if x1 = na (same as draw(extend_only = true) for Line objects). Avoiding to reassign x1 can prevent errors for invalid params passed to set_x***
     y1 (float) : reassigns the y1 coordinate
     x2 (int) : reassigns the x2 coordinate
     y2 (float) : reassigns the y2 coordinate
 method set_left_top_right_bottom(this, left, top, right, bottom) 
  Updates a box object with new data (equals redrawing it)
  Namespace types: series box
  Parameters:
     this (box) 
     left (int) : reassigns the left coordinate, optional param, no effect if left = na (same as draw(extend_only = true) for Box objects). Avoiding to reassign 'left' can prevent errors for invalid params passed to set_x***
     top (float) : reassigns the top coordinate
     right (int) : reassigns the right coordinate
     bottom (float) : reassigns the bottom coordinate
PRINT_DROVINGLibrary   "PRINT_DROVING" 
 method print_droving(foot_bar, sup) 
  printing all footprint objects
  Namespace types: footprint_type.Footprint_bar
  Parameters:
     foot_bar (Footprint_bar type from Alesetup/PRINT_TYPE/1) : instance of Footprint_bar type
     sup (Support_objects type from Alesetup/PRINT_TYPE/1) : instance of Support_objects type
  Returns: Void.
PRINT_LOGICLibrary   "PRINT_LOGIC" 
 method fill_imba_line(imba_line, foot_bar, sup) 
  fill imbalance line
  Namespace types: footprint_type.Imbalance_line
  Parameters:
     imba_line (Imbalance_line type from Alesetup/PRINT_TYPE/1) : instance of Imbalance_line type
     foot_bar (Footprint_bar type from Alesetup/PRINT_TYPE/1) : instance of Footprint_bar type
     sup (Support_objects type from Alesetup/PRINT_TYPE/1) : instance of Support_objects type
  Returns: Void
 method fill_footprint_type(foot_bar, sup) 
  Namespace types: footprint_type.Footprint_bar
  Parameters:
     foot_bar (Footprint_bar type from Alesetup/PRINT_TYPE/1) : instance of Footprint_bar type
     sup (Support_objects type from Alesetup/PRINT_TYPE/1) : instance of Support_objects type
  Returns: Void
 method fill_footprint_object(foot_bar, sup) 
  fill all footprint objects
  Namespace types: footprint_type.Footprint_bar
  Parameters:
     foot_bar (Footprint_bar type from Alesetup/PRINT_TYPE/1) : instance of Footprint_bar type
     sup (Support_objects type from Alesetup/PRINT_TYPE/1) : instance of Support_objects type
  Returns: Void
PRINT_TYPELibrary   "PRINT_TYPE" 
 Inputs 
  Inputs objects
  Fields:
     inbalance_percent (series int) : percentage coefficient to determine the Imbalance of price levels
     stacked_input (series int) : minimum number of consecutive Imbalance levels required to draw extended lines
     show_summary_footprint (series bool) 
     procent_volume_area (series int) : definition size Value area
     new_imbalance_cond (series bool) : bool input for setup alert on new imbalance buy and sell
     new_imbalance_line_cond (series bool) : bool input for setup alert on new imbalance line buy and sell
     stop_past_imbalance_line_cond (series bool) : bool input for setup alert on stop past imbalance line buy and sell
 Constants 
  Constants all Constants objects
  Fields:
     imbalance_high_char (series string) : char for printing buy imbalance
     imbalance_low_char (series string) : char for printing sell imbalance
     color_title_sell (series color) : color for footprint sell
     color_title_buy (series color) : color for footprint buy
     color_line_sell (series color) : color for sell line
     color_line_buy (series color) : color for buy line
     color_title_none (series color) : color None
 Calculation_data 
  Calculation_data data for calculating
  Fields:
     detail_open (array) : array open from calculation timeframe
     detail_high (array) : array high from calculation timeframe
     detail_low (array) : array low from calculation timeframe
     detail_close (array) : array close from calculation timeframe
     detail_vol (array) : array volume from calculation timeframe
     previos_detail_close (array) : array close  from calculation timeframe
     isBuyVolume (series bool) : attribute previosly bar buy or sell
 Footprint_row 
  Footprint_row objects one footprint row
  Fields:
     price (series float) : row price
     buy_vol (series float) : buy volume
     sell_vol (series float) : sell volume
     imbalance_buy (series bool) : attribute buy inbalance
     imbalance_sell (series bool) : attribute sell imbalance
     buy_vol_box (series box) : for ptinting buy volume
     sell_vol_box (series box) : for printing sell volume
     buy_vp_box (series box) : for ptinting volume profile buy
     sell_vp_box (series box) : for ptinting volume profile sell
     row_line (series label) : for ptinting row price
     empty (series bool) : = true attribute row with zero volume buy and zero volume sell
 Imbalance_line_var_object 
  Imbalance_line_var_object var objects printing and calculation imbalance line
  Fields:
     cum_buy_line (array) : line array for saving all history buy imbalance line
     cum_sell_line (array) : line array for saving all history sell imbalance line
 Imbalance_line 
  Imbalance_line objects printing and calculation imbalance line
  Fields:
     buy_price_line (array) : float array for saving buy imbalance price level
     sell_price_line (array) : float array for saving sell imbalance price level
     var_imba_line (Imbalance_line_var_object) : var objects this type
 Footprint_bar 
  Footprint_bar all objects one bar with footprint
  Fields:
     foot_rows (array) : objects one row footprint
     imba_line (Imbalance_line) : objects imbalance line
     row_size (series float) : size rows
     total_vol (series float) : total volume one footprint bar
     foot_buy_vol (series float) : buy volume one footprint bar
     foot_sell_vol (series float) : sell volume one footprint bar
     foot_max_price_vol (map) : map with one value - price row with max volume buy + sell
     calc_data (Calculation_data) : objects with detail data from calculation resolution
 Support_objects 
  Support_objects support object for footprint calculation
  Fields:
     consts (Constants) : all consts objects
     inp (Inputs) : all input objects
     bar_index_show_condition (series bool) : calculation bool value for show all objects footprint
     row_line_color (series color) : calculation value - color for row price
     dop_info (series string) 
     show_table_cond (series bool)























