(ATR permno n prev-atr)Average true range over n days, Wilder-smoothed from prev-atr. The true
range is the largest of high-low, |high-previous close| and
|low-previous close|; without a previous close it is high-low.
Additional columns needed: BIDLO, ASKHI
Average true range over n days, Wilder-smoothed from `prev-atr`. The true range is the largest of high-low, |high-previous close| and |low-previous close|; without a previous close it is high-low. Additional columns needed: BIDLO, ASKHI
(avg list)This function returns the mean of the list
This function returns the mean of the list
(EMA permno)Get stable EMA of a security today.
Get stable EMA of a security today.
(keltner-channel permno window prev-atr)[middle upper lower]: the EMA with bands two ATRs either side.
[middle upper lower]: the EMA with bands two ATRs either side.
(MACD permno)Returns [MACD signal short-EMA long-EMA] for a security today. MACD is the MACD-SHORT-day EMA of the price minus the MACD-LONG-day EMA; the signal line is the MACD-SIGNAL-day EMA of MACD, seeded with the mean of its first MACD-SIGNAL values. nil until then: with the defaults, the first value comes on the 34th close (26 for the long EMA, then 9 MACD values).
Returns [MACD signal short-EMA long-EMA] for a security today. MACD is the MACD-SHORT-day EMA of the price minus the MACD-LONG-day EMA; the signal line is the MACD-SIGNAL-day EMA of MACD, seeded with the mean of its first MACD-SIGNAL values. nil until then: with the defaults, the first value comes on the 34th close (26 for the long EMA, then 9 MACD values).
(MACD-generator signal short long)Returns a function of permno like MACD but with its own cycles.
Generators with the same cycles share one function and its state.
Returns a function of permno like `MACD` but with its own cycles. Generators with the same cycles share one function and its state.
(moving-avg permno n)Simple moving average of the last n closes, or nil unless all n are available.
Simple moving average of the last n closes, or nil unless all n are available.
(moving-sd permno n)Sample standard deviation of the last n closes, or nil unless all n are available.
Sample standard deviation of the last n closes, or nil unless all n are available.
(parabolic-SAR permno state)Wilder's parabolic stop-and-reverse for permno, one trading day per
call. state is the map returned by the previous call, or nil on the
first day, when the trend is read from today's close against the
previous one. Returns {:sar :trend :ep :af}: the stop level, :up or
:down, the extreme point of the current trend, and the acceleration
factor, which grows by SAR-AF-STEP on every new extreme up to SAR-AF-MAX.
In an up trend the stop never rises above the previous two lows, and the
mirror image holds in a down trend.
Additional columns needed: BIDLO, ASKHI
Wilder's parabolic stop-and-reverse for `permno`, one trading day per
call. `state` is the map returned by the previous call, or nil on the
first day, when the trend is read from today's close against the
previous one. Returns {:sar :trend :ep :af}: the stop level, :up or
:down, the extreme point of the current trend, and the acceleration
factor, which grows by SAR-AF-STEP on every new extreme up to SAR-AF-MAX.
In an up trend the stop never rises above the previous two lows, and the
mirror image holds in a down trend.
Additional columns needed: BIDLO, ASKHI(ROC permno n)Returns the rate of change (ROC) over the last n trading days as a decimal, or nil when fewer than n earlier days exist or either price is missing. @n should be greater than 0
Returns the rate of change (ROC) over the last n trading days as a decimal, or nil when fewer than n earlier days exist or either price is missing. @n should be greater than 0
(RS permno n)Returns [average-gain average-loss] over the past n days (n prices, n-1 changes), the seed for Wilder's RSI smoothing. nil unless all n prices are available. @n should be greater than 1
Returns [average-gain average-loss] over the past n days (n prices, n-1 changes), the seed for Wilder's RSI smoothing. nil unless all n prices are available. @n should be greater than 1
(RSI permno)Returns the Relative Strength Index (RSI) over RSI-CYCLE days, seeded with the simple average gain and loss and then Wilder-smoothed day by day. Through days without a price it keeps its last value; the change across the gap counts as one day's change.
Returns the Relative Strength Index (RSI) over RSI-CYCLE days, seeded with the simple average gain and loss and then Wilder-smoothed day by day. Through days without a price it keeps its last value; the change across the gap counts as one day's change.
(RSI-generator size)Returns a function of permno like RSI but with cycle size.
Returns a function of permno like `RSI` but with cycle `size`.
(sd list)This function returns the s.d. of the list
This function returns the s.d. of the list
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |