Skip to main content

Gunbot Quant: A Standalone, Open-Source Tool for Algorithmic Traders

· 14 min read

Gunbot Quant Header

Most screeners are great at showing you what just moved; very few are built to help you systematically trade what matters next.

If you’re running algos, you don’t really need another page of top gainers or a rainbow of indicators for screenshot flexing. You need a way to define your ideal market conditions once, reuse them reliably, and pipe the results into batched, honest backtests without wrestling multiple tools, fragile copy-paste rituals, or “close enough” parameters that mysteriously underperform in production.

That is the core of Gunbot Quant: a standalone, open-source tool that links saved screener setups directly to batched backtesting runs. And if you use Gunbot DeFi, it can hand those exact tested configs and strategies to your live bot in one click. The trading bot itegration offers a repeatable loop from “scan like an algo trader” to “prove it” to “run it,” all in one place you control.

I’ll be upfront: Gunbot Quant isn’t claiming to be the only capable screener. There are excellent screeners out there, and if all you want is to eyeball opportunities, you’ll be well-served. The difference here is not a promise that these filters are magically better. The difference is architecture and intent: saved, composable scans that speak the same language as the backtester; caching and compiled computations so re-runs are fast; and reporting that answers the questions systematic traders actually ask before putting capital at risk. The screener is good, but the workflow from saved scan → batch test → live parity → monitoring, is the point.

Free and open-source

Gunbot Quant is free. There’s nothing to sell here - use it, fork it, improve it. Pull requests welcome.


What it is

Gunbot Quant is a research and deployment workflow for algorithmic traders that runs on your machine, talks to multiple data sources, and treats your trading like a reproducible experiment rather than a weekend of tab-surfing.

Gunbot Quant Screenshot

You define a scan once, with liquidity guardrails, a handful of momentum, volatility, and trend metrics, and any heuristics you care about. Save it with a clear name, and reuse it every time that strategy archetype comes up. When you hit “go,” the screener assembles a candidate set that fits your rules, and the backtester runs that strategy (or a portfolio of strategies) across all those candidates in one sweep. The reports give you risk-adjusted results, portfolio roll-ups, and exit-reason diagnostics so you can tell the difference between a pretty equity curve and a setup that earned its keep.

If you run Gunbot, you can send the exact tested configuration to live trading in a click; if you don’t, you can still use everything else: the scan, the tests, the reports—as your independent research layer.

This matters because it keeps you structured. You don’t “think” you ran the same parameters live that you tested: you know you did. You don’t “hope” your live pair is still the best place to run that setup: you can benchmark it against the rest of the market and see where it stands. And you don’t rebuild your screeners from scratch every time a regime changes: you pull up the saved scan for that regime and batch test again, which means your process gets better with time instead of noisier.

The real win

Plenty of solid screeners exist. The edge here is that saved screener setups flow straight into batched backtests with the same parameters and symbol normalization. Define once, reuse often, compare over time.


Screener: a research starting point you can save and reuse

A screener for algos is less about colorful dashboards and more about not wasting your backtest compute budget.

Gunbot Quant pulls from any CCXT-compatible crypto exchange and from Yahoo Finance for equities and ETFs. It does the boring but essential work of normalizing symbols so “the thing you tested” is “the thing you can trade.” Think of the process as a funnel: start with a wide net of higher-volume assets, then apply increasingly specific filters.

You can filter by liquidity using trading volume so you don’t get lured into thin books that betray your fills. You can look at price relative to different SMAs to avoid testing trend followers in chop or mean-reverters in one-way markets. You can measure momentum with rate-of-change windows that match your timeframe. You can gate by normalized volatility with ATR percentage so you don’t hand a grid strategy a dead pair or throw a breakout strategy at a coin that whipsaws itself to pieces. Oscillators like RSI and Stoch RSI are available when your logic needs them, and there’s room for pragmatic heuristics—volatility “consistency,” recent volume concentration, and spike filters that keep obviously unsuitable candidates out of the queue.

Saving is the point. Instead of a one-off filter you forget next month, you keep a named, versionable scan like “TrendCandidates-Daily-HighADX” or “LowVol-MeanRev-4h.” When market tone shifts, you run the same scan and you get a fresh ranked list that passes the same gates as last time. That simple act is what makes a process feel systematic rather than improvised.

