An algorithm is a set of instructions, not a source of returns

Crypto algorithmic trading uses explicit rules or models to choose, size and execute trades. The code might rebalance a portfolio weekly, follow a trend, quote both sides of a market or trade a gap between related instruments. Automation makes those decisions repeatable. It does not make the trading idea profitable.

Here, “algorithmic” refers to the trading process, not an algorithmic stablecoin or a token whose protocol adjusts supply. AI is optional. A weekly rebalance rule is an algorithm; a machine-learning model is simply one possible source of a signal.

The strategy says which exposure it wants and why. The surrounding automated trading system supplies validated data, risk controls, order management, reconciliation and recovery. Good research inside an unreliable system still produces bad trades.

A profitable backtest is the start of the review First ask whether the idea was written down before the test, whether each input existed at decision time and whether the return survives real prices, costs, latency and later unseen markets.

From an idea to a reconciled fill

01HypothesisState the behavior, cause, horizon and failure condition.
02Point-in-time dataReconstruct what was knowable at each decision.
03SignalTranslate features into a bounded position target.
04PortfolioAllocate risk across assets, venues and strategies.
05ExecutionModel and place orders under real market rules.
06EvaluationMeasure net results, failures and regime dependence.

Each pass should leave a usable record: data version, feature values, strategy parameters, target position, risk decision, intended order, actual fill and cost. Without that trail, the result may be visible but cannot be explained or reproduced.

Write down what would prove the idea wrong

“Bitcoin goes up” is an opinion, not a research specification. A testable idea names the market, observable condition, action, time horizon and reason the behavior might persist. It also says which result would make you abandon the idea rather than tune it again.

Weak statementResearch-ready version
Buy when momentum is strong.Define the return window, threshold, rebalance time, asset universe, holding period and exit rule before testing.
Trade exchange price differences.Specify venues, transfer and settlement constraints, simultaneous execution rules, inventory requirements and minimum net spread.
Use AI to predict crypto.Name the model output, forecast horizon, benchmark, retraining schedule, uncertainty threshold and permitted position response.
Market make profitable pairs.Define quote width, inventory skew, cancellation policy, queue assumptions, fee tier and adverse-selection measure.

Writing this down first limits hindsight. If every loss sends the researcher back for a new indicator, friendlier asset list or better date range, the process is selecting noise rather than testing an idea.

Crypto data arrives on more than one clock

A point-in-time dataset contains only what was available when the decision happened. Downloading today’s historical candles does not guarantee that. Symbols change, tokens list and delist, contract specifications are revised, funding settles on venue clocks and on-chain events become usable at different confirmation depths.

Data layerWhat to preserveCommon research error
Trades and quotesVenue, instrument, event time, receipt time, price, size and side conventionCombining venues as if one executable market existed.
Order bookSnapshots, incremental updates, sequence and depthUsing the best quote for more size than was available there.
Instrument metadataTick, lot, contract size, collateral, settlement, listing and delisting timeApplying current specifications to older trades.
Derivatives stateIndex, mark, funding, open interest, margin tiers and expiryTreating last trade as the price used for every risk event.
On-chain stateBlock, transaction ordering, fee, confirmation policy and contract versionUsing finalized state before it would have been known.
Account stateBalances, positions, orders, fills, fees, borrow and transfersAssuming capital is instantly available at every venue.

The asset list also has to exist point by point in time. Testing only tokens that survive today drops the failures and delistings that were eligible then. Save the selection rule and the data used to apply it on each date.

There is no single executable “crypto price”

Digital assets trade continuously across centralized exchanges, decentralized protocols and derivatives venues. Price, liquidity, custody, settlement and access differ among them. Makarov and Schoar document how price discovery and segmentation vary across exchanges and time. The model therefore needs the venue the account can actually trade, not only a synthetic global price.

On a centralized limit order book, the best bid and ask represent only displayed prices and quantities. Coinbase Exchange, for example, documents price-time priority: orders at better prices execute first, and earlier orders have priority at the same price. That means a passive order touching the best price does not automatically fill. It may sit behind existing size while the market moves away.

Market featureResearch implicationExecution implication
Fragmented venuesA reference price may not be executable on the selected account.Capital, limits and inventory must already be available where the order is placed.
24/7 tradingDay boundaries and maintenance windows must be defined explicitly.Monitoring and recovery cannot assume a universal market close.
Uneven depthCapacity changes by asset, venue, time and volatility.Order size can move through several book levels.
Maker/taker pricingCost depends on whether an order rests or executes immediately.A partially marketable limit order may incur both treatments.
Venue-specific rulesTicks, lots, fees and order behavior need versioned metadata.The adapter must round and validate before submission.
On-chain executionBlock inclusion, gas and state changes enter the cost model.Pending transactions face reordering, replacement, reversion and contract risk.

Spot and derivatives need separate assumptions

DimensionSpotPerpetual or dated derivative
ExposureOwnership or sale of the asset, with borrowing if usedContract notional that can be long or short
CapitalCash and asset inventoryCollateral and margin rules
Recurring costTrading, custody and possible borrow costTrading cost plus funding or basis and margin effects
Reference pricesOrder book and trades on the spot venueLast, index, mark and settlement prices may serve different purposes
Tail failureIlliquidity, custody or borrow recallLiquidation, funding reversal, basis change or expiry handling

One return series and one cost model cannot represent both. The futures trading bot guide covers margin and liquidation; funding-rate arbitrage covers hedged carry and its remaining basis, execution and venue risks.

The main strategy families—and what usually breaks

FamilyCore hypothesisDominant implementation risk
Scheduled accumulation or rebalancingA time or allocation policy is preferable to discretionary timing.Liquidity, concentration and rebalancing cost.
Trend and momentumPrice movement persists longer than the strategy's reaction and trading cost.Whipsaw, crowded exits and regime reversal.
Mean reversionA measured displacement tends to normalize over the chosen horizon.A structural break turns temporary divergence into a persistent move.
Market makingSpread capture exceeds adverse selection, inventory and operating cost.Fills arrive before unfavorable price movement and inventory accumulates.
Cross-market arbitrageLinked prices converge after every execution, transfer and funding cost.One leg fails, capital cannot move or the apparent spread is not executable.
Basis and carryFunding or convergence exceeds hedge, margin and venue costs.Funding reverses, basis widens or a leveraged leg liquidates.
Short-horizon scalpingOrder flow or microstructure predicts a move larger than immediate costs.Latency, queue position, noise and overtrading.
Cross-sectional portfolioRelative features rank assets with repeatable differences in future return or risk.Survivorship bias, turnover, concentration and changing correlations.

The trend-following guide, arbitrage-bot guide and AI scalping guide cover the mechanics and tests specific to those families in more detail.

Do the cost arithmetic before choosing a fancy model

Gross return is the captured price move before implementation. Net return subtracts what it cost to enter, hold and leave the position. The terms change by strategy, but this is a useful starting point:

Net return = benchmark-price return − execution shortfall − fees − financing/carry where applicable − failed-execution loss

Execution shortfall is the difference between decision-time benchmark prices and actual fills. Measured that way, it captures bid–ask spread, market movement during delay and size impact once rather than listing three overlapping deductions. Financing, borrow and funding belong in the equation only when the position and holding period actually incur them.

Maker and taker fees can differ and may depend on an account's current volume tier. Coinbase Advanced, for example, documents separate maker and taker treatment and notes that an immediately filled part of an order can be charged differently from the portion that rests. Check current terms for the actual venue and account rather than copying a fee table into a permanent backtest.

A worked $25,000 net-return example

Suppose a fully funded, unlevered spot strategy expects a 70 bp benchmark-price move on $25,000 of notional over one holding interval. Its hypothetical fills produce 16 bp of round-trip execution shortfall, fees are 12 bp on each side, and partial or failed execution carries an estimated 5 bp cost. No borrow, funding or financing charge applies to this example.

ComponentBasis pointsDollar effect
Gross strategy move+70 bp+$175.00
Round-trip execution shortfall−16 bp−$40.00
Entry and exit fees−24 bp−$60.00
Expected execution loss−5 bp−$12.50
Illustrative net result+25 bp+$62.50

These are hypothetical numbers, not current costs from a named venue. They show the sensitivity: another 25 bp of execution shortfall erases the estimate. If normal uncertainty in the cost model is as large as the expected edge, gross returns cannot tell you much.

Build a backtest another person could challenge

  1. Freeze the specification. Record the hypothesis, universe, features, horizon, sizing, benchmark, costs and rejection criteria before the final test.
  2. Version raw data. Preserve source, timestamps, metadata and transformations so the dataset can be reproduced.
  3. Enforce event order. Make features available only after the source event could have reached the strategy.
  4. Use a point-in-time universe. Include delistings and historical eligibility rather than today's survivors alone.
  5. Model executable fills. Use bid, ask and depth appropriate to size; include queue and gas assumptions where relevant.
  6. Deduct every cost. Apply the fee tier, spread, slippage, funding, borrow, impact and failure treatment that the live design would face.
  7. Separate development and test periods. Tune on earlier data, evaluate once on later untouched data and continue with walk-forward observation.
  8. Stress assumptions. Widen spreads, delay orders, reduce fills, raise fees, reverse funding and remove the best-performing assets.
  9. Compare with a benchmark. Measure whether complexity improves net risk-adjusted results over a simpler allocation or no-trade rule.

The SEC has brought an enforcement action over hypothetical backtested advertising in which the test and live strategy used materially different instruments. The case involved a registered investment adviser, but the broader lesson is straightforward: state the differences between simulation and live implementation instead of presenting them as one record. See backtests versus live results for a dedicated treatment.

Eight ways a backtest manufactures an edge

ErrorHow it entersPreventive test
Look-ahead biasUsing a close, index value or on-chain state before it was observable.Delay every feature to its real availability timestamp.
Survivorship biasTesting only assets and venues that remain available today.Reconstruct historical eligibility, delistings and failures.
Selection biasReporting the best result after many unreported trials.Track all experiments and reserve an untouched final period.
Impossible fillsBuying at a candle low, selling at a high or filling unlimited size at one quote.Replay executable book state with latency and partial fills.
Cost omissionIgnoring one side of fees, funding, gas, borrow or failed orders.Reconcile simulated costs to sample venue statements or fills.
Capital teleportationUsing the same funds simultaneously across fragmented venues.Maintain separate balances, transfers and settlement delays.
Parameter instabilityOne narrow setting works while adjacent values fail.Map a parameter neighborhood and test later regimes.
Capacity blindnessAssuming returns remain constant as size increases.Recalculate fills and impact across several order sizes.

A win rate can hide the entire risk profile

A strategy can win 70% of its trades and still lose money when the other 30% are larger. A high return may come from hidden leverage or one exceptional month. Read economic performance, execution quality and operating reliability separately.

  • Return: net profit, benchmark-relative return and distribution by trade and period.
  • Risk: drawdown, volatility, downside tail, leverage, concentration and liquidation distance.
  • Stability: results by asset, venue, volatility, direction, liquidity and later unseen period.
  • Execution: fill ratio, partial fills, slippage, spread paid, maker/taker mix and post-fill markout.
  • Capacity: net result as notional rises and available depth is consumed.
  • Operations: rejects, timeouts, stale-data events, reconciliation breaks, downtime and recovery time.

Earn the right to increase size

ALocked backtestUntouched time period and a simulation with every material cost.
BWalk-forwardRepeat the process as new unseen periods arrive.
CShadow modeRun on live data without sending orders.
DBounded liveUse limited assets, size and permissions.
EScale reviewCompare expected and actual fills before increasing risk.

Move forward only after written thresholds are met, not because a few days were profitable. Check that invalid orders are rejected, a restart rediscovers existing exposure, partial fills update positions and the independent stop works. The account should stay inside its limits even when the signal, feed or venue fails.

What to ask a strategy provider

  1. Identify the exact product. Is it software, signals, copy trading, a managed account, a fund or a venue feature?
  2. Read the strategy specification. Look for universe, venue, horizon, leverage, entry, exit, sizing and conditions for no trade.
  3. Separate evidence types. Label hypothetical backtest, paper, shadow and live results with dates and capital.
  4. Recalculate net return. Include fees, spread, slippage, funding, borrow, impact, downtime and subscription cost.
  5. Inspect custody and permissions. Determine who holds assets, whether API credentials can transfer value and how access is revoked.
  6. Ask about bad periods. Review maximum drawdown, worst trades, outages, delistings and markets in which the strategy should be disabled.
  7. Review controls. Confirm maximum exposure, loss limits, price collars, stale-data handling, reconciliation and a kill switch.
  8. Reject guarantees. The CFTC warns that AI cannot predict sudden market changes and highlights the effect of fees, spreads and subscription costs.

Practical questions about algorithmic crypto trading

Do crypto trading algorithms need AI?

No. Scheduled rebalancing, execution schedules, trend rules and spread thresholds can be fully algorithmic without machine learning. Use AI only when it adds measurable value over a simpler benchmark after cost and operational complexity.

Can a profitable backtest be trusted?

Reproducible data, code and assumptions can make a backtest useful support for a hypothesis, but never proof of future or live performance. The result becomes more credible when it survives later untouched periods, conservative costs, shadow operation and limited live observation.

What programming language is best for algorithmic crypto trading?

The best choice depends on latency, libraries, team skill and operational requirements. Research code and production execution do not have to use the same language, but calculations, rounding and strategy behavior must match across implementations and be covered by shared test cases.

How much capital does an algorithm need?

There is no universal minimum. Capital must cover venue minimums, diversified risk, fees and stressed loss without relying on leverage to make a tiny expected edge visible. Test capacity in both directions: an account can be too small for costs and too large for available liquidity.

Does 24/7 crypto trading make automation necessary?

It makes continuous monitoring valuable, but it does not justify unattended risk. A system can restrict trading windows, enter no-new-risk mode or require operator coverage. Safe automation is preferable to constant activity.

Research, rules and enforcement references

The worked calculation uses hypothetical costs and does not promise that any strategy is profitable. Market, product, tax and regulatory requirements change by venue and location; check the current rules for the exact account rather than treating this guide as a trade recommendation.