Rule-based · source-available · self-hosted

Momentum trading,
automated.

A Telegram bot that ranks configurable stock universes by three scientifically grounded momentum metrics and delivers clear buy and sell signals on your schedule. You decide what to do with them.

Source-available Self-hosted 5 languages 15 index presets 0 € · no subscription
FU FinanzUnity Bot online /run --- 🇩🇪 CDAX Top 8 --- --- as of 2026-05-23 --- RANK TICKER SMA Δ-SMA 52W-HTR AVG 1 R3NK.DE 1.412 +18.3 42.18 12.3 2 RHM.DE 1.387 +16.9 38.74 14.7 3 HAG.DE 1.291 +14.1 33.06 18.0 4 SAP.DE 1.224 +11.8 28.91 22.3 +4 more 📋 Portfolio changes ✅ HOLD 12 📥 BUY 3 📤 SELL 3 📥 BUY - ALV.DE Allianz SE rank 7/612 (was 195) - MUV2.DE Munich Re rank 8/612 (was 47) 📤 SELL - TSLA Tesla rank 38/100 (threshold 30) 🔄 Next run: 2026-05-30 · 10:00 delivered · 12:00 ✓✓
Simple. Rule-based. Automatic.

Three metrics.
One ranking. Your call.

FinanzUnity Momentum is a self-hosted Telegram bot that applies a scientifically grounded strategy automatically. Instead of analysing hundreds of stocks by hand every week, the bot does the work: it fetches current prices, computes three momentum metrics, builds a ranking, and sends you concrete buy and sell signals to your phone.

The strategy rests on the research of Jegadeesh and Titman (1993) — one of the most cited papers in quantitative finance. What is scientifically established usually fails in practice for one reason only: discipline. That is exactly what the bot supplies.

What the bot delivers

Wherever you stand — the bot supplies the discipline.

Three core capabilities — all controlled directly from Telegram. No SSH, no web interface, no cloud dependency.

01.

Scheduled live analysis

  • Fetches current prices from Yahoo Finance
  • Computes all three momentum metrics
  • Sends top lists + trade signals via Telegram
  • Daily, weekly or monthly — freely chosen
02.

Full backtest

  • Simulate the strategy across any period
  • Incl. German taxes, fees, slippage
  • CAGR, Sharpe, Sortino, Calmar, max drawdown
  • Equity chart as PNG straight to Telegram
03.

Portfolio tracking

  • Enter buy prices and share counts interactively
  • Bot computes P/L, daily change, rank position
  • Multiple portfolios per instance
  • CSV export for your own analysis
184
Unit tests
15
Index presets
5
Languages
0 €
Running cost
The strategy in detail

Three metrics, one Final Rank.

The bot combines three independent momentum indicators. Each measures a different facet of "strength" — together they give a more robust picture than any single indicator alone. The formulas below appear verbatim in the source code (shared.py, function compute_ticker_metrics).

1

SMA-Ratio

Trend strength

sma_ratio =
  ((sma20 / sma200) - 1) * 100

How far does the 20-day average sit above the 200-day average? The higher, the stronger the current upward momentum.

2

Delta-SMA

Trend acceleration

delta_sma =
  ((sma200 / sma200_prev20) - 1) * 100

Is the long-term trend itself still rising? When the 200-day line has already turned down, that is an early warning signal.

3

52-Week-HTR

Relative strength

ratio_52whtr =
  ((P/high - 1) +
  (P/low - 1) * 0.25) * 100

How close is the stock to its 52-week high and how far above the low? Clearly favours proximity to the high — an established signal.

The Final Rank

For each stock the three metrics are computed, ranked separately within the universe (Rank 1 = best value), and the average of the three ranks forms the Final Rank:

Final Rank = (Rank_SMA + Rank_Delta + Rank_HTR) / 3

The portfolio then holds the Top N per universe — N is freely configurable per universe. Defaults are top_n=8 for CDAX and top_n=7 for NASDAQ. Stocks that fall out of the Top N are sold, climbers are bought.

💡 At the core

After every scheduled run you get a Telegram message with the top positions and concrete buy/sell recommendations. Out of the box, CDAX and NASDAQ-100 are active. Thirteen further indices — DAX, MDAX, SDAX, TecDAX, Euro Stoxx 50, Stoxx Europe 600, CAC 40, ATX, SMI, FTSE 100, Dow Jones, S&P 500, Nikkei 225 — are pre-configured and activatable via copy-paste.

Who is the bot built for?

Honest upfront: is this for you?

A fit, if …

  • You want a rule-based strategy instead of gut decisions
  • You invest mid-term (≥6 month horizon)
  • You have a Linux server, Raspberry Pi or NAS
  • You want to understand and adapt the strategy yourself
  • You value privacy and don't want a third-party cloud service
  • You want to trade autonomously — no bot guardian

