Betting Against Beta Stocks (C#)
Betting Against Beta Stocks Trading rules Align daily close dates across the universe and BenchmarkSecurity. Require WindowDays + 1 distinct common dates. Daily simple returns are r[d] = P[d] / P[d−1]...
Betting Against Beta Stocks
Trading rules
Align daily close dates across the universe and BenchmarkSecurity. Require WindowDays + 1 distinct common dates. Daily simple returns are r[d] = P[d] / P[d−1] − 1; beta = Σ((r − mean(r)) × (benchmark return − benchmark mean)) / Σ((benchmark return − benchmark mean)²). A zero benchmark variance delays allocation. Buy the lowest-beta Deciles bucket and short the highest, floor(universe count / Deciles) per side. There are no intraday beta thresholds, stop exits or beta-neutral leverage adjustments.
Evaluate only synchronized finished candles. Statistics count distinct UTC dates, replacing earlier intraday closes of the same date. Rebalance once on the first eligible synchronized candle of each month; an unformed input delays the decision. Equal scores are ordered by Security.Id.
For intraday CandleType, daily statistics use only UTC dates strictly before the current signal date. The incomplete current day is excluded. A finished one-day candle may contribute its own completed date.
Input data
PriceHistoryFile is an optional CSV of positive daily closes: SecurityId,Date,Close. Dates use yyyy-MM-dd. Current and future dates cannot prefill a decision; live finished closes replace each UTC date. Duplicate dates are rejected. It is needed to warm long lookbacks when the execution archive is short.
Parameters
| Parameter | Default |
|---|---|
Universe |
required |
Capital |
100000 |
Leverage |
1 |
MinTradeUsd |
100 |
CandleType |
TimeSpan.FromMinutes(5).TimeFrame() |
Deciles |
10 |
PriceHistoryFile |
optional — not supplied |
BenchmarkSecurity |
required |
WindowDays |
252 |
Execution
Set Universe explicitly. Prices and Capital use USD, with one price unit per traded unit. Capital is a fixed budget; Leverage controls gross exposure. No stop loss or take profit is added.
Long and short baskets each receive half of Capital × Leverage. Divide each side equally, convert USD to units at the signal close and round toward zero to VolumeStep. Reconcile against actual filled positions, wait for pending orders, respect MinVolume/MaxVolume and split large adjustments across later candles. MinTradeUsd filters small adjustments; full liquidation bypasses it.
Verification
Tests use only packaged BTC/TON execution history. Explicit financial reports, option observations and price warmup fixtures test mechanics; they are not actual company fundamentals or option-market history. Reduced lookbacks, two buckets and March annual scheduling are identified test profiles, not proof of trading at unchanged long-horizon defaults. No return or profitability claim is made.
I answer from what this page says. For anything else I will point you to the documentation.