11-18-2018, 09:40 AM
(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