VolumeSpreadAnalysisLibrary "VolumeSpreadAnalysis"
A library for Volume Spread Analysis (VSA).
spread(_barIndex)
Calculates the spread of a bar.
Parameters:
_barIndex (int) : (int) The index of the bar.
Returns: (float) The spread of the bar.
volume(_barIndex)
Retrieves the volume of a bar.
Parameters:
_barIndex (int) : (int) The index of the bar.
Returns: (float) The volume of the bar.
body(_barIndex)
Calculates the body of a bar.
Parameters:
_barIndex (simple int) : (int) The index of the bar.
Returns: (float) The body size of the bar.
wickUpper(_barIndex)
Calculates the upper wick of a bar (upper shadow).
Parameters:
_barIndex (simple int) : (int) The index of the bar.
Returns: (float) The upper wick size of the bar.
wickLower(_barIndex)
Calculates the lower wick of a bar (lower shadow).
Parameters:
_barIndex (simple int) : (int) The index of the bar.
Returns: (float) The lower wick size of the bar.
calcForecastedSMA(_source, _length, _forecastedLevel)
Calculates the forecasted Simple Moving Average (SMA).
Parameters:
_source (float) : (series float) Source data for calculation.
_length (simple int) : (int) The length of the SMA.
_forecastedLevel (float) : (float) The forecasted level to include in the calculation.
Returns: (float) The forecasted SMA value.
calcForecastedEMA(_source, _length, _forecastedLevel)
Calculates the forecasted Exponential Moving Average (EMA).
Parameters:
_source (float) : (series float) Source data for calculation.
_length (simple int) : (int) The length of the EMA.
_forecastedLevel (float) : (float) The forecasted level to include in the calculation.
Returns: (float) The forecasted EMA value.
calcForecastedRMA(_source, _length, _forecastedLevel)
Calculates the forecasted Relative Moving Average (RMA).
Parameters:
_source (float) : (series float) Source data for calculation.
_length (simple int) : (int) The length of the RMA.
_forecastedLevel (float) : (float) The forecasted level to include in the calculation.
Returns: (float) The forecasted RMA value.
calcForecastedWMA(_source, _length, _forecastedLevel)
Calculates the forecasted Weighted Moving Average (WMA).
Parameters:
_source (float) : (series float) Source data for calculation.
_length (simple int) : (int) The length of the WMA.
_forecastedLevel (float) : (float) The forecasted level to include in the calculation.
Returns: (float) The forecasted WMA value.
calcElapsedTimePercent()
Calculates the elapsed time percent of the current bar.
Returns: (float) The elapsed time percent.
calcForecastedSpread(multiplierAtMidpoints, multiplierAtPeaks)
Calculates the forecasted spread using elapsed time and dynamic multipliers, handling spread's non-linear nature.
Parameters:
multiplierAtMidpoints (float) : (float) The multiplier value at midpoints.
multiplierAtPeaks (float) : (float) The multiplier value at peaks.
Returns: (float) The forecasted spread value.
calcForecastedVolume()
Calculates the forecasted volume using elapsed time, satisfying volume's linear nature.
Returns: (float) The forecasted volume value.
calcForecastedMA(_source, _length, _forecastedSource, _type)
Calculates the forecasted Moving Average (MA) based on the specified type.
Parameters:
_source (float) : (series float) Source data for calculation.
_length (simple int) : (int) The length of the MA.
_forecastedSource (float) : (float) The forecasted level to include in the calculation.
_type (simple string) : (string) The type of the MA ("SMA", "EMA", "SMMA (RMA)", "WMA").
Returns: (float) The forecasted MA value.
calcMA(_source, _length, _type)
Calculates the Moving Average (MA) based on the specified type.
Parameters:
_source (float) : (series float) Source data for calculation.
_length (simple int) : (int) The length of the MA.
_type (simple string) : (string) The type of the MA ("SMA", "EMA", "SMMA (RMA)", "WMA").
Returns: (float) The MA value.
bullBar(_barIndex)
Determines if the bar is bullish.
Parameters:
_barIndex (simple int) : (int) The index of the bar.
Returns: (bool) True if the bar is bullish, otherwise false.
bearBar(_barIndex)
Determines if the bar is bearish.
Parameters:
_barIndex (simple int) : (int) The index of the bar.
Returns: (bool) True if the bar is bearish, otherwise false.
breakout(_barIndex)
Determines if there is a breakout above the previous bar.
Parameters:
_barIndex (simple int) : (int) The index of the bar.
Returns: (bool) True if there is a breakout, otherwise false.
breakdown(_barIndex)
Determines if there is a breakdown below the previous bar.
Parameters:
_barIndex (simple int) : (int) The index of the bar.
Returns: (bool) True if there is a breakdown, otherwise false.
rejectionWickUpper(_rejectionWick)
Determines if the upper wick is a rejection wick.
Parameters:
_rejectionWick (simple float) : (float) The rejection wick percentage.
Returns: (bool) True if the upper wick is a rejection wick, otherwise false.
rejectionWickLower(_rejectionWick)
Determines if the lower wick is a rejection wick.
Parameters:
_rejectionWick (simple float) : (float) The rejection wick percentage.
Returns: (bool) True if the lower wick is a rejection wick, otherwise false.
setupDataVolume(_data, _mult_Low, _mult_High, _mult_Ultra, _maLengthVolume, _maTypeVolume)
Sets up data for volume levels.
Parameters:
_data (map) : (map) The map to store the levels.
_mult_Low (simple float) : (float) The multiplier for low level.
_mult_High (simple float) : (float) The multiplier for high level.
_mult_Ultra (simple float) : (float) The multiplier for ultra level.
_maLengthVolume (simple int) : (int) The length for MA.
_maTypeVolume (simple string) : (string) The type for MA.
Returns: (void) Nothing.
setupDataSpread(_data, _mult_Low, _mult_High, _mult_Ultra, _maLengthSpread, _maTypeSpread)
Sets up data for spread levels.
Parameters:
_data (map) : (map) The map to store the levels.
_mult_Low (simple float) : (float) The multiplier for low level.
_mult_High (simple float) : (float) The multiplier for high level.
_mult_Ultra (simple float) : (float) The multiplier for ultra level.
_maLengthSpread (simple int) : (int) The length for MA.
_maTypeSpread (simple string) : (string) The type for MA.
Returns: (void) Nothing.
setupDataForecastVolume(_dataForecast, _mult_Low, _mult_High, _mult_Ultra, _maLengthVolume, _predictedLevelVolume, _maTypeVolume)
Sets up data for volume and spread levels for forecast.
Parameters:
_dataForecast (map)
_mult_Low (simple float) : (float) The multiplier for low level.
_mult_High (simple float) : (float) The multiplier for high level.
_mult_Ultra (simple float) : (float) The multiplier for ultra level.
_maLengthVolume (simple int) : (int) The length for MA.
_predictedLevelVolume (float) : (float) The predicted level for MA.
_maTypeVolume (simple string) : (string) The type for MA.
Returns: (void) Nothing.
setupDataForecastSpread(_dataForecast, _mult_Low, _mult_High, _mult_Ultra, _maLengthSpread, _predictedLevelSpread, _maTypeSpread)
Sets up data for spread levels for forecast.
Parameters:
_dataForecast (map)
_mult_Low (simple float) : (float) The multiplier for low level.
_mult_High (simple float) : (float) The multiplier for high level.
_mult_Ultra (simple float) : (float) The multiplier for ultra level.
_maLengthSpread (simple int) : (int) The length for MA.
_predictedLevelSpread (float) : (float) The predicted level for MA.
_maTypeSpread (simple string) : (string) The type for MA.
Returns: (void) Nothing.
isVolumeLow(_data, _barIndex)
Determines if the volume is low.
Parameters:
_data (map) : (map) The data map with volume levels.
_barIndex (int)
Returns: (bool) True if the volume is low, otherwise false.
isVolumeNormal(_data, _barIndex)
Determines if the volume is normal.
Parameters:
_data (map) : (map) The data map with volume levels.
_barIndex (int)
Returns: (bool) True if the volume is normal, otherwise false.
isVolumeHigh(_data, _barIndex)
Determines if the volume is high.
Parameters:
_data (map) : (map) The data map with volume levels.
_barIndex (int)
Returns: (bool) True if the volume is high, otherwise false.
isVolumeUltra(_data, _barIndex)
Determines if the volume is ultra.
Parameters:
_data (map) : (map) The data map with volume levels.
_barIndex (int)
Returns: (bool) True if the volume is ultra, otherwise false.
isSpreadLow(_data, _barIndex)
Determines if the spread is low.
Parameters:
_data (map) : (map) The data map with spread levels.
_barIndex (int)
Returns: (bool) True if the spread is low, otherwise false.
isSpreadNormal(_data, _barIndex)
Determines if the spread is normal.
Parameters:
_data (map) : (map) The data map with spread levels.
_barIndex (int)
Returns: (bool) True if the spread is normal, otherwise false.
isSpreadHigh(_data, _barIndex)
Determines if the spread is high.
Parameters:
_data (map) : (map) The data map with spread levels.
_barIndex (int)
Returns: (bool) True if the spread is high, otherwise false.
isSpreadUltra(_data, _barIndex)
Determines if the spread is ultra.
Parameters:
_data (map) : (map) The data map with spread levels.
_barIndex (int)
Returns: (bool) True if the spread is ultra, otherwise false.
isVolumeText(_data)
Determines text string representing the volume area level.
Parameters:
_data (map) : (map) The data map with volume levels.
Returns: (string) Text string of Low, Normal, High, or Ultra.
isSpreadText(_data)
Determines text string representing the spread area level.
Parameters:
_data (map) : (map) The data map with spread levels.
Returns: (string) Text string of Low, Normal, High, or Ultra.
calcBarColor(_value, _level)
Calculates the color based level.
Parameters:
_value (float) : (float) The value to check.
_level (float) : (float) The value level for comparison.
Returns: (color) The color for the bar.
bullPinBar(_maxBodyPercent, _minWickPercent)
Determines if the bar is a bull pin bar.
Parameters:
_maxBodyPercent (simple float) : (float) The maximum body percentage.
_minWickPercent (simple float) : (float) The minimum wick percentage.
Returns: (bool) True if the bar is a bull pin bar, otherwise false.
bearPinBar(_maxBodyPercent, _minWickPercent)
Determines if the bar is a bear pin bar.
Parameters:
_maxBodyPercent (simple float) : (float) The maximum body percentage.
_minWickPercent (simple float) : (float) The minimum wick percentage.
Returns: (bool) True if the bar is a bear pin bar, otherwise false.
dojiBar(_maxBodyPercent)
Determines if the bar is a doji.
Parameters:
_maxBodyPercent (simple float) : (float) The maximum body percentage.
Returns: (bool) True if the bar is a doji, otherwise false.
spinningTopBar(_minWicksPercent, _emaLength)
Determines if the bar is a spinning top.
Parameters:
_minWicksPercent (simple float) : (float) The minimum wicks percentage.
_emaLength (simple int) : (int) The length for EMA calculation.
Returns: (bool) True if the bar is a spinning top, otherwise false.
highWaveBar(_minBodyPercent, _minWickPercent, _bars)
Determines if the bar is a high wave bar.
Parameters:
_minBodyPercent (simple float) : (float) The minimum body percentage.
_minWickPercent (simple float) : (float) The minimum wick percentage.
_bars (simple int) : (int) The number of bars for comparison.
Returns: (bool) True if the bar is a high wave bar, otherwise false.
consolidationBar(_data, _spread, _bars)
Determines if the bars are in consolidation.
Parameters:
_data (map) : (map) The data map with spread levels.
_spread (simple float) : (float) The spread percentage for comparison.
_bars (simple int) : (int) The number of bars for comparison.
Returns: (bool) True if the bars are in consolidation, otherwise false.
S_DownThrust(_data, _bullPinBarMaxBody, _bullPinBarMinWick)
Determines if there is a sign of strength (DownThrust).
Parameters:
_data (map) : (map) The data map with volume and spread levels.
_bullPinBarMaxBody (simple float) : (float) The maximum body percentage for bull pin bar.
_bullPinBarMinWick (simple float) : (float) The minimum wick percentage for bull pin bar.
Returns: (bool) True if there is a sign of strength (DownThrust), otherwise false.
S_SellingClimax(_data, _rejectionWick)
Determines if there is a sign of strength (Selling Climax).
Parameters:
_data (map) : (map) The data map with volume and spread levels.
_rejectionWick (simple float) : (float) The rejection wick percentage.
Returns: (bool) True if there is a sign of strength (Selling Climax), otherwise false.
S_NoEffortBearishResult()
Determines if there is a sign of strength (No Effort Bearish Result).
Returns: (bool) True if there is a sign of strength (No Effort Bearish Result), otherwise false.
S_BearishEffortNoResult()
Determines if there is a sign of strength (Bearish Effort No Result).
Returns: (bool) True if there is a sign of strength (Bearish Effort No Result), otherwise false.
S_InverseDownThrust(_data, _bearPinBarMaxBody, _bearPinBarMinWick)
Determines if there is a sign of strength (Inverse DownThrust).
Parameters:
_data (map) : (map) The data map with volume and spread levels.
_bearPinBarMaxBody (simple float) : (float) The maximum body percentage for bear pin bar.
_bearPinBarMinWick (simple float) : (float) The minimum wick percentage for bear pin bar.
Returns: (bool) True if there is a sign of strength (Inverse DownThrust), otherwise false.
S_FailedSellingClimax()
Determines if there is a sign of strength (Failed Selling Climax).
Returns: (bool) True if there is a sign of strength (Failed Selling Climax), otherwise false.
S_BullOutsideReversal(_data)
Determines if there is a sign of strength (Bull Outside Reversal).
Parameters:
_data (map) : (map) The data map with volume and spread levels.
Returns: (bool) True if there is a sign of strength (Bull Outside Reversal), otherwise false.
S_EndOfFallingMarket(_data)
Determines if there is a sign of strength (End of Falling Market).
Parameters:
_data (map) : (map) The data map with volume and spread levels.
Returns: (bool) True if there is a sign of strength (End of Falling Market), otherwise false.
S_PseudoDownThrust(_bullPinBarMaxBody, _bullPinBarMinWick)
Determines if there is a sign of strength (Pseudo DownThrust).
Parameters:
_bullPinBarMaxBody (simple float) : (float) The maximum body percentage for bull pin bar.
_bullPinBarMinWick (simple float) : (float) The minimum wick percentage for bull pin bar.
Returns: (bool) True if there is a sign of strength (Pseudo DownThrust), otherwise false.
S_NoSupply(_bullPinBarMaxBody, _bullPinBarMinWick)
Determines if there is a sign of strength (No Supply).
Parameters:
_bullPinBarMaxBody (simple float) : (float) The maximum body percentage for bull pin bar.
_bullPinBarMinWick (simple float) : (float) The minimum wick percentage for bull pin bar.
Returns: (bool) True if there is a sign of strength (No Supply), otherwise false.
W_UpThrust(_data, _bearPinBarMaxBody, _bearPinBarMinWick)
Determines if there is a sign of weakness (UpThrust).
Parameters:
_data (map) : (map) The data map with volume and spread levels.
_bearPinBarMaxBody (simple float) : (float) The maximum body percentage for bear pin bar.
_bearPinBarMinWick (simple float) : (float) The minimum wick percentage for bear pin bar.
Returns: (bool) True if there is a sign of weakness (UpThrust), otherwise false.
W_BuyingClimax(_data, _rejectionWick)
Determines if there is a sign of weakness (Buying Climax).
Parameters:
_data (map) : (map) The data map with volume and spread levels.
_rejectionWick (simple float) : (float) The rejection wick percentage.
Returns: (bool) True if there is a sign of weakness (Buying Climax), otherwise false.
W_NoEffortBullishResult()
Determines if there is a sign of weakness (No Effort Bullish Result).
Returns: (bool) True if there is a sign of weakness (No Effort Bullish Result), otherwise false.
W_BullishEffortNoResult()
Determines if there is a sign of weakness (Bullish Effort No Result).
Returns: (bool) True if there is a sign of weakness (Bullish Effort No Result), otherwise false.
W_InverseUpThrust(_data, _bullPinBarMaxBody, _bullPinBarMinWick)
Determines if there is a sign of weakness (Inverse UpThrust).
Parameters:
_data (map) : (map) The data map with volume and spread levels.
_bullPinBarMaxBody (simple float) : (float) The maximum body percentage for bull pin bar.
_bullPinBarMinWick (simple float) : (float) The minimum wick percentage for bull pin bar.
Returns: (bool) True if there is a sign of weakness (Inverse UpThrust), otherwise false.
W_FailedBuyingClimax()
Determines if there is a sign of weakness (Failed Buying Climax).
Returns: (bool) True if there is a sign of weakness (Failed Buying Climax), otherwise false.
W_BearOutsideReversal(_data)
Determines if there is a sign of weakness (Bear Outside Reversal).
Parameters:
_data (map) : (map) The data map with volume and spread levels.
Returns: (bool) True if there is a sign of weakness (Bear Outside Reversal), otherwise false.
W_EndOfRisingMarket(_data)
Determines if there is a sign of weakness (End of Rising Market).
Parameters:
_data (map) : (map) The data map with volume and spread levels.
Returns: (bool) True if there is a sign of weakness (End of Rising Market), otherwise false.
W_PseudoUpThrust(_bearPinBarMaxBody, _bearPinBarMinWick)
Determines if there is a sign of weakness (Pseudo UpThrust).
Parameters:
_bearPinBarMaxBody (simple float) : (float) The maximum body percentage for bear pin bar.
_bearPinBarMinWick (simple float) : (float) The minimum wick percentage for bear pin bar.
Returns: (bool) True if there is a sign of weakness (Pseudo UpThrust), otherwise false.
W_NoDemand(_bearPinBarMaxBody, _bearPinBarMinWick)
Determines if there is a sign of weakness (No Demand).
Parameters:
_bearPinBarMaxBody (simple float) : (float) The maximum body percentage for bear pin bar.
_bearPinBarMinWick (simple float) : (float) The minimum wick percentage for bear pin bar.
Returns: (bool) True if there is a sign of weakness (No Demand), otherwise false.
N_QuietDoji(_dojiBarMaxBody)
Determines if there is a neutral signal (Quiet Doji).
Parameters:
_dojiBarMaxBody (simple float) : (float) The maximum body percentage for doji bar.
Returns: (bool) True if there is a neutral signal (Quiet Doji), otherwise false.
N_BalancedDoji(_data, _dojiBarMaxBody)
Determines if there is a neutral signal (Balanced Doji).
Parameters:
_data (map) : (map) The data map with volume and spread levels.
_dojiBarMaxBody (simple float) : (float) The maximum body percentage for doji bar.
Returns: (bool) True if there is a neutral signal (Balanced Doji), otherwise false.
N_StrongDoji(_dojiBarMaxBody)
Determines if there is a neutral signal (Strong Doji).
Parameters:
_dojiBarMaxBody (simple float) : (float) The maximum body percentage for doji bar.
Returns: (bool) True if there is a neutral signal (Strong Doji), otherwise false.
N_QuietSpinningTop(_spinningTopBarMinWicks, _spinningTopBarEmaLength)
Determines if there is a neutral signal (Quiet Spinning Top).
Parameters:
_spinningTopBarMinWicks (simple float) : (float) The minimum wicks percentage for spinning top bar.
_spinningTopBarEmaLength (simple int) : (int) The length for EMA calculation.
Returns: (bool) True if there is a neutral signal (Quiet Spinning Top), otherwise false.
N_BalancedSpinningTop(_data, _spinningTopBarMinWicks, _spinningTopBarEmaLength)
Determines if there is a neutral signal (Balanced Spinning Top).
Parameters:
_data (map) : (map) The data map with volume and spread levels.
_spinningTopBarMinWicks (simple float) : (float) The minimum wicks percentage for spinning top bar.
_spinningTopBarEmaLength (simple int) : (int) The length for EMA calculation.
Returns: (bool) True if there is a neutral signal (Balanced Spinning Top), otherwise false.
N_StrongSpinningTop(_spinningTopBarMinWicks, _spinningTopBarEmaLength)
Determines if there is a neutral signal (Strong Spinning Top).
Parameters:
_spinningTopBarMinWicks (simple float) : (float) The minimum wicks percentage for spinning top bar.
_spinningTopBarEmaLength (simple int) : (int) The length for EMA calculation.
Returns: (bool) True if there is a neutral signal (Strong Spinning Top), otherwise false.
N_QuietHighWave(_highWaveBarMinBody, _highWaveBarMinWick, _highWaveBarBars)
Determines if there is a neutral signal (Quiet High Wave).
Parameters:
_highWaveBarMinBody (simple float) : (float) The minimum body percentage for high wave bar.
_highWaveBarMinWick (simple float) : (float) The minimum wick percentage for high wave bar.
_highWaveBarBars (simple int) : (int) The number of bars for comparison.
Returns: (bool) True if there is a neutral signal (Quiet High Wave), otherwise false.
N_BalancedHighWave(_data, _highWaveBarMinBody, _highWaveBarMinWick, _highWaveBarBars)
Determines if there is a neutral signal (Balanced High Wave).
Parameters:
_data (map) : (map) The data map with volume and spread levels.
_highWaveBarMinBody (simple float) : (float) The minimum body percentage for high wave bar.
_highWaveBarMinWick (simple float) : (float) The minimum wick percentage for high wave bar.
_highWaveBarBars (simple int) : (int) The number of bars for comparison.
Returns: (bool) True if there is a neutral signal (Balanced High Wave), otherwise false.
N_StrongHighWave(_highWaveBarMinBody, _highWaveBarMinWick, _highWaveBarBars)
Determines if there is a neutral signal (Strong High Wave).
Parameters:
_highWaveBarMinBody (simple float) : (float) The minimum body percentage for high wave bar.
_highWaveBarMinWick (simple float) : (float) The minimum wick percentage for high wave bar.
_highWaveBarBars (simple int) : (int) The number of bars for comparison.
Returns: (bool) True if there is a neutral signal (Strong High Wave), otherwise false.
N_Consolidation(_data, _consolidationBarSpread, _consolidationBarBars)
Determines if there is a neutral signal (Consolidation).
Parameters:
_data (map) : (map) The data map with volume and spread levels.
_consolidationBarSpread (simple float) : (float) The spread percentage for consolidation bar.
_consolidationBarBars (simple int) : (int) The number of bars for comparison.
Returns: (bool) True if there is a neutral signal (Consolidation), otherwise false.
Wskaźniki i strategie
Volatility_ZigZag_LibraryThis is a Pine Script library for the public indicator "Volatility ZigZag" by brettkind. For further description, please refer to the information available on the original indicator page.
Library "Volatility_ZigZag_Library"
getValues_andStyling_VolatilityZigZag_byBrettkind(hl_src, SOURCE, length, min_dev_input, stdev_fctr, ZigZag, zz_color, zz_width, zz_devline, zz_points, zz_alert_sign, ZZ_Label, ZZ_Label_clr, rev_text, zz_bars_text, pcabs_text, avg_pcabs_text, pcrel_text, avg_pcrel_text, vol_text, avg_vol_text, input_currency)
Parameters:
hl_src (bool)
SOURCE (float)
length (int)
min_dev_input (float)
stdev_fctr (float)
ZigZag (bool)
zz_color (color)
zz_width (int)
zz_devline (bool)
zz_points (bool)
zz_alert_sign (bool)
ZZ_Label (bool)
ZZ_Label_clr (color)
rev_text (bool)
zz_bars_text (bool)
pcabs_text (bool)
avg_pcabs_text (bool)
pcrel_text (bool)
avg_pcrel_text (bool)
vol_text (bool)
avg_vol_text (bool)
input_currency (string)
getStatisticTable_VolatilityZigZag_byBrettkind(x1, Y1_array, draw_tbl)
Parameters:
x1 (int)
Y1_array (array)
draw_tbl (bool)
TRIGLibrary "TRIG"
degreesToRadians(degrees)
Parameters:
degrees (float)
radiansToDegrees(radians)
Parameters:
radians (float)
rt_get_angleAlphaFromLine(x1, y1, x2, y2, inDegrees)
Parameters:
x1 (int)
y1 (float)
x2 (int)
y2 (float)
inDegrees (bool)
rt_get_angleBetaFromLine(x1, y1, x2, y2)
Parameters:
x1 (int)
y1 (float)
x2 (int)
y2 (float)
ALGEBRALibrary "ALGEBRA"
line_fromXy(x1, y1, x2, y2)
Parameters:
x1 (int)
y1 (float)
x2 (int)
y2 (float)
line_getPrice(x, slope, yInt)
Parameters:
x (int)
slope (float)
yInt (float)
line_length(x1, y1, x2, y2)
Parameters:
x1 (int)
y1 (float)
x2 (int)
y2 (float)
distance(x1, y1, x2, y2)
Parameters:
x1 (int)
y1 (float)
x2 (int)
y2 (float)
ImrLibraryLibrary "ImrLibrary"
TODO: add library description here
STG(Length)
TODO: add function description here
Parameters:
Length (int)
Returns: TODO: add what function returns
ISI(Length)
Parameters:
Length (simple int)
statsLibrary "stats"
stats
factorial(x)
factorial
Parameters:
x (int)
standardize(x, length, lengthSmooth)
standardize
@description Moving Standardization of a time series.
Parameters:
x (float)
length (int)
lengthSmooth (int)
dnorm(x, mean, sd)
dnorm
@description Approximation for Normal Density Function.
Parameters:
x (float)
mean (float)
sd (float)
pnorm(x, mean, sd, log)
pnorm
@description Approximation for Normal Cumulative Distribution Function.
Parameters:
x (float)
mean (float)
sd (float)
log (bool)
ewma(x, length, tau_hl)
ewma
@description Exponentially Weighted Moving Average.
Parameters:
x (float)
length (int)
tau_hl (float)
ewm_sd(x, length, tau_hl)
Exponentially Weighted Moving Standard Deviation.
Parameters:
x (float)
length (int)
tau_hl (float)
ewm_scoring(x, length, tau_hl)
ewm_scoring
@description Exponentially Weighted Moving Standardization:
Parameters:
x (float)
length (int)
tau_hl (float)
colorLabLibrary "colorLab"
The ColorLab library presents an essential solution for color optimization, leveraging color terms and philosophy. Through its capabilities, it furnishes the necessary versatility to attain optimal color representation and coherence by integrating functions.
tint_level(colour, level)
Determines a Tinted color
Parameters:
colour (color) : (series color) Pure color.
level (float) : (series float) Optional argument, default = 50. A level of tent color. 0 is entered color and 100 is white color.
Returns: (series color) A color Computed from a linear "Tint" gradient.
shade_level(colour, level)
Determines a Shaded color.
Parameters:
colour (color) : (series color) Pure color.
level (float) : (series float) Optional argument, default = 50. A level of tent color. 0 is entered color and 100 is Black color.
Returns: (series color) A color Computed from a linear "Shade" gradient.
tone_level(colour, level)
Determines a Tone color.
Parameters:
colour (color) : (series color) Pure color.
level (float) : (series float) Optional argument, default = 50. A level of tent color. 0 is entered color and 100 is Gray color.
Returns: (series color) A color Computed from a linear "Tone" gradient.
lightness_gradient(colour, value, bottom_value, top_value, bottom_lightness, top_lightness)
Determines a color from a "Lightness" gradient, based on the position of an entered value within a defined range.
Parameters:
colour (color) : (series color) Pure color.
value (float) : (series float) Value.
bottom_value (float) : (series float) Bottom Value.
top_value (float) : (series float) Top Value.
bottom_lightness (simple float) : (simple float) Optional argument, default = 70. Lightness Percentage. 100% is lightest and 0% is darkest
top_lightness (simple float) : (simple float) Optional argument, default = 30. Lightness Percentage. 100% is lightest and 0% is darkest
Returns: (series color) A color Computed a the linear "Lightness" gradient.
saturation_gradient(colour, value, bottom_value, top_value, bottom_saturated, top_saturated)
Determines a color from a "Saturation" gradient, based on the position of an entered value within a defined range.
Parameters:
colour (color) : (series color) Pure color.
value (float) : (series float) Value.
bottom_value (float) : (series float) Bottom Value.
top_value (float) : (series float) Top Value.
bottom_saturated (simple float) : (simple float) Optional argument, default = 15. Low Saturated Percentage.
top_saturated (simple float) : (simple float) Optional argument, default = 80. High Saturated Percentage.
Returns: (series color) A color Computed from a linear "Saturation" gradient.
hue_gradient(colour, value, bottom_value, top_value, bottom_hue, top_hue)
Determines a color from a "Hue" gradient, based on the position of an entered value within a defined range.
Parameters:
colour (color) : (series color) Pure color.
value (float) : (series float) Value.
bottom_value (float) : (series float) Bottom Value.
top_value (float) : (series float) Top Value.
bottom_hue (simple float) : (simple float) Optional argument, Default = 0. Low Hue is a degree where value in range 0 to 360 degrees.
top_hue (simple float) : (simple float) Optional argument, default = 300. High Hue is a degree where value in range 0 to 360 degrees.
Returns: (series color) A color Computed from a linear "Saturation" gradient.
opposColor(colour)
Generates the opposite color of inputted color.
Parameters:
colour (color) : (series color) Pure color.
Returns: (series color) An opposite color.
randColor(seed)
Generates a random color.
Parameters:
seed (simple int) : (simple int) Optional argument. With identifying seed, it will generate similar color sequence.
Returns: (series color) A random color.
bk_or_wh(colour, lightness)
Determines a white or back fits with an inputted color.
Parameters:
colour (color) : (series color) Pure color.
lightness (float) : (series float) Optional argument, default = 50. If the lightness percentage of inputted color is higher, the output is white; otherwise, it's black.
Returns: (series color) white or back color.
monochrome(colour, lightness, saturation)
Generates a monochromatic color scheme.
Parameters:
colour (color) : (series color) Pure color.
lightness (float) : (series float) Optional argument, default = NA. To custom Lightness percentage manually, 100% is lightest and 0% is darkest.
saturation (float) : (series float) Optional argument, default = NA. To custom Saturation percentage manually, 100% is highest and 0% is lowest saturated.
Returns: (tuple of two color series) .
complementary(colour)
Generates a complementary color scheme.
Parameters:
colour (color) : (series color) Pure color.
Returns: (tuple of two color series) .
analogous(colour)
Generates an analogous color scheme.
Parameters:
colour (color) : (series color) Pure color.
Returns: (tuple of three color series) .
triadic(colour)
Generates an Triadic color scheme.
Parameters:
colour (color) : (series color) Pure color.
Returns: (tuple of three color series) .
tetradic(colour)
Generates an Tetradic color scheme.
Parameters:
colour (color) : (series color) Main color.
Returns: (tuple of four color series) .
tst_scheme(colour, size, _type)
Generates an array of requested type (tint, shade, or tone) scheme colors.
Parameters:
colour (simple color) : (simple color) Pure color.
size (simple int) : (simple input) Number of elements in color array.
_type (simple string) : (simple string) Type of color scheme, possible input "tint", "shade", and "tone".
Returns: (simple array) An array contains elements of the requested type scheme colors.
lsh_scheme(colour, size, _type, topLevel, botLevel)
Generates an array of requested type (lightness, saturation or hue) scheme colors.
Parameters:
colour (simple color) : (simple color) Pure color.
size (simple int) : (simple input) Number of elements in color array.
_type (simple string) : (simple string) Type of color scheme, possible input "lightness", "saturation" and "hue".
topLevel (simple float) : (simple float) Optional argument, default = NA.
1. if "lightness", in a percentage where value in range 0 to 100, 100% lightest.
2. if "saturation", in a percentage where value in range 0 to 100, 100% highest saturated.
3. if "hue", in a degree where value in range 0 to 360 degrees.
botLevel (simple float) : (simple float) Optional argument, default = NA.
1. if "lightness", in a percentage where value in range 0 to 100, 0% darkest.
2. if "saturation", in a percentage where value in range 0 to 100, 0% lowest saturated.
3. if "hue", in a degree where value in range 0 to 360 degrees.
Returns: (simple array) An array contains elements of the requested type scheme colors.
display_color(colour, location)
Displays color including RGB and HSL.
Parameters:
colour (simple color) : (simple color) Pure color.
location (simple string) : (simple string) Optional argument, default = "top_right". cell location.
Returns: (simple table) A table cell contains RGB and HSL of entered color.
display_scheme(arrayColour, location)
Displays Scheme colors including RGB and HSL.
Parameters:
arrayColour (array)
location (simple string) : (simple string) Optional argument, default = "top_right". cell location.
Returns: (simple table) A table cells contain RGB and HSL of entered color.
TradersPost WebhookMessage Library - Automatically Build JSONLibrary "WebhookMessageLibrary"
The webhook message library provides several functions for building JSON payloads
method buildWebhookJson(msg, constants)
Builds the final JSON payload from a webhookMessage type.
Namespace types: webhookMessage
Parameters:
msg (webhookMessage) : (webhookMessage) A prepared webhookMessage.
constants (CONSTANTS)
Returns: A JSON Payload.
method buildTakeProfitJson(msg)
Builds the takeProfit JSON message to be used in a webhook message.
Namespace types: takeProfitMessage
Parameters:
msg (takeProfitMessage) : (takeProfitMessage)
Returns: A JSON takeProfit payload.
method buildStopLossJson(msg, constants)
Builds the stopLoss JSON message to be used in a webhook message.
Namespace types: stopLossMessage
Parameters:
msg (stopLossMessage) : (stopLossMessage)
constants (CONSTANTS)
Returns: A JSON stopLoss payload.
CONSTANTS
Constants for payload values.
Fields:
ACTION_BUY (series string)
ACTION_SELL (series string)
ACTION_EXIT (series string)
ACTION_CANCEL (series string)
ACTION_ADD (series string)
SENTIMENT_BULLISH (series string)
SENTIMENT_BEARISH (series string)
SENTIMENT_LONG (series string)
SENTIMENT_SHORT (series string)
SENTIMENT_FLAT (series string)
STOP_LOSS_TYPE_STOP (series string)
STOP_LOSS_TYPE_STOP_LIMIT (series string)
STOP_LOSS_TYPE_TRAILING_STOP (series string)
webhookMessage
Final webhook message.
Fields:
ticker (series string)
action (series string)
sentiment (series string)
price (series float)
quantity (series int)
takeProfit (series string)
stopLoss (series string)
takeProfitMessage
Take profit message.
Fields:
limitPrice (series float)
percent (series float)
amount (series float)
stopLossMessage
Stop loss message.
Fields:
type (series string)
percent (series float)
amount (series float)
stopPrice (series float)
limitPrice (series float)
trailPrice (series float)
trailPercent (series float)
EC_2025_Q4_ENLibrary "EC_2025_Q4_EN"
output2025()
Returns the list of events during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;;; ...
Where: is expressed as date + characteristics: YYYY,MM,DD,hh,mm,ss,x,y,z
x impact in numbers
y event name in numbers
z currency in numbers
name2025()
Returns the list of event names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, name
index: related to event name y
name event: event name related to y text
impact2025()
Returns the list of impact names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, impact
index: related to impact name x
impact: impact name related to x text
currency2025()
Returns the list of currencies during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, currency
index: related to currency name z
currency: currency name related to z text
EC_2025_Q3_ENLibrary "EC_2025_Q3_EN"
output2025()
Returns the list of events during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;;; ...
Where: is expressed as date + characteristics: YYYY,MM,DD,hh,mm,ss,x,y,z
x impact in numbers
y event name in numbers
z currency in numbers
name2025()
Returns the list of event names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, name
index: related to event name y
name event: event name related to y text
impact2025()
Returns the list of impact names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, impact
index: related to impact name x
impact: impact name related to x text
currency2025()
Returns the list of currencies during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, currency
index: related to currency name z
currency: currency name related to z text
EC_2025_Q2_ENLibrary "EC_2025_Q2_EN"
output2025()
Returns the list of events during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;;; ...
Where: is expressed as date + characteristics: YYYY,MM,DD,hh,mm,ss,x,y,z
x impact in numbers
y event name in numbers
z currency in numbers
name2025()
Returns the list of event names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, name
index: related to event name y
name event: event name related to y text
impact2025()
Returns the list of impact names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, impact
index: related to impact name x
impact: impact name related to x text
currency2025()
Returns the list of currencies during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, currency
index: related to currency name z
currency: currency name related to z text
EC_2025_Q1_ENLibrary "EC_2025_Q1_EN"
output2025()
Returns the list of events during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;;; ...
Where: is expressed as date + characteristics: YYYY,MM,DD,hh,mm,ss,x,y,z
x impact in numbers
y event name in numbers
z currency in numbers
name2025()
Returns the list of event names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, name
index: related to event name y
name event: event name related to y text
impact2025()
Returns the list of impact names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, impact
index: related to impact name x
impact: impact name related to x text
currency2025()
Returns the list of currencies during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, currency
index: related to currency name z
currency: currency name related to z text
EC_2025_Q4_SPLibrary "EC_2025_Q4_SP"
output2025()
Returns the list of events during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;;; ...
Where: is expressed as date + characteristics: YYYY,MM,DD,hh,mm,ss,x,y,z
x impact in numbers
y event name in numbers
z currency in numbers
name2025()
Returns the list of event names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, name
index: related to event name y
name event: event name related to y text
impact2025()
Returns the list of impact names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, impact
index: related to impact name x
impact: impact name related to x text
currency2025()
Returns the list of currencies during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, currency
index: related to currency name z
currency: currency name related to z text
EC_2025_Q3_SPLibrary "EC_2025_Q3_SP"
output2025()
Returns the list of events during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;;; ...
Where: is expressed as date + characteristics: YYYY,MM,DD,hh,mm,ss,x,y,z
x impact in numbers
y event name in numbers
z currency in numbers
name2025()
Returns the list of event names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, name
index: related to event name y
name event: event name related to y text
impact2025()
Returns the list of impact names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, impact
index: related to impact name x
impact: impact name related to x text
currency2025()
Returns the list of currencies during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, currency
index: related to currency name z
currency: currency name related to z text
EC_2025_Q2_SPLibrary "EC_2025_Q2_SP"
output2025()
Returns the list of events during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;;; ...
Where: is expressed as date + characteristics: YYYY,MM,DD,hh,mm,ss,x,y,z
x impact in numbers
y event name in numbers
z currency in numbers
name2025()
Returns the list of event names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, name
index: related to event name y
name event: event name related to y text
impact2025()
Returns the list of impact names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, impact
index: related to impact name x
impact: impact name related to x text
currency2025()
Returns the list of currencies during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, currency
index: related to currency name z
currency: currency name related to z text
EC_2025_Q1_SPLibrary "EC_2025_Q1_SP"
output2025()
Returns the list of events during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;;; ...
Where: is expressed as date + characteristics: YYYY,MM,DD,hh,mm,ss,x,y,z
x impact in numbers
y event name in numbers
z currency in numbers
name2025()
Returns the list of event names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, name
index: related to event name y
name event: event name related to y text
impact2025()
Returns the list of impact names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, impact
index: related to impact name x
impact: impact name related to x text
currency2025()
Returns the list of currencies during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, currency
index: related to currency name z
currency: currency name related to z text
EC_2024_Q4_SPLibrary "EC_2024_Q4_SP"
output2024()
Returns the list of events during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;;; ...
Where: is expressed as date + characteristics: YYYY,MM,DD,hh,mm,ss,x,y,z
x impact in numbers
y event name in numbers
z currency in numbers
name2024()
Returns the list of event names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, name
index: related to event name y
name event: event name related to y text
impact2024()
Returns the list of impact names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, impact
index: related to impact name x
impact: impact name related to x text
currency2024()
Returns the list of currencies during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, currency
index: related to currency name z
currency: currency name related to z text
EC_2024_Q3_SPLibrary "EC_2024_Q3_SP"
output2024()
Returns the list of events during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;;; ...
Where: is expressed as date + characteristics: YYYY,MM,DD,hh,mm,ss,x,y,z
x impact in numbers
y event name in numbers
z currency in numbers
name2024()
Returns the list of event names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, name
index: related to event name y
name event: event name related to y text
impact2024()
Returns the list of impact names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, impact
index: related to impact name x
impact: impact name related to x text
currency2024()
Returns the list of currencies during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, currency
index: related to currency name z
currency: currency name related to z text
EC_2024_Q4_ENLibrary "EC_2024_Q4_EN"
output2024()
Returns the list of events during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;;; ...
Where: is expressed as date + characteristics: YYYY,MM,DD,hh,mm,ss,x,y,z
x impact in numbers
y event name in numbers
z currency in numbers
name2024()
Returns the list of event names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, name
index: related to event name y
name event: event name related to y text
impact2024()
Returns the list of impact names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, impact
index: related to impact name x
impact: impact name related to x text
currency2024()
Returns the list of currencies during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, currency
index: related to currency name z
currency: currency name related to z text
EC_2024_Q3_ENLibrary "EC_2024_Q3_EN"
output2024()
Returns the list of events during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;;; ...
Where: is expressed as date + characteristics: YYYY,MM,DD,hh,mm,ss,x,y,z
x impact in numbers
y event name in numbers
z currency in numbers
name2024()
Returns the list of event names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, name
index: related to event name y
name event: event name related to y text
impact2024()
Returns the list of impact names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, impact
index: related to impact name x
impact: impact name related to x text
currency2024()
Returns the list of currencies during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, currency
index: related to currency name z
currency: currency name related to z text
EC_2024_Q2_ENLibrary "EC_2024_Q2_EN"
output2024()
Returns the list of events during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;;; ...
Where: is expressed as date + characteristics: YYYY,MM,DD,hh,mm,ss,x,y,z
x impact in numbers
y event name in numbers
z currency in numbers
name2024()
Returns the list of event names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, name
index: related to event name y
name event: event name related to y text
impact2024()
Returns the list of impact names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, impact
index: related to impact name x
impact: impact name related to x text
currency2024()
Returns the list of currencies during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, currency
index: related to currency name z
currency: currency name related to z text
EC_2024_Q2_SPLibrary "EC_2024_Q2_SP"
output2024()
Returns the list of events during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;;; ...
Where: is expressed as date + characteristics: YYYY,MM,DD,hh,mm,ss,x,y,z
x impact in numbers
y event name in numbers
z currency in numbers
name2024()
Returns the list of event names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, name
index: related to event name y
name event: event name related to y text
impact2024()
Returns the list of impact names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, impact
index: related to impact name x
impact: impact name related to x text
currency2024()
Returns the list of currencies during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, currency
index: related to currency name z
currency: currency name related to z text
EC_2024_Q1_SPLibrary "EC_2024_Q1_SP"
output2024()
Returns the list of events during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;;; ...
Where: is expressed as date + characteristics: YYYY,MM,DD,hh,mm,ss,x,y,z
x impact in numbers
y event name in numbers
z currency in numbers
name2024()
Returns the list of event names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, name
index: related to event name y
name event: event name related to y text
impact2024()
Returns the list of impact names during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, impact
index: related to impact name x
impact: impact name related to x text
currency2024()
Returns the list of currencies during the period.
Returns: array: (week1,week2, ... week_n)
week_n= ;; ...
Where: is expressed as: index, currency
index: related to currency name z
currency: currency name related to z text