Library

54 entries. Strategy methodologies with academic citations, core trading concepts, and runtime mechanics.

Strategy Methodologies

Published research behind the modules

Trend Following / MomentumA strategy that enters positions in the direction of a persistent price movement and exits when the trend reverses.Mean ReversionA strategy that identifies prices deviating from a historical average and trades in the direction of the expected return to that average.Markov Regime DetectionA probabilistic model that classifies the current market state into one of several regimes (e.g., bull, bear, sideways) to adapt strategy behavior.Monte Carlo SimulationA computational method that runs thousands of randomized scenarios to estimate the probability distribution of possible outcomes.Probability CalibrationA method for adjusting raw model outputs so that predicted probabilities match observed frequencies — a 70% prediction is correct 70% of the time.Statistical ArbitrageA strategy that exploits pricing inefficiencies between related assets by simultaneously taking long and short positions expected to converge.Limit Order ExecutionAn execution strategy that places limit orders (maker orders) to avoid paying the spread, accepting slower fills in exchange for better prices.Auction SnipingA strategy that places bids in the final seconds of a timed auction to minimize competing bidder response time.Adaptive ExecutionAn execution strategy that splits large orders into smaller pieces and adjusts timing and aggressiveness based on real-time market conditions.

Trading Concepts

Core ideas in any market

Kelly CriterionA formula that calculates the optimal fraction of capital to allocate to a bet given the probability of winning and the payoff ratio.Position SizingThe process of determining how much capital to allocate to a single trade, balancing potential return against risk of loss.DrawdownThe decline from a portfolio peak to a subsequent trough, expressed as a percentage of the peak value.Sharpe RatioA measure of risk-adjusted return — the excess return per unit of volatility, where higher values indicate more return for the risk taken.SlippageThe difference between the expected price of a trade and the actual execution price, typically caused by market movement or thin liquidity.SpreadThe difference between the highest bid price and the lowest ask price for an asset — the cost of immediate execution.VolatilityA statistical measure of how much an asset's price fluctuates over a given period — higher volatility means larger and more frequent price swings.Risk-Reward RatioThe ratio of potential loss to potential gain on a trade — a 1:3 ratio risks $1 to make $3.Dollar Cost AveragingAn accumulation strategy that invests a fixed dollar amount at regular intervals regardless of price, reducing the impact of entry timing.BacktestingRunning a strategy against historical data to evaluate how it would have performed, before risking real capital.OverfittingTuning a strategy so precisely to historical data that it captures noise instead of signal, performing well in backtests but poorly in live trading.Survivorship BiasThe distortion that occurs when analysis only includes assets that still exist, ignoring those that failed, delisted, or went to zero.Order BookThe real-time list of all open buy and sell orders for an asset on an exchange, organized by price level.LiquidityHow easily an asset can be bought or sold at the current market price without significantly moving that price.Market MakingA strategy that provides liquidity by continuously quoting both buy and sell prices, profiting from the spread between them.EdgeThe expected value of a strategy's trades — the statistical advantage that produces positive returns over a large number of repetitions.Loss AversionThe documented tendency for losses to be felt roughly twice as intensely as equivalent gains — causing traders to make irrational decisions to avoid realizing losses.Disposition EffectThe tendency to sell winning positions too early and hold losing positions too long — the most common behavioral pattern that degrades trading performance.Recency BiasThe tendency to overweight recent events when evaluating probability — making the last few trades feel more representative than they are.OverconfidenceThe documented tendency for traders to overestimate their ability to pick entries, time exits, and forecast markets — leading to excessive trading and underperformance.Tail RiskThe risk of extreme events that fall far outside the range of normal experience — events that backtests rarely capture because they haven't happened in the sample.Correlation BreakdownThe tendency for assets that move independently in normal markets to become correlated during crises — eliminating diversification exactly when it is needed most.Edge DecayThe tendency for profitable strategies to become less profitable over time as more participants discover and exploit the same inefficiency.Execution RiskThe gap between theoretical strategy performance and live performance caused by API latency, partial fills, platform outages, rate limiting, and order rejection.Sample SizeThe number of independent observations needed to distinguish a real pattern from random noise — small samples are unreliable, and most traders draw conclusions too early.Expected ValueThe probability-weighted average of all possible outcomes of a decision — the single number that determines whether a strategy makes or loses money over many repetitions.CompoundingThe exponential effect of consistent returns over time — small edges grow large, but small consistent losses destroy capital with equal force.Necessary vs. SufficientDiscipline is necessary for long-term trading success. It is not sufficient. A disciplined bot following a bad strategy loses money in an orderly fashion.Base Rate NeglectThe tendency to ignore the overall probability of an event when presented with specific, vivid evidence — leading to systematically overoptimistic assessments.Survivorship Bias in StrategiesThe distortion that occurs when evaluating strategies based only on the ones that survived — ignoring the many that were tested and discarded before the winner was found.

botwir3 Mechanics

How the runtime works

Spec HashA SHA-256 fingerprint of the strategy configuration — if any parameter changes, the hash breaks and the bot halts.Gate FunctionA configurable validation checkpoint that evaluates every proposed action against the strategy's constraints before it reaches the adapter.AdapterThe platform-specific translation layer that converts gate-approved actions into API calls for a given exchange, broker, or marketplace.LedgerAn append-only local log that records every proposed action, gate decision, and execution result — the bot's complete audit trail.Mandate Integrity ViolationA HALT condition triggered when the runtime detects that the strategy configuration file has been modified since compilation.HALT StateA terminal state where the bot stops executing — triggered by config tampering, execution mismatch, or three consecutive drift periods.Tolerance BandThe configurable range around the growth target within which the gate permits action — proposals that would push the portfolio outside this band are rejected.Growth TargetThe annualized return rate the strategy aims to achieve — the center of the tolerance band.Spec is LawThe design principle that the compiled spec is the sole authority — the bot does exactly what the spec says, nothing more, nothing less.Discipline ProvenThe verification output of botwir3 verify — confirming that every ledger entry adheres to the configured spec.Signal-Only ModeAn operating mode where the bot monitors and reports trade opportunities without executing — the user reviews signals and acts manually.Band ConfigurationThe set of parameters that define the strategy's operating envelope — growth target, tolerance, sizing mode, and Kelly multiplier.Build GateThe server-side authorization check that verifies a user has remaining builds before allowing a strategy compile.CompileThe process of freezing a strategy configuration into a downloadable runtime package with a sealed spec hash.WiredThe botwir3 term for a bot whose strategy, discipline layer, and platform connection are configured and operational.

Build your bot →