Symbols & exchanges

Markets naming gets messy across platforms. The app normalizes symbols so your research symbol matches the live tradable pair on your exchange.

Available screener metrics

The metrics are chosen to provide a holistic view of an asset's character, covering volume, momentum, trend, volatility, and risk.

CategoryMetric"Why" this metric is useful
Volumeavg_vol_30d_quoteEnsures the asset has sustained liquidity, which is critical for executing trades at expected prices.
rel_vol_10d_quoteIdentifies assets with recent spikes in interest, which can precede significant price moves.
Momentumroc_*p familyMeasures the strength of price movement over different time horizons, crucial for trend-following strategies.
Trendprice_vs_sma*Quickly determines if an asset is in a short-term or long-term uptrend or downtrend.
sma50_vs_sma200Identifies major trend shifts (Golden/Death Crosses), a cornerstone of classical technical analysis.
adx_14pDistinguishes between a strong trend (good for trend-following) and a ranging market (good for mean-reversion).
Volatilityatr_pct_14pNormalizes volatility as a percentage of price, allowing for fair comparison between assets of different prices. Helps filter out assets that are too flat or too erratic.
Oscillatorrsi_14p, stochrsi_*Identifies potential overbought or oversold conditions, forming the basis for mean-reversion strategies.
Heuristicsvolatility_consistency, max_daily_spike_pct, volume_concentration_pctThese are risk management metrics. They help filter out assets that may look good on paper but are prone to unpredictable spikes, flash crashes, or "pump and dump" volume patterns.

Backtesting engine: fast, batched, reproducible

The backtester is where you prove ideas, and its job is to keep up with how you actually work. You can take a saved screener result, run a strategy (or a few variants) across a slate of symbols in one go, and get a report you can trust without babysitting the process. Launch runs directly from any saved scan or from an explicit symbol list; the engine keeps the plumbing aligned: timeframes, warm-ups, symbol normalization, so the numbers you compare are apples-to-apples. Each run writes out the artifact set you expect: per-trade ledger, equity and drawdown series, exit-reason attribution, and a portfolio roll-up when you test more than one market.

Speed comes from deliberate engineering. Historical data is cached locally in columnar Parquet, so repeat runs don’t waste time refetching or reparsing; indicator math is JIT-compiled with Numba so multi-symbol sweeps complete in minutes rather than afternoons; and the engine avoids recomputation when your only change is a filter or a parameter tweak. In practice, scanning ten candidates and retesting a few strategy variants becomes a rhythm you can run before coffee gets cold, not a weekend project.

Reproducibility is treated as a first-class feature. Each report records which screener produced the candidates (name, saved definition, timestamp), which strategy configuration or alias you ran, the exact parameter set, the data window, and the fee/slippage model in force. If you prefer working from the command line, scenario files let you declare a base config and then define small, explicit overrides for symbols, strategies, or params, which makes A/B (or A/B/C) testing read like a lab notebook instead of a pile of screenshots.

The engine covers two common shapes of systematic trading without forcing one into the other. For straightforward directional systems—trend followers, mean-reverters, breakouts—you run fixed historical windows and get the risk-aware picture you need: return, Sharpe/Sortino, drawdown depth and duration, hit-rate and average trade characteristics, plus the exit-reason breakdown that shows whether profits come from the logic you intended or from a stop doing too much of the work. For inventory-carrying or market-neutral styles such as grids, a continuous evaluation path tracks compounding and inventory effects explicitly.

Candle-open execution

By default, included Gunbot strategies generally enter and exit on candle open. That keeps the strategies aligned with what’s realistically executable as a backtest and avoids intra-bar fantasy fills.


Strategy library: familiar archetypes, easy to tinker

The built-in library covers the archetypes most traders actually use, so you can focus on where and how to trade rather than reinventing entry signals.

  • For Mean-Reversion Traders: If you believe prices revert to an average, you’ll recognize the RSI_Reversion (buys oversold, uses ATR stop), BB_Reversion (fades outer band excursions), and Stochastic_Reversion. There’s also a combo that requires oscillator agreement and exits at fixed ATR multiples for tighter risk management.
  • For Trend Followers: If you believe trends persist, the library offers an EMACross, a MACD_Cross, a Supertrend_Follower (where the indicator line doubles as a trailing stop), and a Heikin-Ashi approach that smooths price action to reduce noise.
  • For Volatility and Breakout Traders: If you trade changes in market energy, you have a classic Donchian_Breakout and a Keltner_Squeeze_Breakout to separate real expansions from random noise.
  • For Market-Neutral Approaches: The continuous Grid_Strategy is designed to profit from volatility regardless of direction, with its own per-pair compounding logic.
  • For Hybrid and Adaptive Systems: There’s a “buy the dip in an uptrend” model that gates mean-reversion entries behind a slow-MA trend filter, and the self-optimizing Dynamic_Momentum_Optimizer that retunes itself to recent conditions.

In practice, traders often keep a small roster of systems that match their personality. Gunbot Quant makes it straightforward to test a few variants of each—bump a parameter for sensitivity, tighten a stop—and see differences play out in a single report.

Strategy library scope

The included strategies are not 1:1 emulations of existing Gunbot strategies. Gunbot’s native strategies are often quite complex and combine stateful behaviors that aren’t efficient to backtest generically. The library here is a clean suite of common and less-common technical approaches (i had some fun with the dynamic optimizer strat) that are transparent, auditable, and easy to benchmark.


For strategy developers: a look inside a Gunbot Quant JS file

The strategies are written in vanilla JavaScript for compatibility with Gunbot’s custom strategy runtime. They’re designed to be self-contained and readable, which makes them good templates for customization.

Here is the annotated structure of a typical strategy, rsi_reversion.js:

/*
* Gunbot Quant Strategy: RSI_Reversion
* A brief summary of the logic and a table of configurable parameters.
* This header is read by the UI to populate help text.
*/

// Gunbot requires this to be initialized. It's a persistent, per-pair data store.
gb.data.pairLedger.customStratStore = gb.data.pairLedger.customStratStore || {};

/* -------------------------------------------------------------------------
* STATE INITIALISATION: The strategy's memory.
* ------------------------------------------------------------------------- */
const store = gb.data.pairLedger.customStratStore;
if (typeof store.state !== "string") store.state = "IDLE"; // "IDLE" | "IN_POSITION"
if (typeof store.stopPrice !== "number") store.stopPrice = 0;
// ... other state variables as needed

/* -------------------------------------------------------------------------
* INDICATOR IMPLEMENTATIONS: Self-contained TA functions.
* ------------------------------------------------------------------------- */
const indicator_helpers = {
rsi: function (source, length) { /* ... RSI calculation logic ... */ },
atr: function (high, low, close, length) { /* ... ATR calculation logic ... */ }
};

/* -------------------------------------------------------------------------
* ORDER HANDLERS: Wrappers for Gunbot's buy/sell methods.
* ------------------------------------------------------------------------- */
const buyMarket = async function (amount, exchange, pair) { /* ... gb.method.buyMarket call ... */ };
const sellMarket = async function (amount, exchange, pair) { /* ... gb.method.sellMarket call ... */ };

/* -------------------------------------------------------------------------
* STATE RECONCILIATION: Syncs strategy state with Gunbot's reality.
* ------------------------------------------------------------------------- */
function reconcileState() {
// Checks gb.data.gotBag and gb.data.openOrders to see if we are in a position,
// then updates store.state accordingly. This corrects state after manual trades or restarts.
}

