DynamicFunctionsLibrary "DynamicFunctions"
Custom Dynamic functions that allow an adaptive calculation beginning from the first bar
RoC(src, period)
Dynamic RoC
Parameters:
src (float) : and period
Custom function to calculate the actual period considering non-na source values
period (int)
dynamicMedian(src, length)
Dynamic Median
Parameters:
src (float) : and length
length (int)
kernelRegression(src, bandwidth, kernel_type)
Dynamic Kernel Regression Calculation Uses either of the following inputs for kernel_type: Epanechnikov Logistic Wave
Parameters:
src (float)
bandwidth (int)
kernel_type (string)
waveCalculation(source, bandwidth, width)
Use together with kernelRegression function to get chart applicable band
Parameters:
source (float)
bandwidth (int)
width (float)
Rsi(src, length)
Dynamic RSI function
Parameters:
src (float)
length (int)
dynamicStdev(src, period)
Dynamic SD function
Parameters:
src (float)
period (int)
stdv_bands(src, length, mult)
Dynamic SD Bands
Parameters:
src (float)
length (int)
mult (float)
Returns: Basis, Positive SD, Negative SD
Adx(dilen, adxlen)
Dynamic ADX
Parameters:
dilen (int)
adxlen (int)
Returns: adx
Atr(length)
Dynamic ATR
Parameters:
length (int)
Returns: ATR
Macd(source, fastLength, slowLength, signalSmoothing)
Dynamic MACD
Parameters:
source (float)
fastLength (int)
slowLength (int)
signalSmoothing (int)
Returns: macdLine, signalLine, histogram
Dynamic
Dynamic Array Table (versatile display methods)Library "datTable"
Dynamic Array Table.... Configurable Shape/Size Table from Arrays
Allows for any data in any size combination of arrays to join together
with:
all possible orientations!
filling all cells contiguously and/or flipping at boundaries
vertical or horizontal rotation
x/y axis direction swapping
all types array inputs for data.
please notify of any bugs. thanks
init(_posit)
Get Table (otional gapping cells)
Parameters:
_posit : String or Int (1-9 3x3 grid L to R)
Returns: Table
coords()
Req'd coords Seperate for VARIP table, non-varip coords
add
Add arrays to display table. coords reset each calc
uses displaytable object, string titles, and color optional array, and second line optional data array.
Strategy PnL LibraryLibrary "Strategy_PnL_Library"
TODO: This is a library that helps you learn current pnl of open position and use it to create your own dynamic take profit or stop loss rules based on current level of your profit. It should only be used with strategies.
inTrade()
inTrade: Checks if a position is currently open.
Returns: bool: true for yes, false for no.
notInTrade()
inTrade: Checks if a position is currently open. Interchangeable with inTrade but just here for simple semantics.
Returns: bool: true for yes, false for no.
pnl()
pnl: Calculates current profit or loss of position after the commission. If the strategy is not in trade it will always return na.
Returns: float: Current Profit or Loss of position, positive values for profit, negative values for loss.
entryBars()
entryBars: Checks how many bars it's been since the entry of the position.
Returns: int: Returns a int of strategy entry bars back. Minimum value is always corrected to 1 to avoid lookback errors.
pnlvelocity()
pnlvelocity: Calculates the velocity of pnl by following the change in open profit compared to previous bar. If the strategy is not in trade it will always return na.
Returns: float: Returns a float value of pnl velocity.
pnlacc()
pnlacc: Calculates the acceleration of pnl by following the change in profit velocity compared to previous bar. If the strategy is not in trade it will always return na.
Returns: float: Returns a float value of pnl acceleration.
pnljerk()
pnljerk: Calculates the jerk of pnl by following the change in profit acceleration compared to previous bar. If the strategy is not in trade it will always return na.
Returns: float: Returns a float value of pnl jerk.
pnlhigh()
pnlhigh: Calculates the highest value the pnl has reached since the start of the current position. If the strategy is not in trade it will always return na.
Returns: float: Returns a float highest value the pnl has reached.
pnllow()
pnllow: Calculates the lowest value the pnl has reached since the start of the current position. If the strategy is not in trade it will always return na.
Returns: float: Returns a float lowest value the pnl has reached.
pnldev()
pnldev: Calculates the deviance of the pnl since the start of the current position. If the strategy is not in trade it will always return na.
Returns: float: Returns a float deviance value of the pnl.
pnlvar()
pnlvar: Calculates the variance value of the pnl since the start of the current position. If the strategy is not in trade it will always return na.
Returns: float: Returns a float variance value of the pnl.
pnlstdev()
pnlstdev: Calculates the stdev value of the pnl since the start of the current position. If the strategy is not in trade it will always return na.
Returns: float: Returns a float stdev value of the pnl.
pnlmedian()
pnlmedian: Calculates the median value of the pnl since the start of the current position. If the strategy is not in trade it will always return na.
Returns: float: Returns a float median value of the pnl.
EchoMorphicAverageLibrary "EchoMorphicAverage"
Original Self Referencing Moving Average which references
it's own output agsainst itself and the incoming source to dynamically
alter smoothness and length internally per calculation cycle.
@kaigouthro
Inputs are float length series.
Contact Me for More Dynamic Float Length Indicators.
wema(src, mod, len)
Waited Echo-Morphic Average
Parameters:
src : (float) input value
mod : (float) modifier(0-1) mix of current value
len : (float) length
Returns: output processed smoothed value
wemaStack(src, mod, len)
Stacked Multipass Waited Echo-Morphic Average
Parameters:
src : (float) input value
mod : (float) modifier(0-1) mix of current value
len : (float) length
Returns: output processed smoothed value
Adaptive_LengthLibrary "Adaptive_Length"
This library contains functions to calculate Adaptive dynamic length which can be used in Moving Averages and other indicators.
Two Exponential Moving Averages (EMA) are plotted. Coloring in plot is derived from Chikou filter and Dynamic length of MA1 is adapted using Signal output from Chikou library.
dynamic(para, adapt_Pct, minLength, maxLength) Adaptive dynamic length based on boolean parameter
Parameters:
para : Boolean parameter; if true then length would decrease and would increase if its false
adapt_Pct : Percentage adaption based on parameter
minLength : Minimum allowable length
maxLength : Maximum allowable length
Returns: Adaptive Dynamic Length based on Boolean Parameter
auto_alpha(src, a) Adaptive length based on automatic alpha calculations from source input
Parameters:
src : Price source for alpha calculations
a : Input Alpha value
Returns: Adaptive Length calculated from input price Source and Alpha