Indicator on indicator
#5
(10-31-2018, 09:26 AM)askmike Wrote: Can you be more specific?

The EMA indicator for example takes a single parameter which is called "price":

https://github.com/askmike/gekko/blob/de...EMA.js#L10

But you don't have to put in the candle close, you can put in the output of another indicator.

------

Another way to do what you want is to simply use the results of an indicator directly in the strategy. This is done by the StochRSI strategy for example:

https://github.com/askmike/gekko/blob/de...RSI.js#L48

Since calculating stoch is so simple we didn't wrap that into an indicator class. Keep in mind that indicators are just simple math equations, with Gekko you can run any javascript code on every new candle. You can implement it however you want, but a nice convention is to put indicator logic into an indicator class. If you want to do funky stuff like run an indicator over another indicator manually glue them together and don't use the `this.addIndicator` interface.

thanks a lot Heart
  Reply


Messages In This Thread
Indicator on indicator - by kmohammad - 10-22-2018, 03:45 PM
RE: Indicator on indicator - by cubit - 10-22-2018, 08:16 PM
RE: Indicator on indicator - by kmohammad - 10-27-2018, 07:21 AM
RE: Indicator on indicator - by askmike - 10-31-2018, 09:26 AM
RE: Indicator on indicator - by kmohammad - 11-18-2018, 09:40 AM

Forum Jump:


Users browsing this thread: