Liking cljdoc? Tell your friends :D

clojure-backtesting.indicators


ATRclj

(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
sourceraw docstring

avgclj

(avg list)

This function returns the mean of the list

This function returns the mean of the list
sourceraw docstring

EMAclj

(EMA permno)

Get stable EMA of a security today.

Get stable EMA of a security today.
sourceraw docstring

EMA-gen-funcsclj

source

EMA-gen-keysclj

source

EMA-gen-mapclj

source

EMA-gen-sizesclj

source

EMA-generatorclj

(EMA-generator size)
source

EMA-keysclj

source

EMA-mapclj

source

keltner-channelclj

(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.
sourceraw docstring

MACDclj

(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).
sourceraw docstring

MACD-generatorclj

(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.
sourceraw docstring

MACD-keysclj

source

MACD-mapclj

source

moving-avgclj

(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.
sourceraw docstring

moving-sdclj

(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.
sourceraw docstring

parabolic-SARclj

(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
sourceraw docstring

reset-indicator-mapsclj

(reset-indicator-maps)
source

ROCclj

(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
sourceraw docstring

RSclj

(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
sourceraw docstring

RS-keysclj

source

RS-mapclj

source

RSIclj

(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.
sourceraw docstring

RSI-gen-funcsclj

source

RSI-gen-keysclj

source

RSI-gen-mapclj

source

RSI-gen-sizesclj

source

RSI-generatorclj

(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`.
sourceraw docstring

sdclj

(sd list)

This function returns the s.d. of the list

This function returns the s.d. of the list
sourceraw docstring

update-daily-indicatorsclj

(update-daily-indicators)
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close