Hi @g-gundam and all
I wish you an happy new year 2024 !
Just a post to let you know the status of the lib
Here is a table showing current status of indicators porting
Name | Description | Input | Output | Dependencies | Implementation status |
---|---|---|---|---|---|
AccuDist |
Accumulation and Distribution | - | |||
ADX |
Average Directional Index | ATR |
:heavy_exclamation_mark: Doesn’t work as expected - help wanted | ||
ALMA |
Arnaud Legoux Moving Average | CircBuff |
|||
AO |
Awesome Oscillator | SMA |
|||
Aroon |
Aroon Up/Down | - | :heavy_exclamation_mark: Doesn’t work as expected - help wanted (need to search in reversed list in order to get the right-most index) | ||
ATR |
Average True Range | CircBuff |
|||
BB |
Bollinger Bands | SMA , StdDev |
|||
BOP |
Balance Of Power | - | |||
CCI |
Commodity Channel Index | MeanDev |
|||
ChaikinOsc |
Chaikin Oscillator | AccuDist , EMA |
|||
ChandeKrollStop |
Chande Kroll Stop | CircBuff , ATR |
|||
CHOP |
Choppiness Index | CirBuff , ATR |
:heavy_exclamation_mark: Doesn’t work as expected - help wanted | ||
CoppockCurve |
Coppock Curve | ROC , WMA |
|||
DEMA |
Double Exponential Moving Average | EMA |
|||
DonchianChannels |
Donchian Channels | CircBuff |
|||
DPO |
Detrended Price Oscillator | CircBuff , SMA |
|||
EMA |
Exponential Moving Average | CircBuff |
|||
EMV |
Ease of Movement | CircBuff , SMA |
|||
FibRetracement |
Fibonacci Retracement | doesn’t look an indicator just a simple class with 236 382 5 618 786 values | |||
ForceIndex |
Force Index | prev input val, EMA |
|||
HMA |
Hull Moving Average | WMA |
|||
Ichimoku |
Ichimoku Clouds | CircBuff |
5 managed sequences unit tests doesn’t exists in reference implementation | ||
KAMA |
Kaufman’s Adaptive Moving Average | CircBuff |
|||
KeltnerChannels |
Keltner Channels | ATR , EMA with input_modifier to extract close value of a candle |
|||
KST |
Know Sure Thing | SMA |
:heavy_exclamation_mark: Doesn’t work as expected - help wanted | ||
KVO |
Klinger Volume Oscillator | EMA |
|||
MACD |
Moving Average Convergence Divergence | EMA |
|||
MassIndex |
Mass Index | EMA , CircBuff |
|||
McGinleyDynamic |
McGinley Dynamic | CircBuff |
|||
MeanDev |
Mean Deviation | CircBuff , SMA |
|||
OBV |
On Balance Volume | prev input val | |||
ParabolicSAR |
Parabolic Stop And Reverse | CirBuff |
|||
PivotsHL |
High/Low Pivots | - |
unit tests in reference implementation are missing. | ||
ROC |
Rate Of Change | CircBuff |
|||
RSI |
Relative Strength Index | CircBuff , SMMA |
|||
SFX |
SFX | ATR , StdDev , SMA and input_modifier (to extract close ) |
|||
SMA |
Simple Moving Average | CircBuff |
|||
SMMA |
Smoothed Moving Average | CircBuff |
|||
SOBV |
Smoothed On Balance Volume | OBV , SMA |
|||
STC |
Schaff Trend Cycle | MACD , Stoch with input_modifier (MACDVal->OHLCV and stoch_d->OHLCV), indicator chaining, MAFactory (default SMA ) |
|||
StdDev |
Standard Deviation | CircBuff |
|||
Stoch |
Stochastic | CircBuff , SMA |
|||
StochRSI |
Stochastic RSI | RSI , SMA |
|||
SuperTrend |
Super Trend | CircBuff , ATR |
:heavy_exclamation_mark: Doesn’t work as expected - help wanted | ||
T3 |
T3 Moving Average | EMA with indicator chaining and input filter |
|||
TEMA |
Triple Exponential Moving Average | EMA |
|||
TRIX |
TRIX | EMA , indicator chaining |
|||
TSI |
True Strength Index | EMA , indicator chaining |
|||
TTM |
TTM Squeeze | SMA , BB , DonchianChannels , KeltnerChannels and input_modifier to extract close value of a candle |
|||
UO |
Ultimate Oscillator | CircBuff |
|||
VTX |
Vortex Indicator | CircBuff , ATR |
:heavy_exclamation_mark: Doesn’t work as expected - help wanted | ||
VWAP |
Volume Weighted Average Price | - | |||
VWMA |
Volume Weighted Moving Average | CircBuff |
|||
WMA |
Weighted Moving Average | CircBuff |
|||
ZLEMA |
Zero Lag Exponential Moving Average | EMA |
We have now 52 technical indicators.
As you can see StochRSI
(and many others indicators have been) implemented.
We have now a mechanism for indicator chaining.
What is indicator chaining?
Indicator chaining is like using Lego blocks to create unique combinations. When you chain indicators together, output of one indicator is the input of the following indicator.
T3
for example is composed of 6 EMA
(Exponential Moving Average) which are chained
So by chaining them you can replace code like
function _calculate_new_value(ind::T3)
_ema1 = value(ind.ema1)
if !ismissing(_ema1)
fit!(ind.ema2, value(ind.ema1))
_ema2 = value(ind.ema2)
if !ismissing(_ema2)
fit!(ind.ema3, _ema2)
_ema3 = value(ind.ema3)
if !ismissing(_ema3)
fit!(ind.ema4, _ema3)
_ema4 = value(ind.ema4)
if !ismissing(_ema4)
fit!(ind.ema5, _ema4)
_ema5 = value(ind.ema5)
if !ismissing(_ema5)
fit!(ind.ema6, _ema5)
end
end
end
end
end
if has_output_value(ind.ema6)
return ind.c1 * value(ind.ema6) +
ind.c2 * value(ind.ema5) +
ind.c3 * value(ind.ema4) +
ind.c4 * value(ind.ema3)
else
return missing
end
end
by something much simpler such as
function _calculate_new_value(ind::T3)
if has_output_value(ind.ema6)
return ind.c1 * value(ind.ema6) +
ind.c2 * value(ind.ema5) +
ind.c3 * value(ind.ema4) +
ind.c4 * value(ind.ema3)
else
return missing
end
end
See T3 code
We also have now a input_filter/input_modifier functions for every indicators so we can for example feed a SISO indicator (single input single output) with candle data (OHLCV) when passing also an input_modifier function which take for example close price of a candle.
A good example of indicator which use such a mechanism is TTM
(probably the most complex indicator I have implemented currently)
https://school.stockcharts.com/doku.php?id=technical_indicators:ttm_squeeze
TTM
uses BB
(Bollinger Bands), DonchianChannels
, KeltnerChannels
and a moving average (SMA
by default but any other moving average can be used thanks to a moving average factory (MAFactory
))
See TTM Squeeze code
Here is status of unit tests
Precompiling project...
1 dependency successfully precompiled in 5 seconds. 45 already precompiled.
Testing Running tests...
┌ Warning: WIP - buggy
└ @ IncTA C:\Users\femto\.julia\dev\IncTA\src\indicators\KST.jl:72
┌ Warning: WIP - buggy
└ @ IncTA C:\Users\femto\.julia\dev\IncTA\src\indicators\CHOP.jl:32
┌ Warning: WIP - buggy
└ @ IncTA C:\Users\femto\.julia\dev\IncTA\src\indicators\ADX.jl:49
┌ Warning: WIP - buggy
└ @ IncTA C:\Users\femto\.julia\dev\IncTA\src\indicators\SuperTrend.jl:45
┌ Warning: WIP - buggy
└ @ IncTA C:\Users\femto\.julia\dev\IncTA\src\indicators\VTX.jl:39
┌ Warning: WIP - buggy
└ @ IncTA C:\Users\femto\.julia\dev\IncTA\src\indicators\Aroon.jl:31
Test Summary: | Pass Broken Total Time
IncTA.jl | 788 6 794 29.2s
Testing IncTA tests passed
So we still have some indicators which doesn’t behave like reference implementation (talipp
). I must admit that I haven’t searched quite a long time on each… but enough to lose patience.
If some of you want to have a look, PR are welcome ! I think a good way to fix this could be to install latest development version of talipp (v2.x) and do some “print debugging” on internal state of indicator
Doc also need to be improved (and published !).
This project is not really complex but very time consuming given the number of indicators which are reimplemented in pure Julia (contrary to TALib.j which was a wrapper around C library talib !
My hope will be to have this lib used by some others (especially those who are building backtesters)