/* -------------------------------------------------------------------------
* TRADING DECISION: The core logic function.
* ------------------------------------------------------------------------- */
async function decideTrade() {
reconcileState(); // Always sync first.

// 1. Read parameters from Gunbot's config (`whatstrat` object)
const rsiPeriod = parseFloat(whatstrat.GQ_RSI_REVERSION_PERIOD || 14);
// ...

// 2. Calculate indicators
const rsiValues = indicator_helpers.rsi(candlesClose, rsiPeriod);
const rsi = rsiValues[iLast];
// ...

// 3. (Optional) GUI enhancements
const sidebar = [];
sidebar.push({ label: 'RSI Value', value: rsi.toFixed(2) });
gb.data.pairLedger.sidebarExtras = sidebar;

// 4. Implement strategy logic using an IF/ELSE block for states
if (store.state === "IDLE") {
const wantToEnter = rsi < rsiOversold;
if (wantToEnter) {
await buyMarket(costQuote, exchangeName, pairName);
}
} else if (store.state === "IN_POSITION") {
const wantToExit = rsi > rsiOverbought || ask < store.stopPrice;
if (wantToExit) {
await sellMarket(quoteBalance, exchangeName, pairName);
}
}
}

/* -------------------------------------------------------------------------
* DRIVER: The entry point called by Gunbot on every tick.
* ------------------------------------------------------------------------- */
await decideTrade();

Optional Gunbot handoff and benchmarking

Everything above is fully useful even if you never touch Gunbot. If you do, the loop gets tight in a satisfying way: after a batch test, you can push the winning configuration directly to your Gunbot instance. The tool handles the annoying parts: mapping your research symbol to your Gunbot notation, creating the pair and strategy, and sending the exact parameters you just tested.

Once you’re live, the benchmarking tools are built to answer a simple question: is this still the best place to run this setup? You can take your live strategy and compare it against the rest of the eligible market with the same logic. If the rankings start to show a better candidate, you can rotate before lag turns into losses.


CLI for repeatable experiments

If you prefer to script your life, the command-line interface is there. You define a base configuration and then declare a list of scenarios that override only what’s different.

Example: design a CLI scenario to test two RSI_Reversion configurations against a default EMACross on BTCUSDT.

  1. Open gunbot_quant/config/scenarios.py.
  2. Add a new dictionary to the SCENARIOS list:
{
"name": "Multi_RSI_vs_EMACross_BTC",
"params": {
"EXCHANGE": "binance",
"TIMEFRAME": "4h",
"BACKTEST_START_DATE": get_date_relative_to_now(days=365),
"SYMBOL_SELECTION_METHOD": "EXPLICIT_LIST",
"SYMBOLS": ["BTCUSDT"],
"STRATEGIES": [
{
"name": "RSI_Reversion",
"alias": "RSI_Sensitive_Config",
"params": {
"GQ_RSI_REVERSION_PERIOD": 10,
"GQ_RSI_REVERSION_OVERSOLD": 25
}
},
{
"name": "RSI_Reversion",
"alias": "RSI_Conservative_Config",
"params": {
"GQ_RSI_REVERSION_PERIOD": 21,
"GQ_RSI_REVERSION_OVERSOLD": 35,
"GQ_RSI_REVERSION_ATR_MULT": 3.0
}
},
"EMACross"
]
}
}
  1. Run the scenario from your terminal:
python -m gunbot_quant.cli.main run Multi_RSI_vs_EMACross_BTC

The engine will produce a single report comparing the three tests, so you can see which configuration performed best. All reports can be viewed in the GQ frontend. This explicit approach is useful for long-term, systematic research.


Limitations

No tool can promise you winners. The screener will not divine tomorrow’s breakout, and the backtester is not a time machine: it’s a disciplined mirror that shows you what would have happened under the rules you gave it. Liquidity filters reduce but do not eliminate execution risk; risk-adjusted metrics illuminate quality but don’t guarantee persistence.

Backtesting history is limited by exchange candle data availability. Some exchanges are more generous than others.

:::warning Avoid overfitting by convenience Batch testing makes it easy to try hundreds of variations—don’t let that become parameter fishing. Lock a baseline, evaluate on multiple markets/regimes, and only promote changes that improve risk-adjusted metrics and drawdown behavior, not just headline returns. :::


Wrap-up

Gunbot Quant is a straightforward way to do saved, algo-first market screeners combined with batched backtests—and, if you want, to let those exact tested configurations go live in one click in Gunbot.

It runs locally, it’s open-source under the MIT license, and it’s extensible. If you’re the kind of trader who prefers a repeatable edge over a lucky screenshot, this might be useful to you.

GitHub: https://github.com/GuntharDeNiro/gunbot-quant