Getting Started
For Everyone: Use the Dashboard
- Sign up at the dashboard with GitHub
- Browse the Marketplace for strategies
- Add your Exchange Credentials (Account > Credentials)
- Backtest a strategy to review its performance
- Deploy to your exchange
No code or CLI needed — everything is available from the web dashboard.
For Developers: Use the CLI
Prerequisites
- Rust (edition 2021)
- A tradectl account (sign up via the dashboard with GitHub)
1. Install the CLI
bash
curl -fsSL https://tradectl.com/install.sh | shSee the installation guide for manual download options and PATH setup.
2. Log In
Create an API key from the dashboard (Account > API Keys), then:
bash
echo "st_live_<your-key>" | tradectl login3. Scaffold a Strategy
bash
tradectl init my-strategy
cd my-strategyThis creates a Rust project with:
my-strategy/
├── Cargo.toml
├── config.json # Exchange config and strategy parameters
├── src/
│ ├── lib.rs # Strategy implementation
│ └── params.rs # Parameter definitions
├── tests/
│ └── test.rs # Unit test
├── data/ # Backtest data files
├── README.md
├── STRATEGY.md
└── .gitignore4. Write Your Strategy
Edit src/lib.rs. The scaffold looks like:
rust
use tradectl_sdk::{Strategy, Action, TickerEvent, StrategyContext, Params, ParamDef};
tradectl_sdk::declare_strategy!("my_strategy", MyStrategy::new);
pub struct MyStrategy {
_params: MyStrategyParams,
}
impl MyStrategy {
pub fn new(params: &Params) -> Self {
Self {
_params: MyStrategyParams::from_params(params),
}
}
}
impl Strategy for MyStrategy {
fn on_ticker(&mut self, ticker: &TickerEvent, ctx: &StrategyContext) -> Action {
// Your strategy logic here
//
// Available data:
// ticker.bid_price, ticker.ask_price, ticker.bid_qty, ticker.ask_qty
// ctx.positions — open positions
// ctx.balance — available balance
// ctx.timestamp_ms — current event timestamp
//
// Return:
// Action::Hold — do nothing
// Action::MarketOpen { side, size } — open at market
// Action::LimitOpen { side, price, size } — place a limit order
// Action::ClosePosition { position_id, reason } — close a position
// Action::CloseAll — close all positions
// Action::CancelPending — cancel pending orders
let _ = (ticker, ctx);
Action::Hold
}
fn name(&self) -> &str { "my_strategy" }
fn describe(&self) -> &str { "My first strategy" }
fn params_schema(&self) -> Vec<ParamDef> { MyStrategyParams::schema() }
}5. Test
bash
cargo test6. Build
bash
tradectl build7. Run (Paper Trading)
bash
# Edit config.json with your settings (isEmulator: true for paper trading)
tradectl run --config config.jsonThis connects to the live exchange WebSocket for real market data but simulates all fills locally — no exchange API keys needed for paper trading.
Next Steps
- Strategies — deeper dive into the Strategy trait and composition
- Backtesting — run backtests on historical data
- Deployment — deploy to live exchanges