Not a fit, if …

  • You want to day-trade (shortest cycle: daily)
  • You need a bot that executes orders directly
  • You expect guaranteed returns (none exist — not here either)
  • You don't want to touch anything technical
  • You're looking for a drawdown-free strategy
  • You don't use Telegram and don't want to
Capabilities

Everything included. No upsell.

Full source code, commented configuration, German and English documentation, service scripts for every OS, 184 unit tests, backtest engine with German tax handling.

  • Scheduler — run daily, weekly or monthly automatically. Day and time configurable via Telegram.
  • 5 languages — German, English, French, Spanish, Italian. Language picker on first start.
  • Multi-instance — multiple independent configs on one server (e.g. one per family member).
  • Config editor in Telegram — every parameter adjustable via buttons — no SSH or file editing.
  • Usage statistics — install age, signals, distinct tickers, cache size, open positions.
  • GDPR-compliant — plain-text privacy notice on first start, full documentation.
  • 184 unit tests — the math-critical core functions are covered.
  • Smoke test./check_install.sh verifies Python, dependencies, Telegram and Yahoo reachability in ~10 seconds.
  • Backtest sanity check — automatic warning at CAGR > 100% with explanation. Protects against unrealistic expectations.
  • Robust data pipeline — Parquet cache, rate-limit handling, auto-repair on Yahoo errors.
  • Auto config migration — old configs are migrated, backup is created before every migration.
  • Service installer — Linux (systemd), macOS (launchd), Windows (Task Scheduler). Double-click setup.
  • Demo modepython demo.py runs live + 5-year backtest without Telegram setup.
  • Zero telemetry — no "phone home". No activation. No account. Verifiable in code.
Market coverage

15 indices across five regions — all preconfigured.

Activate whatever you want to track via copy-paste. Custom indices from OnVista can be added with just one ID.

🇩🇪
CDAX Default
~600 stocks
🇩🇪
DAX
40 blue chips
🇩🇪
MDAX
50 mid caps
🇩🇪
SDAX
70 small caps
🇩🇪
TecDAX
30 tech
🇪🇺
EuroStoxx 50
50 EU blue chips
🇪🇺
Stoxx 600
~600 stocks
🇫🇷
CAC 40
40 France
🇦🇹
ATX
20 Austria
🇨🇭
SMI
20 Switzerland · CHF
🇬🇧
FTSE 100
100 UK · GBP
🇺🇸
Dow Jones
30 US blue chips
🇺🇸
NASDAQ 100 Default
100 US tech
🇺🇸
S&P 500
500 US large caps
🇯🇵
Nikkei 225
225 Japan · JPY
Setup

Up and running in 5 minutes.

What you need: a machine (Linux, macOS or Windows), Python 3.10+, a Telegram account and a few minutes. Runs on Raspberry Pi, MacBook, desktop PC, VPS — anything works.

01

Unpack archive, create venv, install

Requires Python 3.10+. A virtual environment (venv) is recommended — keeps the bot's dependencies cleanly isolated from system Python.

tar -xzf finanzunity-momentum-1.0.0.tar.gz
cd finanzunity-momentum-1.0.0

python3 -m venv venv
source venv/bin/activate            # macOS/Linux
# or on Windows:
# venv\Scripts\activate

pip install -r requirements.txt

Verify the install — checks Python version, dependencies and Telegram + Yahoo Finance reachability in ~10 seconds:

./check_install.sh
🎯 Just want to try it — without Telegram setup?

From here (venv active, dependencies installed) python demo.py is enough — runs a live analysis and a 5-year backtest against CDAX + NASDAQ 100 and prints everything to the console. No token, no chat ID, no commitment. Sample outputs are also available in the examples/ folder as text files. Anyone who wants the bot in Telegram continues with step 2.

02

Create the Telegram bot (BotFather)

In Telegram, search for @BotFather, send /newbot and follow the instructions — pick a name and handle. BotFather sends you a bot token (looks like 123456789:ABCdef-...) — keep it safe.

💡 In a group instead of private chat

You can also invite the bot to a Telegram group; find_chat_id.py in the next step will then return the group chat ID (a negative number like -1001234567890). All bot output then goes to the group instead of the private chat — handy for family setups.

03

Find the chat ID

Now — with the venv active — run the helper script:

python find_chat_id.py

Enter the token, then send any message to your bot in Telegram ("hi" will do). The script prints the chat ID and user ID right away — ready to drop into config.json.

04

Configuration — interactive wizard

In four steps (token → chat ID → universes → schedule) instances/default/config.json is created for you:

python setup_wizard.py

Validates token format and chat ID before saving. Alternative for JSON pros:

python bot.py                                       # creates config.example.json
cp instances/default/config.example.json instances/default/config.json
nano instances/default/config.json                  # set token + chat ID
05

Start the bot

python bot.py

Done. The bot is running. On the very first start the language picker appears in Telegram automatically — pick your language, and from then on every reply will be in it. /ping gives you a "Pong" response with diagnostic info anytime.

