Low activity

Blankly guide

Blankly made multi-exchange bots simple with price-event callbacks and a uniform interface.

Last reviewed

Quick answer

Blankly is an open-source Python framework for writing a trading strategy once and running it as a backtest, paper bot or live bot across stocks (Alpaca), crypto (Coinbase, Binance, Kraken) and forex (OANDA). Development has slowed since 2024, so check recent commits before depending on it.

Blankly at a glance

Category
Backtest + live trading engines
Language
Python
License
LGPL-3.0
Does
Backtesting, Live trading, Paper trading
Markets
Stocks, Crypto, Forex
Best for
Quick multi-exchange prototypes in stocks, crypto and FX.
In AlgoGP
Use the exported strategy object from your own code

Pick it if

Quick multi-exchange prototypes in stocks, crypto and FX.

Watch out for

Low activity since 2024.

Blankly strengths and limitations

Strengths

  • Simple event callbacks and uniform exchange interface.
  • Backtest, paper and live with the same code.

Limitations

  • Low activity since 2024.
  • Smaller ecosystem than Freqtrade or Lumibot.

Blankly example

pip install blankly
Install
import blankly

def price_event(price, symbol, state: blankly.StrategyState):
    state.interface.market_order(symbol, "buy", blankly.trunc(state.interface.cash / price, 2))

strategy = blankly.Strategy(blankly.Alpaca())
strategy.add_price_event(price_event, "MSFT", resolution="1d")
strategy.backtest(to="1y")
Price event callback.

Use Blankly with AlgoGP

AlgoGP does not add Blankly to projects automatically yet, but nothing stops you using them together. Every AlgoGP project exports plain Python with a framework-neutral strategy object, so you can call it from Blankly yourself.

  1. 1

    Design and backtest in AlgoGP

    Describe the idea to the copilot and backtest it on AlgoGP’s normalized history.

  2. 2

    Add any bridge to get the adapter core

    Adding a bridged framework (for example Backtrader) writes frameworks/algogp_bridge.py, whose StrategyBridge.on_bar() returns the orders the strategy wants.

  3. 3

    Call it from Blankly

    Feed Blankly’s bars to StrategyBridge, place the returned orders with Blankly, and report fills back with sync().

Blankly connects to Alpaca, Coinbase Advanced Trade, Binance, Kraken, OANDA. Each guide shows how to create the API key, which you can store in the project’s Keys & secrets.

Blankly: frequently asked questions

Is Blankly still maintained?

Commits have slowed; evaluate recent activity and consider Lumibot or Freqtrade.

Blankly alternatives

Independent guide. AlgoGP is not affiliated with Blankly. Features, licenses and maintenance change; check the official documentation. Nothing here is investment advice.

Build a strategy