Low Volatility Stocks Strategy (C#)

by StockSharp

Low Volatility Stocks Trading rules Compute simple daily returns r[d] = P[d] / P[d−1] − 1 over VolWindowDays intervals using VolWindowDays + 1 completed daily closes. Volatility is the sample standard...

815 Downloads
☆☆☆☆☆ Rating
0 Reviews
Low Volatility Stocks Strategy (C#)

Low Volatility Stocks

Trading rules

Compute simple daily returns r[d] = P[d] / P[d−1] − 1 over VolWindowDays intervals using VolWindowDays + 1 completed daily closes. Volatility is the sample standard deviation sqrt(Σ(r−mean(r))² / (VolWindowDays−1)). Every month long the lowest-volatility Deciles bucket and short the highest, floor(eligible count / Deciles) securities per side. Equal USD exposure per side; no benchmark spread, trend gate or intraday volatility threshold.

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.

All observations must be published by the signal candle close. Intraday execution uses daily prices strictly before its UTC date; a finished one-day candle contributes its own completed date. Never warm a decision with future CSV dates.

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 200
CandleType TimeSpan.FromDays(1).TimeFrame()
PriceHistoryFile optional — not supplied
VolWindowDays 60
Deciles 10

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 run both languages using packaged BTC/TON execution data and explicit rate, financial, score, text and warmup fixtures. Calendar fixtures relocate archive OHLC/volume and provide deterministic execution quotes; they are not multi-year market history. Independent formulas, order direction/size, actual fills, residual positions and forbidden decision dates are checked. Two buckets, K=1 and AssetDecile=1 are declared mechanics profiles, not evidence of the complete production universe. No profitability claim is made.

User Reviews

Login to write a review

No reviews yet