Extending OctoBot Trading and Analysis Modules with Tentacles
Summary
This documentation explains how OctoBot extensions, called tentacles, add or modify analytical and trading functions. Tentacles can provide technical or social evaluators, interpret strategy signals, create and manage orders, support interfaces and notifications, read or write backtest data, and handle exchange-specific behavior. The page assumes a working OctoBot development environment and describes packaging an extension as part of a tentacle package.
Its recommended workflow is to use an existing tentacle as a template, subclass its implementation, and override only the methods that need to change. The examples show adapting a Reddit evaluator’s sentiment calculation and changing a strategy evaluator’s asynchronous callback, storing a computed evaluation and notifying trading modes when it is ready. These examples explain software structure rather than trading performance. They do not specify how to design or validate a profitable signal, and the code depends on OctoBot’s framework interfaces.
Key ideas
- OctoBot tentacles extend analysis, strategy evaluation, order handling, interfaces, backtest data support, and exchange behavior.
- A tentacle is distributed as part of a tentacle package and requires a configured developer environment.
- An existing tentacle can serve as a template, with subclassing and method overrides used to change selected behavior.
- Evaluator extensions can add custom social sentiment or strategy logic and publish completed evaluations to trading modes.
- The documentation describes implementation patterns, not evidence that any resulting strategy is profitable.
Tags
Full text
# Tentacle development
---
title: "Create a tentacle"
description: "Create your own OctoBot tentacles (aka extensions). Add technical and social analysis tools, improve the web, telegram interfaces, fix exchange connections."
sidebar_position: 6
---
# Tentacle development
## Tentacles
This page covers tentacle development. A working [Octobot developer environment](/developers/environment/setup-your-environment) is required to create a tentacle.
A tentacle is part of a [tentacle package](create-a-tentacle-package)
and defines a tool for OctoBot such as a way to analyse moving averages, listen
to reddit or create grid-like orders.
OctoBot uses tentacles to handle:
* Price technical analysis \(moving averages, RSI, MACD, ...\)
* Social analysis \(Telegram, Reddit and Google\)
* Evaluator signals interpretations \(strategies\)
* Orders creation and followup \(trading modes\)
* User interfaces and notifications \(web, telegram\)
* [Backtesting](/guides/octobot-usage/backtesting) data files reading and writing \(.data\)
* Exchanges fixes \(to handle exchange specific behaviors\)
There is no limit to the things OctoBot can handle: everything that can be
coded can be used by OctoBot through a tentacle. It is possible to create a
new tentacle to add a new tool to OctoBot or to build on an existing one and improve it.
## Developing a new Tentacle
The most efficient way to create a new tentacle is to build on top of an
existing one to add features to it. It is of course also possible to create
a new completely new tentacle.
To create a tentacle improving an existing one, all you need to do is to use
the existing tentacle folder as a template \(to create a
[tentacle package](create-a-tentacle-package)\) and extend the existing
tentacle you want to improve and re-implement the methods you want to change
in the package's python file.
Examples:
**RedditForumEvaluator** is a simple Reddit evaluator available by default
in `tentacles/Evaluator/Social/forum_evaluator/forum.py`. Let's say you want
to implement **SuperRedditForumEvaluator** which is a better Reddit evaluator.
Create the `tentacles/Evaluator/Social/super_forum_evaluator/`
[tentacle package](create-a-tentacle-package) based on
`tentacles/Evaluator/Social/forum_evaluator` and start coding the the python file.
```python
class SuperRedditForumEvaluator(Socials.RedditForumEvaluator):
# _get_sentiment is the RedditForumEvaluator method taking an entry and
# returning a number representing the "bullishness" of the entry.
# to change this part only, just redefine this method here
def _get_sentiment(self, entry):
# your new content
sentiment = 1
# some advanced entry analysis to set sentiment value
return sentiment
```
**SimpleStrategyEvaluator** is a strategy available by default in
`tentacles/Evaluator/Strategies/mixed_strategies_evaluator/mixed_strategies.py`.
Create the `tentacles/Evaluator/Social/super_simple_strategy_evaluator/`
[tentacle package](create-a-tentacle-package) based on
`tentacles/Evaluator/Strategies/mixed_strategies_evaluator` and start coding the the python file.
```python
class SuperSimpleStrategyEvaluator(SimpleStrategyEvaluator):
# _trigger_evaluation is the methods called when OctoBot is
# asking for a strategy evaluation
async def matrix_callback(self,
matrix_id,
evaluator_name,
evaluator_type,
eval_note,
eval_note_type,
exchange_name,
cryptocurrency,
symbol,
time_frame):
final_evaluation = 0
# some advanced computations to set final_evaluation value
# update self.eval_note to store the strategy result
self.eval_note = final_evaluation
# finally, call self.strategy_completed to notify that
# trading modes should wake up after this update
await self.strategy_completed(cryptocurrency, symbol)
```Shown in full with attribution under the source's licence. Licence: GPL-3.0
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.