- Home
- DevOps & Monitoring
- Blankly
Blankly
π πΈ Easily build, backtest and deploy your algo in just a few lines of code. Trade stocks, crypto
Rating
Votes
0
score
Downloads
0
total
Price
Free
API key required
Works With
About
π¨ Rapidly build and deploy quantitative models for stocks, crypto, and forex π
View Docs Β· Our Website Β· Join Our Newsletter Β· Getting Started
Why Blankly?
Blankly is an ecosystem for algotraders enabling anyone to build, monetize and scale their trading algorithms for stocks, crypto, futures or forex. The same code can be backtested, paper traded, sandbox tested and run live by simply changing a single line. Develop locally then deploy, iterate and share using the blankly platform.
The blankly package is designed to be extremely precise in both simulation and live trading. The engineering considerations for highly accurate simulation are described [here](blankly/BACKTESTING_ENGINEERING.md)
Getting started is easy - just pip install blankly and blankly init.
Check out our website and our docs.
---------
Trade Stocks, Crypto, Futures, and Forex
from blankly import Alpaca, CoinbasePro
stocks = Alpaca()
crypto = CoinbasePro()
futures = BinanceFutures()
# Easily perform the same actions across exchanges & asset types
stocks.interface.market_order('AAPL', 'buy', 1)
crypto.interface.market_order('BTC-USD', 'buy', 1)
# Full futures feature set
futures.interface.get_hedge_mode()Backtest your trades, events, websockets, and custom data
import blankly
"""
This example shows how backtest over tweets
"""
class TwitterBot(blankly.Model):
def main(self, args):
while self.has_data:
self.backtester.value_account()
self.sleep('1h')
def event(self, type_: str, data: str):
# Now check if it's a tweet about Tesla
if 'tsla' in data.lower() or 'gme' in data.lower():
# Buy, sell or evaluate your portfolio
pass
if __name__ == "__main__":
exchange = blankly.Alpaca()
model = TwitterBot(exchange)
# Add the tweets json here
model.backtester.add_custom_events(blankly.data.JsonEventReader('./tweets.json'))
# Now add some underlying prices at 1 month
model.backtester.add_prices('TSLA', '1h', start_date='3/20/22', stop_date='4/15/22')
# Backtest or run live
print(model.backtest(args=None, initial_values={'USD': 10000}))
Check out alternative data examples [here](https://docs.blankly.finance/examples/model-framework)
#### Accurate Backtest Holdings
Go Live in One Line
Seamlessly run your model live!
# Just turn this
strategy.backtest(to='1y')
# Into this
strategy.start()Dates, times, and scheduling adjust on the backend to make the experience instant.
Quickstart
Installation
- 1.First install Blankly using
pip. Blankly is hosted on PyPi.
$ pip install blankly- 1.Next, just run:
$ blankly initThis will initialize your working directory.
Don't lose this
Three weeks from now, you'll want Blankly again. Will you remember where to find it?
Save it to your library and the next time you need Blankly, itβs one tap away β from any AI app you use. Group it into a bench with the rest of the team for that kind of task and you can pull the whole stack at once.
β‘ Pro tip for geeks: add a-gnt π€΅π»ββοΈ as a custom connector in Claude or a custom GPT in ChatGPT β one click and your library is right there in the chat. Or, if youβre in an editor, install the a-gnt MCP server and say βuse my [bench name]β in Claude Code, Cursor, VS Code, or Windsurf.
a-gnt's Take
Our honest review
This plugs directly into your AI and gives it new abilities it didn't have before. π πΈ Easily build, backtest and deploy your algo in just a few lines of code. Trade stocks, crypto. Once connected, just ask your AI to use it. It's completely free and works across most major AI apps. This one just landed in the catalog β worth trying while it's fresh.
Tips for getting started
Tap "Get" above, pick your AI app, and follow the steps. Most installs take under 30 seconds.
Heads up: this needs an API key to work. You'll get one from the service's website (usually free). The setup guide tells you exactly where.
What's New
Imported from GitHub
Ratings & Reviews
0.0
out of 5
0 ratings
No reviews yet. Be the first to share your experience.