v3 Improved performance by exposing gap level to caller if needed. Opened up ability to use a different volatility value.
Added:
normalWithGap(len, maxDeviation, level, gapDays, spec, res, volatility) Returns the normal upper range of volatility and the normal gap value.
Parameters:
len: Number of bars to measure volatility.
maxDeviation: The limit of volatility before considered an outlier.
level: The amount of standard deviation after cleaning outliers to be considered within normal.
gapDays: The number of days in the past to measure overnight gap volaility.
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = '1440').
volatility: The value to use as a volatility measure. Default is (ta.tr) the "True Range".
Returns: [atr + stdev * level, Gap.normal(gapDays, spec, res)]
Updated:
normal(len, maxDeviation, level, gapDays, spec, res, volatility) Returns the normal upper range of volatility. Compensates for overnight gaps within a regular session.
Parameters:
len: Number of bars to measure volatility.
maxDeviation: The limit of volatility before considered an outlier.
level: The amount of standard deviation after cleaning outliers to be considered within normal.
gapDays: The number of days in the past to measure overnight gap volaility.
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = '1440').
volatility: The value to use as a volatility measure. Default is (ta.tr) the "True Range".
isNormal(len, maxDeviation, level, gapDays, spec, res, volatility) Returns true if the volatility (true range) is within normal levels. Compensates for overnight gaps within a regular session.
Parameters:
len: Number of bars to measure volatility.
maxDeviation: The limit of volatility before considered an outlier.
level: The amount of standard deviation after cleaning outliers to be considered within normal.
gapDays: The number of days in the past to measure overnight gap volaility.
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = '1440').
volatility: The value to use as a volatility measure. Default is (ta.tr) the "True Range".
severity(len, maxDeviation, level, gapDays, spec, res, volatility) Returns ratio of the current value to the normal value. Compensates for overnight gaps within a regular session.
Parameters:
len: Number of bars to measure volatility.
maxDeviation: The limit of volatility before considered an outlier.
level: The amount of standard deviation after cleaning outliers to be considered within normal.
gapDays: The number of days in the past to measure overnight gap volaility.
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = '1440').
volatility: The value to use as a volatility measure. Default is (ta.tr) the "True Range".
Removed:
current(len) Returns the current price adjusted volatitlity ratio.