💡 24/7 operation — service installer

sudo bash install_service.sh (Linux/systemd) · bash install_service_mac.command (macOS/launchd) · install_service_windows.bat (Windows/Task Scheduler). Auto-start at boot/login, auto-restart on crashes.

Backtest engine

Validate the strategy against history.

Before you invest real money, you can replay the strategy across any historical period — directly from the Telegram bot.

/backtest 2020-01-01 2024-12-31 100000

After a few minutes you get back:

  • Performance metrics — total return, CAGR, Sharpe, Sortino, Calmar, max drawdown
  • Trade analytics — win rate, profit factor, avg gain, avg loss, avg holding period
  • Equity-curve chart — with four benchmark comparisons (MSCI World, S&P 500, NASDAQ 100, DAX)
  • German taxes — capital gains tax + solidarity surcharge + optional church tax built in
  • Full trade list — every simulated transaction with prices and share counts
⚠️ A note on significance

Backtest results are useful to check the plausibility of a strategy — they are not a guarantee of future returns. Past performance was attractive for thousands of strategies that later failed. Backtests show how the strategy would have run in the past. No more than that.

⚠️ Survivorship bias

By default the backtest uses the current composition of the universes — survivorship bias is therefore baked in. Starting with version 1.0, the bot automatically builds a historical index database. After some months of operation, with USE_HISTORICAL_UNIVERSES: true, the historically correct composition can be used — that reduces the bias substantially.

Security & privacy

Your data. Your server. Your control.

The bot is built from the ground up so that you stay in control. No account, no activation, no hidden storage paths.

No broker access

The bot stores no login credentials for banks or brokers and executes no real orders. You get the signals — the trading is on you.

Whitelisting

Only your own Telegram user may control the bot. Other users see only a "not authorised" message with their user ID.

Local storage

Portfolio, price data, logs all live on your server. Nothing is sent to external services other than Yahoo Finance, Telegram and OnVista.

Zero telemetry

The bot reports no installations, no usage, no errors and no crash dumps back to FinanzUnity. No account, no activation, no "phone home".

GDPR-compliant

A privacy notice is shown in plain text on first start. Full documentation in PRIVACY.md. Deleting data = deleting the directory.

Openly verifiable

The entire Python source code lies open. You can trace what happens, when, at any time. Bot tokens are protected against accidental Telegram leakage.

FAQ

Frequently asked questions.

With the defaults (8 + 7 = 15 positions across two universes), it makes sense from roughly € 15,000–20,000. Below that, fees dominate returns. With fewer positions (lower top_n) it also works from about € 8,000 — diversification then suffers.

A Raspberry Pi 4 (4 GB RAM) is fully sufficient. Any small VPS from ~€ 3/month also works. The bot uses practically nothing at idle; only during a live analysis or backtest does CPU load spike briefly.

15 indices are pre-configured: CDAX and NASDAQ 100 as defaults, plus DAX, MDAX, SDAX, TecDAX, Euro Stoxx 50, Stoxx Europe 600, CAC 40, ATX, SMI, FTSE 100, Dow Jones, S&P 500, Nikkei 225 as copy-paste snippets in docs/UNIVERSES.md. Any other OnVista-listed index works with a single ID — no code changes needed.

The bot has a local Parquet cache and automatically retries on errors. During longer Yahoo outages, the analysis is skipped and you get a notification. The next run continues normally.

Unpack the new archive, move the old instances/ directory over, swap directories — done. Your config, portfolio and price cache survive the upgrade unchanged.

Nothing — no subscription, no API fees. Yahoo Finance is free, Telegram is free. If you rent a VPS, ~€ 3–5/month is added. On your own Raspberry Pi essentially only the electricity.

The tool grew over years for personal use and is made available free of charge — as a contribution to the community of private investors who want to apply their momentum strategy systematically. A paid variant with commercial licence, white-label or enterprise deployment is available on request.

No. The source code is inspectable, but not Open Source in the classical sense. The licence permits use for your own private or business purposes — not redistribution, resale or offering as a SaaS service. Full details see LICENSE.

As the bot is free, there is no guaranteed support response time. If needed, email contact is available at hello@finanzunity.de. The documentation in docs/ and the 184 unit tests are designed to let most questions be solved without external help.

Yes, via multiple instances. Each instance has its own Telegram bot, its own config and its own portfolio. Practical when e.g. you and your partner each want to run a separate strategy. The price cache can be shared between instances.
FinanzUnity Momentum v1.0

Download for free now.

Full package, full source code, commented configuration, German and English documentation, service scripts for every platform, 184 unit tests, backtest engine with German tax handling.

FinanzUnity Momentum v1.0.0 Python project · source · tests · docs
Stable
Verify integrity: SHA-256 checksum
Instant download · no account · no payment · proprietary licence
In the package Python project
Integrity SHA-256 checksum for verification
Documentation README, developer docs, FAQ — DE & EN