Chapter 14 Exercises: Binary Outcome Trading Strategies
Section A: Conceptual Foundations (Exercises 1-8)
Exercise 1: Strategy Classification
Difficulty: Beginner
Classify each of the following trading scenarios into the most appropriate strategy category (fundamental, event-driven, mean reversion, closing-the-gap, momentum, contrarian, or news/sentiment):
a) A trader notices that a prediction market for a Senate race has been trading at 0.72 for three weeks despite multiple polls showing the candidate at 80%+ probability. The election is in 5 days.
b) A trader sees the price of a "Will Company X be acquired?" contract spike from 0.30 to 0.55 on no identifiable news, with low volume.
c) A trader builds a model combining historical election data, economic indicators, and demographic trends to estimate the probability of a candidate winning at 0.62, while the market trades at 0.55.
d) A trader notices that a prediction market contract has moved from 0.50 to 0.65 over three days with steadily increasing volume, and several smaller contracts in the same category are also moving in the same direction.
e) A trader sees a contract drop from 0.60 to 0.45 after a negative news cycle, but historical analysis shows that similar news events typically only warrant a 5-cent move, not a 15-cent move.
f) A trader learns that a key regulatory decision will be announced tomorrow at 2:00 PM and positions before the announcement based on their reading of the regulatory environment.
Exercise 2: Edge Calculation
Difficulty: Beginner
For each scenario, calculate the raw edge, the edge after transaction costs (assume 2 cents per contract), and determine whether a trade is warranted:
a) You estimate the true probability of YES at 0.65. The market price is 0.58. b) You estimate the true probability of YES at 0.40. The market price is 0.45. c) You estimate the true probability of YES at 0.82. The market price is 0.80. d) You estimate the true probability of YES at 0.15. The market price is 0.22.
For each trade that is warranted, calculate the Kelly fraction and the half-Kelly position size as a percentage of a $10,000 bankroll.
Exercise 3: Strategy Applicability
Difficulty: Beginner
For each of the following market conditions, rank the strategies from most to least appropriate and explain your reasoning:
a) A brand-new prediction market on an obscure municipal election with no trading history and very low liquidity. b) A highly liquid presidential election market with 6 months until election day. c) A sports prediction market 30 minutes before game time with heavy volume. d) A prediction market on a regulatory decision that was expected to be announced 2 days ago but has been delayed.
Exercise 4: Risk-Reward Analysis
Difficulty: Beginner
A binary contract is trading at 0.70. You believe the true probability is 0.80.
a) What is the maximum profit per contract if you buy YES? b) What is the maximum loss per contract if you buy YES? c) What is the risk-reward ratio? d) What is the expected value per contract? e) If transaction costs are $0.02 per contract, what is the breakeven probability you need to believe in for a YES purchase at 0.70?
Exercise 5: Mean Reversion Basics
Difficulty: Beginner
A binary contract has the following price history over 10 periods:
| Period | Price |
|---|---|
| 1 | 0.50 |
| 2 | 0.52 |
| 3 | 0.48 |
| 4 | 0.51 |
| 5 | 0.49 |
| 6 | 0.50 |
| 7 | 0.53 |
| 8 | 0.47 |
| 9 | 0.50 |
| 10 | 0.62 |
a) Calculate the 5-period moving average at period 10. b) Calculate the 5-period standard deviation at period 10. c) Calculate the Z-score at period 10. d) Would a mean-reversion strategy with a Z-score threshold of 2.0 fire a signal? What direction? e) What additional information would you want before acting on this signal?
Exercise 6: Closing-the-Gap Identification
Difficulty: Beginner
You are scanning markets with the following characteristics. For each, determine whether it is a good closing-the-gap candidate and explain why or why not:
a) Market: "Will the sun rise tomorrow?" Price: 0.93. Expiry: 12 hours. b) Market: "Will Team A win the championship?" Price: 0.75. Expiry: 3 months. Team A is currently leading the league. c) Market: "Will Senator X vote for the bill?" Price: 0.88. Expiry: 2 days. Senator X has publicly stated support and the bill is scheduled for a vote. d) Market: "Will it snow in July in Miami?" Price: 0.08. Expiry: 1 day (it is July 30).
Exercise 7: Momentum vs. Contrarian
Difficulty: Beginner
Explain the conditions under which you would choose a momentum strategy over a contrarian strategy, and vice versa. Address:
a) Time horizon b) Volume characteristics c) News environment d) Price level (near 0.50 vs. near extremes) e) Market maturity
Exercise 8: Transaction Cost Impact
Difficulty: Beginner
A closing-the-gap trader identifies 50 opportunities with an average edge of 4 cents per contract, trading 100 contracts each. The transaction cost is 1.5 cents per contract per trade (both entry and exit).
a) What is the gross expected profit across all 50 trades? b) What are the total transaction costs? c) What is the net expected profit? d) If 5 of the 50 trades lose (outcome goes against the trader) and the average loss per losing trade is 85 cents per contract, what is the total actual profit or loss? e) What minimum edge per contract is needed to be profitable after costs, assuming a 10% loss rate with 85-cent average losses?
Section B: Quantitative Analysis (Exercises 9-16)
Exercise 9: Fundamental Model Construction
Difficulty: Intermediate
Build a simple fundamental model for a prediction market on "Will GDP growth exceed 3% next quarter?"
You have the following data: - Historical base rate: GDP exceeded 3% in 35% of quarters over the past 40 years - Current ISM Manufacturing Index: 55.2 (above 50 indicates expansion; historical correlation with 3%+ GDP: when ISM > 55, GDP exceeds 3% about 55% of the time) - Current consumer confidence: 98 (above average of 85; when above 95, GDP exceeds 3% about 48% of the time) - Leading economic indicators: +0.3% month-over-month (positive is bullish; when LEI > 0.2%, GDP exceeds 3% about 50% of the time)
a) Using Bayesian updating, combine these three signals with the base rate to estimate the probability. b) The market price is 0.42. Is there a trade? c) How sensitive is your estimate to the weights assigned to each component? d) Write Python code to perform this calculation.
Exercise 10: Bollinger Band Calibration
Difficulty: Intermediate
You are calibrating a Bollinger Band analog for a binary prediction market.
Given the following 20-period price series:
[0.50, 0.52, 0.51, 0.53, 0.54, 0.52, 0.55, 0.53, 0.54, 0.56,
0.55, 0.57, 0.56, 0.58, 0.57, 0.59, 0.58, 0.60, 0.59, 0.61]
a) Calculate the 20-period simple moving average. b) Calculate the 20-period standard deviation. c) Calculate the theoretical standard deviation for a binary variable at the mean price level. d) Should you use the observed or theoretical standard deviation for the bands? Explain. e) Calculate the upper and lower bands using a 2-standard-deviation threshold. f) If the next price observation is 0.68, would a mean-reversion signal fire?
Exercise 11: Kelly Criterion Application
Difficulty: Intermediate
You have identified three trading opportunities:
| Market | Your Estimate (q) | Market Price (p) | Correlation with Others |
|---|---|---|---|
| A | 0.70 | 0.60 | -- |
| B | 0.35 | 0.45 | 0.3 with A |
| C | 0.80 | 0.72 | 0.1 with A, 0.2 with B |
a) Calculate the full Kelly fraction for each trade. b) Calculate the half-Kelly fraction for each trade. c) With a $10,000 bankroll, how much should you allocate to each trade using half-Kelly? d) What is the total capital at risk? e) If all three trades lose, what is the total loss? Is this acceptable? f) How would you adjust position sizes to account for the correlations between markets?
Exercise 12: Event-Driven Scenario Analysis
Difficulty: Intermediate
A major debate is scheduled for tomorrow evening. The current market prices for "Will Candidate A win the election?" are:
- Pre-debate price: 0.55
- Your model estimates the following debate outcomes and their effects:
| Debate Outcome | Probability | Post-Debate Fair Price |
|---|---|---|
| A wins clearly | 0.25 | 0.65 |
| A wins slightly | 0.30 | 0.58 |
| Draw | 0.20 | 0.54 |
| B wins slightly | 0.15 | 0.50 |
| B wins clearly | 0.10 | 0.42 |
a) What is the expected post-debate price? b) Is there an edge in buying YES at 0.55 before the debate? c) What is the expected profit per contract from a pre-debate YES purchase? d) What is the expected profit per contract from a pre-debate NO purchase? e) What is the variance of the post-debate price? f) If you want to trade post-debate reaction only, describe your plan for each outcome scenario.
Exercise 13: Convergence Edge Calculation
Difficulty: Intermediate
A binary contract will resolve in 7 days. The current price is 0.82. You estimate the true probability at 0.92.
a) Calculate the raw edge. b) Calculate the edge per day. c) If transaction costs are 2 cents, what is the net edge? d) Calculate the annualized return on the capital at risk (assuming the trade works out). e) Using the convergence formula $\text{Edge}(T) = |q - p_t| \cdot (1 - e^{-\lambda T})$, with $\lambda = 0.5$ per day, what edge would you expect to capture? f) What is the maximum number of such trades you can run simultaneously with a $5,000 bankroll if you limit each position to 3% of capital?
Exercise 14: Momentum Signal Evaluation
Difficulty: Intermediate
A prediction market has shown the following daily closing prices and volumes over the past 15 days:
| Day | Price | Volume |
|---|---|---|
| 1 | 0.45 | 500 |
| 2 | 0.46 | 550 |
| 3 | 0.48 | 700 |
| 4 | 0.47 | 450 |
| 5 | 0.49 | 600 |
| 6 | 0.51 | 800 |
| 7 | 0.52 | 750 |
| 8 | 0.54 | 900 |
| 9 | 0.53 | 500 |
| 10 | 0.55 | 850 |
| 11 | 0.57 | 950 |
| 12 | 0.58 | 1000 |
| 13 | 0.60 | 1100 |
| 14 | 0.59 | 600 |
| 15 | 0.61 | 900 |
a) Calculate the 5-day and 10-day simple moving averages for the most recent day. b) Is there a bullish crossover (5-day SMA above 10-day SMA)? c) Calculate the volume-weighted momentum for the last 5 days. d) Does the volume pattern confirm or contradict the price momentum? e) At what price level would you become cautious about continued momentum? Why?
Exercise 15: Contrarian Signal Analysis
Difficulty: Intermediate
A prediction market drops from 0.60 to 0.42 in 3 hours after a negative news story. The 20-period average price is 0.58 with a standard deviation of 0.04.
a) Calculate the Z-score of the current price relative to the 20-period average. b) Is this a potential contrarian opportunity? Why or why not? c) What additional information would help you distinguish between an overreaction and a legitimate price adjustment? d) If you decide to take a contrarian position (buy at 0.42), calculate the expected profit if the price reverts halfway back to the mean. e) What stop-loss level would you set, and what is the risk-reward ratio? f) What percentage of your bankroll would you allocate to this trade?
Exercise 16: Multi-Strategy Combination
Difficulty: Intermediate
Three strategies generate the following signals for the same market:
| Strategy | Direction | Confidence | Weight |
|---|---|---|---|
| Fundamental | +0.60 (buy YES) | 0.80 | 0.40 |
| Mean Reversion | -0.30 (mild sell) | 0.50 | 0.25 |
| Momentum | +0.45 (buy YES) | 0.65 | 0.35 |
a) Calculate the weighted combined signal. b) Measure the strategy agreement (what fraction of strategies agree on direction?). c) What conflict level would you assign? d) What position size factor would you use? e) What action would you recommend, and why? f) If the fundamental signal's confidence drops to 0.40 (the analyst is less certain), how does the combined signal change?
Section C: Strategy Implementation (Exercises 17-22)
Exercise 17: Build a Polling Model
Difficulty: Intermediate
Write a Python function that:
a) Takes a list of polls, each with (candidate_a_pct, candidate_b_pct, sample_size, pollster_quality) b) Calculates a weighted average margin, weighting by sqrt(sample_size) * pollster_quality c) Converts the margin to a win probability using a logistic function d) Returns the estimated probability with a 95% confidence interval
Test your function with the following polls: - Poll 1: A=48%, B=46%, n=1000, quality=0.9 - Poll 2: A=51%, B=44%, n=800, quality=0.7 - Poll 3: A=47%, B=48%, n=1500, quality=0.95 - Poll 4: A=50%, B=45%, n=600, quality=0.6
Exercise 18: Mean Reversion Backtester
Difficulty: Intermediate
Write a Python program that:
a) Generates 500 simulated price observations for a binary contract using a random walk with drift: - Start at 0.50 - Each period: $p_{t+1} = p_t + 0.001 + \epsilon$ where $\epsilon \sim N(0, 0.02)$ - Clip to [0.01, 0.99]
b) Applies a mean-reversion strategy with Z-score threshold = 2.0 and 20-period lookback
c) Holds each position for 5 periods, then exits
d) Reports: - Number of trades - Win rate - Average profit per winning trade - Average loss per losing trade - Total profit/loss
e) Run 100 simulations and report the distribution of outcomes. What percentage of simulations are profitable?
Exercise 19: Event Calendar System
Difficulty: Intermediate
Design and implement a Python class that:
a) Maintains a calendar of upcoming events with dates, impact levels, and affected markets b) Generates alerts when events are approaching (24h, 4h, 1h before) c) Tracks historical event impacts (how much did the market actually move vs. expected?) d) Learns from historical impacts to improve future impact estimates
Populate it with at least 5 realistic events for a hypothetical election market and demonstrate all four features.
Exercise 20: Closing-the-Gap Scanner
Difficulty: Advanced
Build a complete closing-the-gap scanner in Python that:
a) Generates 100 simulated binary markets with random parameters: - Time to expiry: 1-30 days - True probability: drawn from Beta(2, 2) distribution - Market price: true probability + noise from N(0, 0.05), clipped to [0.01, 0.99] - Volume: randomly assigned (high, medium, low) - Staleness: randomly assigned
b) Scans all markets for closing-the-gap opportunities (edge > 3 cents after costs)
c) Ranks opportunities by edge per day
d) Simulates investing across the top 20 opportunities with equal weighting
e) Resolves each market (using the true probability to determine outcome) and reports portfolio performance
f) Run 1000 iterations and plot the distribution of portfolio returns
Exercise 21: Sentiment Analyzer
Difficulty: Advanced
Create a Python sentiment analysis pipeline that:
a) Takes a list of news headlines related to a prediction market b) Assigns sentiment scores using a keyword-based approach (you may use a predefined dictionary of positive and negative words) c) Weights by recency and source credibility d) Computes an aggregate sentiment score e) Generates a trading signal if the sentiment diverges from the current market price f) Backtests the signal on simulated data
Use at least 20 sample headlines and demonstrate the full pipeline.
Exercise 22: Walk-Forward Backtest
Difficulty: Advanced
Implement a walk-forward backtesting framework in Python that:
a) Splits a 252-period simulated price series into overlapping training (60 periods) and testing (20 periods) windows b) In each training window, optimizes the lookback period for a mean-reversion strategy (testing values 10, 15, 20, 25, 30) c) In each testing window, applies the optimized parameter and records trades d) Reports out-of-sample performance across all test windows e) Compares the walk-forward results to a naive in-sample backtest on the full dataset
Discuss the difference in performance and what this tells you about overfitting.
Section D: Advanced Analysis (Exercises 23-30)
Exercise 23: Strategy Correlation Matrix
Difficulty: Advanced
Using simulated data, generate signals from four strategies (fundamental, mean reversion, momentum, contrarian) across 50 simulated markets.
a) Calculate the pairwise correlation matrix of signals. b) Identify which strategy pairs are most and least correlated. c) Using the correlation matrix, construct an optimal weighting scheme that minimizes portfolio signal variance while maintaining a minimum expected signal strength. d) Compare the risk-adjusted performance of the equally weighted vs. optimally weighted strategy combination.
Exercise 24: Regime Detection
Difficulty: Advanced
Binary prediction markets exhibit different "regimes" (calm, trending, volatile). Build a regime detector in Python that:
a) Classifies each time period into one of three regimes based on price volatility and directional movement b) Evaluates which strategies perform best in each regime c) Develops a meta-strategy that switches between strategies based on the current regime d) Backtests the meta-strategy and compare it to each individual strategy
Exercise 25: Market Microstructure Analysis
Difficulty: Advanced
A binary prediction market has the following order book:
| Bid Price | Bid Size | Ask Price | Ask Size |
|---|---|---|---|
| 0.58 | 200 | 0.62 | 150 |
| 0.56 | 350 | 0.63 | 100 |
| 0.55 | 500 | 0.65 | 300 |
| 0.53 | 200 | 0.67 | 200 |
| 0.50 | 1000 | 0.70 | 500 |
a) What is the mid-price? b) What is the bid-ask spread? c) If you want to buy 400 contracts of YES, what is your volume-weighted average price? d) What is the slippage relative to the best ask? e) What is the market impact of your order (mid-price before vs. implied mid-price after)? f) How does this affect the minimum edge required for a profitable trade?
Exercise 26: Risk of Ruin Simulation
Difficulty: Advanced
Write a Monte Carlo simulation in Python that:
a) Simulates a trader making 1000 binary trades with: - Win probability: 0.58 - Payoff per win: 0.40 (bought YES at 0.60) - Loss per loss: 0.60 (bought YES at 0.60) - Starting bankroll: $10,000
b) Tests four position sizing strategies: - Fixed $100 per trade - 2% of current bankroll per trade - Full Kelly - Half Kelly
c) For each strategy, run 10,000 simulations and report: - Median final bankroll - Probability of ruin (bankroll dropping below $100) - 5th percentile final bankroll - 95th percentile final bankroll
d) Plot the distribution of final bankrolls for each strategy.
Exercise 27: Information Decay Analysis
Difficulty: Advanced
After a major news event, prediction market prices adjust over time. Model this process:
a) Simulate the information decay process using: $p_t = p_{\infty} + (p_0 - p_{\infty}) \cdot e^{-\lambda t}$ where $p_0$ is the price immediately after news, $p_{\infty}$ is the long-run fair value, and $\lambda$ is the decay rate.
b) Using $p_0 = 0.70$, $p_{\infty} = 0.60$, and $\lambda = 0.5$ per hour, plot the expected price path over 12 hours.
c) Add noise to the process and simulate 100 paths.
d) At what time does a contrarian trader who fades the initial overreaction maximize expected profit?
e) How does the optimal entry time change with different $\lambda$ values?
Exercise 28: Portfolio Optimization
Difficulty: Advanced
You have identified edges in 10 binary markets. Each has a different estimated edge, time to expiry, and correlation structure.
| Market | Edge | Time to Expiry (days) | Risk (entry price) |
|---|---|---|---|
| M1 | 0.08 | 3 | 0.65 |
| M2 | 0.05 | 7 | 0.45 |
| M3 | 0.12 | 2 | 0.88 |
| M4 | 0.04 | 14 | 0.30 |
| M5 | 0.06 | 5 | 0.55 |
| M6 | 0.09 | 1 | 0.72 |
| M7 | 0.03 | 21 | 0.40 |
| M8 | 0.07 | 4 | 0.60 |
| M9 | 0.10 | 3 | 0.80 |
| M10 | 0.05 | 10 | 0.50 |
Assume correlations: M1-M2: 0.6, M3-M6-M9: 0.4 (same category), all others: 0.1.
a) Calculate the edge per day for each market. b) Rank by edge per day. c) With a $20,000 bankroll and a 5% per-position limit, determine the optimal allocation. d) Calculate the expected portfolio return and risk. e) What is the worst-case scenario (all correlated trades lose)?
Exercise 29: Strategy Decay Analysis
Difficulty: Intermediate
Prediction market strategies may lose effectiveness over time as more traders discover them.
a) Describe three mechanisms through which strategy alpha can decay. b) For each strategy type covered in this chapter (fundamental, event-driven, mean reversion, closing-the-gap, momentum, contrarian, news/sentiment), assess the vulnerability to alpha decay. Which strategies are most resilient? Which are most fragile? c) What can a trader do to combat alpha decay? d) Design a monitoring system (describe in pseudocode) that detects when a strategy's performance is deteriorating.
Exercise 30: Complete Trading System Design
Difficulty: Advanced
Design a complete trading system for binary prediction markets that integrates all concepts from this chapter. Your design should include:
a) Data Pipeline: What data sources do you need? How do you ingest and store them? b) Signal Generation: Which strategies do you include? How are they parameterized? c) Signal Combination: How do you combine signals from multiple strategies? d) Risk Management: Position sizing, portfolio limits, correlation constraints. e) Execution: How do you execute trades? What order types do you use? f) Monitoring: How do you track performance in real time? g) Backtesting: How do you validate the system before going live?
Write a detailed specification document (1-2 pages) and implement the core signal combination and risk management modules in Python. Include at least one unit test for each module.