Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include new chart indicators #110

Open
10 of 15 tasks
rodrigo-brito opened this issue Mar 19, 2022 · 2 comments
Open
10 of 15 tasks

Include new chart indicators #110

rodrigo-brito opened this issue Mar 19, 2022 · 2 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@rodrigo-brito
Copy link
Owner

rodrigo-brito commented Mar 19, 2022

We can create and initialize indicators for chats in Ninjabot.

Example:

chart := plot.NewChart(plot.WithIndicators(
indicator.EMA(8, "red"),
indicator.EMA(21, "#000"),
indicator.RSI(14, "purple"),
indicator.Stoch(8, 3, "red", "blue"),
))

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

@rodrigo-brito rodrigo-brito added help wanted Extra attention is needed good first issue Good for newcomers labels Mar 19, 2022
@RobertKwiatkowski
Copy link
Contributor

RobertKwiatkowski commented Mar 19, 2022

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

@rodrigo-brito
Copy link
Owner Author

Hi @RobertKwiatkowski , exactly like ema.go. The format is very simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants