Edge Analysis

Where Does the Result Come From?

Beating a stock index (such as WIG or SPX) can come from different things: picking better stocks, being in the market at the right time, taking less risk, or putting more money into the positions that do best. Edge analysis splits the result into these parts with four cards:

  • Jensen's alpha: how much more do you earn than the index would at your risk, and does it come from stock picking, timing or cash?
  • Sharpe & Treynor: do you earn more than the index per unit of risk, and is it thanks to a higher return or a lower risk?
  • Held stocks vs index: did the stocks themselves beat the index, whatever the position sizes?
  • Position size effect: did your position sizes help, compared with equal positions?
Edge analysis with four cards: Jensen's alpha, Sharpe and Treynor, Held stocks vs index and Position size effect

The screenshots on this page show a sample portfolio built from a backtest of the BuyATH example strategy on the Warsaw Stock Exchange, from January 2020 to November 2026, with about 170 trades.

Opening Edge Analysis

  • Your portfolio: on the Portfolio screen, click the Edge analysis tab. It is calculated again after you add trades or load new market data.
  • A backtest: after a backtest finishes, click Edge analysis… in the panel on the left. The cards open in a window.
  • A walk-forward: after a walk-forward finishes, click Edge analysis… in the panel on the left. It analyses the trades of the test windows.

Reading the Cards

  • Bridge charts start at the index's value, add the effects one by one (green helps, red hurts) and end at your account's value.
  • Excess return is the return above the risk-free rate (the NBP reference rate), in percent per year. Jensen's alpha, beta and the Sharpe and Treynor ratios are the same as in the statistics.
  • The orange line charts show by how many percent one thing is ahead of another (negative: behind). Their scale is logarithmic: the same distance on the chart means the same relative gain, whether it happened in the first year or in the last one. Point at a chart to see the values of a session; when you move the pointer away, the legend shows the values of the last session.
  • Click ? next to a title for a short explanation.
  • The index has to be in the loaded market data. Alis now uses WIG, which comes with the Polish market data.
Explanation of the Sharpe and Treynor card opened with the question mark button

The Four Cards

Jensen's Alpha

Your excess return is split into what the index would give at your beta (Index × beta) and Jensen's alpha: the rest. Beta tells how strongly your account moves with the index; at beta 0.5 the index would give half of its excess return. The alpha is split further:

  • Stock selection: how much your stocks beat the index at the part of the account invested in each session.
  • Timing: how much you gained by changing the invested part instead of keeping your average beta. It is positive when you are invested on rising days and in cash on falling ones.
  • Cash: the risk-free return that the cash part misses, as cash in Alis earns no interest.

For example, an account that is fully invested on the day the index rises 2 % and in cash on the day it falls 2 % has beta 0.5 and an alpha of 1 % a day, all of it from timing. An account that is always fully invested in stocks that do 1 % a day better than the index has beta 1 and the same alpha, all of it from stock selection.

Jensen's alpha: what the index gives at the portfolio's beta, stock selection, timing and cash, adding up to the portfolio's excess return

Example: at beta 0.59 the index would have given the sample portfolio 7.1 % a year above the risk-free rate; the portfolio made 29.2 %. Its alpha of 22.0 % a year comes almost entirely from stock selection (+22.9 %). The portfolio was invested most of the time, so timing (−0.7 %) and cash (−0.2 %) changed little.

Sharpe & Treynor

Both ratios divide the excess return by the risk: the Sharpe ratio by the volatility (all the ups and downs of the account), the Treynor ratio by the beta (only the part that moves with the index). The index has beta 1, so its Treynor ratio is its excess return. The table shows the excess return, volatility, beta and both ratios of your account and of the index.

Below it, two bridge charts split the difference between your ratio and the index's into the effect of your excess return and the effect of your risk (volatility in the Sharpe ratio, beta in the Treynor ratio). Each effect is taken at the average of the other, so the order does not matter. When the average excess return is negative, lower risk makes the ratios lower, not higher.

Sharpe and Treynor: table of the portfolio and the index, and bridge charts from the index's ratios to the portfolio's

Example: the sample portfolio made 29.2 % a year above the risk-free rate, the index 13.2 %, and the portfolio was slightly more volatile (22.6 % a year against 21.2 %). The return lifts the Sharpe ratio and the volatility takes a little of it back: 0.62 for the index, +0.73 from the return, −0.06 from the volatility, 1.29 for the portfolio. The Treynor ratio is 49.0 % against 13.2 %: +21.4 from the return and +14.4 from the low beta.

How can the risk be higher while the beta is low? Beta is the correlation with the index times the ratio of the volatilities, so a beta of 0.59 at a volatility higher than the index's means a low correlation (here 0.56): most of the portfolio's ups and downs do not move with the index. The Treynor ratio leaves that risk out, the Sharpe ratio counts it. If the account is all your money, look at the Sharpe ratio; if it is a small part of a well diversified wealth, the Treynor ratio tells more.

Held Stocks vs Index

The stocks you hold, while you hold them, as if every position started at the same share of the account and was then held: it grows and shrinks with its price, and buying more or selling part of it does not change it. Each session, from open to open, these positions are compared with the index and the results are added up. Days without stocks add nothing, and commissions are not included.

This is the cleanest measure of stock picking: it shows whether the stocks you choose beat the index, without the effects of cash, position sizes and costs. The positions are not brought back to equal weights every day: on rarely traded stocks, whose prices jump between bids and offers, that would show gains no one could make.

Held stocks vs index: how many percent equal positions in the held stocks are ahead of the index

Example: the stocks held by the sample portfolio are 306 % ahead of the index. Most of it was made in 2020 (+109 %) and 2021 (+40 %); in 2023 and 2024 the stocks did worse than the index (−7 % and −5 %). The lead peaked at +370 % in October 2026.

Position Size Effect

Your positions (the value of the shares you hold) are compared with equal positions in the same stocks, as in Held stocks vs index, from open to open. The chart shows how many percent your position sizes made more than equal positions would (negative: less). It changes with how much you buy, buy more and sell: it rises when your larger positions do better than the smaller ones. Positions bought at the same share of the account and then held leave it at zero.

Position size effect: the held stocks at the real position sizes against equal positions

Example: BuyATH sizes each position by how much the stock rose over the last month (20 sessions): 10 % of the account for no rise, down to 5 % for a rise of 30 % or more. At first this cost money: in 2020 the stocks that had just risen most kept rising, and in October 2020 the sizes were 11.6 % behind equal positions. From then until early 2022 the smaller positions in stocks that had just jumped paid off; from 2022 to 2025 the sizes changed little, and in 2026 they added 4.5 %. In the end the sample portfolio's sizes made 8.2 % more than equal positions in the same stocks would.

How to Use It

  • Held stocks vs index is high, but stock selection in Jensen's alpha is low: the stocks are good, but something eats the result, such as commissions or prices worse than the open.
  • Most of the alpha comes from timing: you gain by being invested when the index rises and in cash when it falls, not by picking stocks that beat the index. Such gains often come from sitting out one or two big falls of the market, and one well-timed exit can be luck. Backtest other periods, or run a walk-forward, to see whether timing helped in more than one fall.
  • Cash takes away much of the alpha: much of the account sits idle, and idle cash earns nothing in Alis.
  • The Treynor ratio is far above the index's, but the Sharpe ratio is not: your volatility (the standard deviation of your returns) is probably too high for your return. With a low beta, most of it does not come from the index but from the stocks you hold, for example from too few or too large positions. The Treynor ratio leaves this risk out, the Sharpe ratio counts it. It matters little if the account is a small part of a larger, diversified wealth, where such ups and downs even out, but if the account is all your money, more or smaller positions may give a better Sharpe ratio.
  • Position size effect is negative most of the time: your way of sizing positions does not help; equal positions are simpler and would do better.
  • Check when the edge was made. A curve that rises only in one period is weaker evidence than a curve that rises steadily.
  • Short histories are noisy. After three years of data a Sharpe ratio is only known to within about ±0.7, so a small difference from the index's means little.
  • Most indexes are dominated by large companies. A strategy that trades small companies can beat the index simply because small companies did better in that period, not because it picks well.
× Enlarged documentation screenshot