Win Rate With Its Error Bar (Wilson 95%)

79
A win rate is a measurement, and a measurement on a few dozen trades has an error bar that strategy reports don't print. This script puts it on the chart.

It trades one deliberately dull rule bar by bar: long when the close crosses above a simple moving average, out when it crosses back below, measured at the signal bar's close with no commissions or slippage. Every closed trade counts as a win or a loss, and a flat exit counts as a loss.

Blue is the running win rate. The teal band is its Wilson 95% score interval. Red is the breakeven win rate implied by the rule's own payoff so far, 1 / (1 + average win / average loss), or a fixed value you choose.

Two things worth watching. The band narrows slowly: halving its width takes roughly four times the trades, because it shrinks with the square root of the count. And the question that matters is not where the blue line is but whether the bottom of the band has cleared the red one. The table shows the closed-trade count, the interval, and how many trades the current win rate would need before the lower end clears breakeven.

Open source so you can swap in your own rule and watch the same arithmetic. Arithmetic on your chart, not a result of mine. Nothing here is investment advice.

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.