From Strategy to Live Trading with Planar.jl
Build, backtest, and deploy high-performance automated trading strategies with a powerful and flexible open source Julia library.
Built in Julia
High-performance numerics
Modular architecture
Composable workflows
Backtesting
Non-vectorized interface
Live trading
Paper + live execution
Why Planar.jl
A focused toolkit for quant developers who want clarity, speed, and control.
Faster strategy development
Prototype and refine ideas quickly with Julia’s expressive syntax and high-performance runtime.
Composable by design
Mix and match data, models, execution, and risk controls without fighting the framework.
Confidence through backtesting
Evaluate strategies against historical data with an intuitive interface that stays readable.
Unified market data
Stream real-time and historical data from multiple providers in one consistent format.
Full order lifecycle control
Manage creation, submission, execution, and tracking with a fine-grained order management system.
From paper to live trading
Start in simulation, validate behavior, then promote the same workflow to live execution.
Minimal workflow, real flexibility
Define a strategy, wire it to market data, and run it in backtest or live mode.
# strategy.jl — your strategy module
using Planar
using Planar: @strategyenv!, WatchOHLCV, MarketOrder, Buy, Sell
const DESCRIPTION = "MyStrategy"
const EXC = :binance
const TF = tf"1m"
@strategyenv!
# Called once at strategy load
call!(s::SC, ::ResetStrategy) = begin
call!(s, WatchOHLCV()) # subscribe to 1m candles
end
# Warmup period for indicators
call!(_::SC, ::WarmupPeriod) = Day(1)
# Main logic — called on each 1m candle
function call!(s::SC, ts::DateTime, _)
foreach(s.universe) do ai
df = ohlcv(ai)
idx = dateindex(df, ts)
if idx > 20
# Simple MA crossover signal
ma5 = mean(df.close[(idx-4):idx])
ma20 = mean(df.close[(idx-19):idx])
side = ifelse(ma5 > ma20, Buy, Sell)
call!(s, ai, MarketOrder{side}; date=ts, amount=0.001)
end
end
end
# Assets to trade
call!(::Type{<:SC}, ::StrategyMarkets) = ["BTC/USDT"]
# Run it (in PlanarDev REPL)
# using PlanarDev
# loadstrat!(:MyStrategy; mode=Sim(), exchange=:binance, sandbox=true)Community and resources
Explore the docs, contribute on GitHub, or support ongoing development.
Documentation
Guides, API references, and examples.
GitHub
Source code, issues, and contributions.
Support
Help keep the project moving forward.
Ready to build your first strategy?
Start with the quick start guide and move to live execution with the same workflow.