Library "Punchline_Lib"
roundSmart(_value)
Truncates decimal points of a float value based on the amount of digits before the decimal point
Parameters:
_value (float)
Returns: float
fRound(_sample, _precision)
Returns a factor for rounding based on a sample input and a desired precision
Parameters:
_sample (float)
_precision (string)
Returns: float
get_exchangeRate(_base, _exchangeRate)
Returns a suggestion for an excgabge rate based on the base currency provided as an input to the function
Parameters:
_base (string)
_exchangeRate (float)
Returns: float
get_retracement(_high, _low, _pct_01, _pct_02, _pct_03, _pct_04, _pct_05, _pct_06, _pct_07, _pct_08, _pct_09, _pct_10)
Calculates up to 10 retracements in one go
Parameters:
_high (float)
_low (float)
_pct_01 (float)
_pct_02 (float)
_pct_03 (float)
_pct_04 (float)
_pct_05 (float)
_pct_06 (float)
_pct_07 (float)
_pct_08 (float)
_pct_09 (float)
_pct_10 (float)
Returns: array of retracement values
tostring_smart(_value)
converts a float to a string, intelligently cutting off decimal points
Parameters:
_value (float)
Returns: string
string_to_array_float(_string, _separator, _defVal)
converts a string into an array of floats
Parameters:
_string (string)
_separator (string)
_defVal (float)
Returns: array of floats
floats_to_array_of_20(f01, f02, f03, f04, f05, f06, f07, f08, f09, f10, f11, f12, f13, f14, f15, f16, f17, f18, f19, f20)
pushes 20 floats into an array and returns the array
Parameters:
f01 (float)
f02 (float)
f03 (float)
f04 (float)
f05 (float)
f06 (float)
f07 (float)
f08 (float)
f09 (float)
f10 (float)
f11 (float)
f12 (float)
f13 (float)
f14 (float)
f15 (float)
f16 (float)
f17 (float)
f18 (float)
f19 (float)
f20 (float)
Returns: array of floats
ints_to_array_of_20(i01, i02, i03, i04, i05, i06, i07, i08, i09, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20)
pushes 20 ints into an array and returns the array
Parameters:
i01 (int)
i02 (int)
i03 (int)
i04 (int)
i05 (int)
i06 (int)
i07 (int)
i08 (int)
i09 (int)
i10 (int)
i11 (int)
i12 (int)
i13 (int)
i14 (int)
i15 (int)
i16 (int)
i17 (int)
i18 (int)
i19 (int)
i20 (int)
Returns: array of ints
fillCell(_table, _column, _row, _value, _text)
Create a table cell based on params handed over
Parameters:
_table (table)
_column (int)
_row (int)
_value (float)
_text (string)
Returns: table.cell
size(_size)
Converts a string into a label size
Parameters:
_size (string)
Returns: size
position(_position)
Converts a string into a position
Parameters:
_position (string)
Returns: position
pivotFound(_dev, _isHigh, _index, _price, _color, _width, _prev_pivot_is_a_high, _lineLast, _linesCount, _devThreshold, _iLast, _pLast)
draws a line from previous pivot to next pivot
Parameters:
_dev (float)
_isHigh (bool)
_index (int)
_price (float)
_color (color)
_width (int)
_prev_pivot_is_a_high (bool)
_lineLast (line)
_linesCount (int)
_devThreshold (float)
_iLast (int)
_pLast (float)
Returns: [line, bool, bool] new line (if any), high (or no high), true if new pivot is significant according to allowed deviation threshold
get_pivots(_depth)
detects high and low pivots in a series of values
Parameters:
_depth (int)
Returns: [int, float, int, float] bar index of high pivot, high pivot, bar index of low pivot, low pivot
get_ma(_type, _src, _len, _fastLength, _slowLength, _prev_maVal, _offset, _sigma)
Gets a Moving Average based on type and source
Parameters:
_type (string)
_src (float)
_len (simple int)
_fastLength (int)
_slowLength (int)
_prev_maVal (float)
_offset (simple float)
_sigma (simple int)
Returns: A moving average with the given parameters
get_ema_ohlc(_o, _h, _l, _c, _length)
calculates EMA for 4 values based on _length. Ideal in with security call
Parameters:
_o (float)
_h (float)
_l (float)
_c (float)
_length (simple float)
Returns: [float, float, float, float]
jma(_length, _phase, _power)
calculates Jurik Moving Average
Parameters:
_length (int)
_phase (int)
_power (int)
Returns: float
getRatio_singleCandle(_index)
get ratio between current candle and candle[index]
Parameters:
_index (int)
Returns: float difference in size between current and selected candle
adx(_dilen, _adxlen)
calculates ADX for specified Legnth and Smoothing
Parameters:
_dilen (simple int)
_adxlen (simple int)
Returns: float
highestHigh_lowestLow(_h, _l, _c, _length)
calculates Highest High and lowest low within a specified length
Parameters:
_h (float)
_l (float)
_c (float)
_length (int)
Returns: [float, float, float, float]
imc(_conversionPeriods, _basePeriods, _laggingSpan2Periods)
creates values for the Ichimoku Cloud
Parameters:
_conversionPeriods (int)
_basePeriods (int)
_laggingSpan2Periods (int)
Returns: [float, float, float, float]
williamFractal(_periods)
Calculates William Fractals.
Parameters:
_periods (int)
Returns: [bool, bool]