Jesse offers the simplest to use, and the most number of technical indicators among all trading systems. Few of which are custom-made, and the rest are using the ta-libopen in new window or tulipopen in new window libraries which are open source and well-known.
You might stumble upon differences to other tools caused by the use of different indicator equations or memory. See hereopen in new window to learn more about memory of indicators. If you use a very big period you should increase the warm-up-candle amount to have enough candles and to account for the memory. You can always use other libraries directly of course, there might be speed differences though. See here for an explainationopen in new window.
The API has been designed to be the simplest yet flexible enough for all types of needs from developing strategies to doing research in Jupyter Notebooks.
To get started make sure the
indicators module is imported:
import jesse.indicators as ta
The first parameter of all indicators is
candles with the type of a Numpy array.
When developing strategies, usually all you care about is the indicator's value for the current candle. To get just that, simply pass
# give me SMA with period=8 for current candle: ta.sma(self.candles, 8)
To get indicator values for candles other than your trading route (in case you have defined more than one route in your
routes.py file), use
ta.sma(self.get_candles('Binance', 'BTC-USDT', '4h'), 8)
The return type of all indicators returning multiple values is a
namedtuple Python object. In case you're not familiar with the concept of
namedtuple in Python, it's just like a regular tuple but you can also use it as a class object.
For example here are two ways you could use the Bollinger Bands indicator, which as you know, returns three values:
- Use it as a normal tuple:
# as three variables upperband, middleband, lowerband = bollinger_bands(self.candles, period=20) # or you could fetch it as one tuple and retrieve values as you would from a tuple: bb = bollinger_bands(self.candles, period=20) bb # upperband bb # middleband bb # lowerband
- The second way it to use it as a class instance:
bb = bollinger_bands(self.candles, period=20) bb.upperband bb.middleband bb.lowerband