Include new chart indicators
rodrigo-brito opened this issue · comments
We can create and initialize indicators for chats in Ninjabot.
Example:
ninjabot/examples/backtesting/main.go
Lines 58 to 63 in 516e750
A indicator is a simple struct that implements the follow interface:
type Indicator interface {
Name() string
Overlay() bool
Metrics() []IndicatorMetric
Load(dataframe *model.Dataframe)
}
Here, we have a simple example of Exponential Moving Average (EMA): https://github.com/rodrigo-brito/ninjabot/blob/516e75064107daf73495bf1d091b5dc1cba18c09/plot/indicator/ema.go
Indicators Roadmap
- Moving average (MA)
- Exponential moving average (EMA)
- Moving Average Convergence Divergence (MACD)
- Relative Strength Index (RSI)
- Percentage Price Oscillator (PPO)
- Parabolic SAR
- Average directional index
- Stochastic oscillator
- Bollinger bands
- Fibonacci retracement
- Williams Percent Range (%R)
- Commodity Channel Index (CCI)
- Ichimoku cloud
- On-Balance volume (OBV)
- Supertrend
Hi,
This looks very interesting since I'm a little bit interested in trading (stocks, but still) and relatively new to GO.
If I'm correct all I have to do is to create new file for dedicated indicator which would implement the Indicator
interface? Just similarly to the ema.go
? If that's right I can work with SMA
as it looks like the easiest one and then maybe tackle the harder indicators
Hi @RobertKwiatkowski , exactly like ema.go. The format is very simple.