Python trading bots and custom indicators, without leaving the terminal

easyBterminal has a built-in Python editor: write custom indicators drawn on the chart, or trading bots that return BUY, SELL or HOLD with optional stop-loss and take-profit.

Start the 7-day free trial

Market data included. No broker required to start.

bot.py
class TradingBot:
    def on_init(self):
        self.period = 20

    def on_bar(self, bar, ctx):
        closes = [b["close"] for b in ctx["history"][-self.period:]]
        if len(closes) < self.period:
            return "HOLD"
        sma = sum(closes) / self.period
        if bar["close"] > sma:
            return {"action": "BUY", "sl": bar["low"]}
        return "SELL"

bot = TradingBot()

From code to backtest

Start from ready-made templates and test your idea on historical data.

  • Write: editor with ready-made templates
  • Backtest: commissions, slippage and equity curve
  • Walk-forward: robustness on unseen data

Go live on your broker

When you are ready, a bot can send real orders to your connected broker, only after your explicit confirmation.

Runs in your browser

Code runs in a sandbox in your browser. Nothing to install.

Frequently asked questions

What can a Python bot return?

BUY, SELL or HOLD, optionally with stop-loss and take-profit.

Can I backtest a bot?

Yes, with commissions and slippage, plus walk-forward analysis to check robustness on unseen data.

Does a bot trade on its own?

A bot can send real orders to your broker only after your explicit confirmation.

Other features

Brokers

Guides

Partners

Analysis tools, not financial advice.