TP/SL Engine

Stop, target and size for any Binance perp, in Telegram.

1 tapFrom launch to a full trade plan

01Problem

Every entry meant a calculator and a guess

The client trades perpetual futures and worked out the stop, the target and the position size by hand before every entry. Stops sat at round percentages rather than where the market actually turns, and leverage was picked without seeing where liquidation sat against the stop.

The goal: a complete trade plan in seconds, right in Telegram, with every level placed for a reason and the position sized to a fixed risk.

02Solution

Pick a coin and a side, get the plan

A Telegram Mini App. Choose a coin and tap Long or Short, and the plan appears: stop, target, size and leverage, each level with a one-line reason and copy buttons with plain digits for the exchange.

The levels come from live Binance Futures data. The stop goes just beyond the nearest swing with an ATR buffer against wicks, and past a liquidation cluster if one sits right behind it; the target is set by R:R. The plan warns when liquidation would come before the stop, or when fees eat too much of the risk.

03Build

From calculator to backtested planner

One shared core holds all the trading math, covered by tests, and both the mini app and the server use it.

  1. Live calculator on real data

    Levels from ATR(14) on real Binance data, the position sized to the account's risk %, and an interactive chart with live candles. Leverage shows margin, liquidation price and ROE, with the range where liquidation comes before the stop shaded red.

    • React
    • TypeScript
    • Lightweight Charts
  2. Futures data and the liquidation map

    Prices moved to Binance USDT-M perpetuals. An estimated liquidation map is built from 7 days of 15-minute open interest. A server keeps one Binance stream per coin and timeframe for every user, and refills any gap after a reconnect.

    • Fastify
    • Binance Futures
    • WebSocket
  3. Level engine and trade screen

    Stops from market structure instead of a fixed percentage, every level with its reason, and one tap from launch to a plan. Saved trades are replayed against later candles to show whether they hit the target or the stop, with win rate and P&L in the profile.

    • TypeScript
    • Telegram Mini App
  4. Testing

    Every change runs through the full suite in CI before it ships.

    • 66 unit tests on the core math: ATR, levels, liquidations, trade outcomes
    • 14 server tests against a fake Binance, REST and WebSocket
    • 18 end-to-end scenarios in a real browser, on every push
    • Vitest
    • Playwright
    • GitHub Actions
  5. Backtest and retune

    A 3-year backtest on 15 Binance perps, fees included, retuned the defaults: the target is now set by R:R, stops start one step wider, and fees are shown in R with a warning above 0.1R.

04Stack

What it's built with

  • TypeScriptThe whole project: mini app, server and shared core
  • React + ViteThe Telegram Mini App
  • Telegram Mini AppRuns inside Telegram, no install
  • FastifyMarket-data server with shared live streams
  • Binance FuturesCandles, open interest and live prices
  • Lightweight ChartsThe interactive price chart
  • Vitest + PlaywrightUnit, server and end-to-end tests
  • DockerOne container serves the app and the API

05Result

A full plan in one tap

From launch to a full plan
1 tap
Of backtest behind the defaults
3 years
Automated tests on every push
98

Each level comes with the reason it's there, the size follows the risk, and leverage is checked against liquidation before the trade, not after. Saved trades show how they ended, so the plan can be judged by results.

06Client review

Aktan JapaAktan JapaCrypto Trader
I used to set stops by hand and forget half of them. Now every position gets its stop and targets the second it opens, and the stop follows price on its own.

07Next step

Need something like this?

Custom Developmentfrom $7,500around 14 days

  1. Tell me about your strategy and what it should do
  2. A call and a written plan within 24 hours
  3. A fixed price and timeline before any work starts

Projects

Other projects

View all projects

FAQ

Any questions?

  • Most custom builds go live in around 14 days, from a single execution module to a full signal-to-exchange system. Strategy optimization takes from 7 days, longer when the strategy trades many markets, because every change has to survive out-of-sample testing.

  • Most likely. I've built on Binance, Bybit, OKX, Kraken, Coinbase and TradingView, and a new exchange with a public API can be added as part of the build.

  • That's fine. We can start by turning your rules into something precise enough to test, and build the system around it once it holds up.

  • No. It's a fixed price for the project, agreed before any work starts. The code and everything the system earns are yours.

  • Yes. I sign an NDA on request, API keys are set up without withdrawal rights, and cases on this site never name clients or show their rules.

  • Yes. Every build comes with a handover and a support window; after that, ongoing maintenance and changes are billed separately.

Still have questions?

Ask me directly

Ready to upgrade your trading system?