Sitemap
Towards AI

We train AI Engineers. We deploy Enterprise AI. Join 100K+ AI practitioners at Towards AI Academy or reach out for help making your company AI native. towardsai.com

Binomial Evolution Function (The Only Function You Need to Evaluate a Trading Strategy)

11 min readJun 3, 2025

--

ABSTRACT: A trading strategy represents a forecasting model and a forecasting model will generate profits in the future if it has demonstrated in the past that it can predict with a good probability of success the evolutions of the system on which it operates. Since the theory is so simple, why is it so difficult to evaluate a trading strategy? The reason is the following: in finance, we think we see the evolutions of the system but we are only observing the random component due to unpredictable events. Instead, the deterministic component that represents the true evolution of the system is not visible. Unfortunately, not seeing the deterministic component leads to a very important statistical problem: if I execute 10 winning predictions, I do not know if these operations concern 10 evolutions of the system or concern only one evolution of the system. Therefore, I do not know, if my forecasting algorithm acted intelligently by predicting 10 different evolutions or if it acted irrationally by dividing a bet into 10 smaller ones on the same evolution. Distinguishing between these two scenarios is essential to correctly evaluate the trading strategy and this discrimination can be done by understanding whether the trades are independent of each other. In fact, the condition of independence is the only statistical way to be sure that the trades concern forecasts of different evolutions. The Binomial evolution function solves this problem by transforming the succession of trades into a succession of independent results.

Introduction

The key to understanding whether an investment strategy can generate profits in the future is to shift the focus from the simple result (profit/loss) to the ability of the algorithm to predict the evolution of the market, under the assumption that markets are non-stationary [1][2]. Being “non-stationary” implies that operations are dependent on each other (market dynamics change over time), and consequently the data collected could lose statistical significance if treated as independent. When dependencies unknown to us are created, traditional statistical analysis risks leading to incorrect conclusions.

Consequently, the main goal of any function that wants to make a qualitative analysis about a trading algorithm is to transform the results into a series of independent data.

The Binomial evolution function solves this problem by transforming the succession of trades into a succession of independent outcomes. The data are then analyzed using the binomial distribution that allows us to calculate the probability of obtaining an equal or greater number of successes through a purely random process. The probability value obtained in this way turns out to be a statistically correct evaluation of the investment strategy.

Transformation of the Trade Series

The first step in obtaining a sequence of independent trades consists in applying the following transformation: if we have N forecasts on a system with K degrees of freedom, our predictions must be transformed into a series in which each forecast “bets” on a different evolution from the one immediately preceding it.

In the case of financial markets, there are two degrees of freedom: up (buy) or down (sell). 1 Consequently, in our new series, there should never be two consecutive operations of the same type (two buys or two sells). Therefore, the sequence must alternate buy and sell. From a practical point of view, this transformation is applied by inserting an opposite operation between two consecutive trades in the same direction. If, for example, we have two consecutive buys with a time interval ΔT between the closing of the first and the opening of the second, a sell trade of duration equal to ΔT is introduced in between.

Why this transformation? 

  1. If after a bullish phase (buy) we think that the trend has ended, inserting a test opposite operation (sell), for the period ΔT, allows us to test our hypothesis of “end of trend”. 
  2. If the market actually remains bullish, this intermediate operation will have a probability of loss greater than 50%. If, on the other hand, our assumption is correct and the bullish trend is over, the intermediate sell trade will have a probability of success that approaches 50%.

In conclusion, each intermediate operation inserted tests the hypothesis that the two consecutive operations (in the same direction) are truly independent.

Convert to a binary sequence

After creating the new sequence of operations (all alternating), we proceed to convert it into a binary sequence:

  • We assign the value 1 to the trades closed in profit.
  • We assign the value 0 to the trades closed in loss.

This additional step is necessary to not overestimate the impact of some individual results that may depend on random market events. By making each operation equal, we reduce the effect of large gains or isolated losses.

Selection of Independent Trades

In this phase, we identify the trades that we are sure are independent. In practice, this is done by selecting only the trades that were executed on different market evolutions. In this way, each trade represents an independent forecast with respect to the previous one.

To make this selection, we use the binary sequence of 0 and 1 obtained in the previous steps, where each symbol represents the result of a trade (for example, 1 for profit and 0 for loss). If a 0 is preceded by another 0, or a 1 is preceded by another 1, then we can be sure that the second trade refers to a different evolution of the market. This is because the system, by construction, generates alternating forecasts (buy/sell). Therefore, obtaining two consecutive equal results implies that the market must have changed.

Consequently, the principle on which this method is based is the following: two equal and opposite predictions cannot give the same outcome if the system has remained unchanged.

Conversely, if a 0 is preceded by a 1 or a 1 is preceded by a 0, the two results may be compatible with a stationary market situation. In this case, we cannot be sure that the two trades refer to distinct 2 evolutions, so we consider them potentially dependent and exclude them from further analysis.

At the end of this process, only independent trades remain, those that we are sure will be executed on different evolutions of the system.

Therefore, when we want to study a deterministic process, every time it determines a change in the system, we have the possibility of making a prediction on the evolution of the system whose probability of success randomly turns out to be less than 1. This leads to a decrease in the composite probability whose meaning, according to the axiom of disorder of Von Mises, is to indicate the presence of a deterministic process that acts on the system.

In practice, every time a deterministic process causes a change in the state of the system, it can be detected by making a prediction [3]. Consequently, a deterministic process to be detected with a low error must have produced a statistically significant number of variations in the system. Furthermore, our forecasting method must have made a sufficiently large number of independent predictions, each corresponding to a single evolution of the system.

Randomness test using the Binomial distribution

Finally, we calculate the probability of obtaining an equal or greater number of successes through a purely random process, as if we were tossing a fair coin (probability 50%). For this purpose, we use the binomial distribution, where:

  • k is the number of successes (trades with value 1).
  • n is the total number of trades.
  • p is equal to 50% (assuming fair coin).

If the probability of observing similar or better results randomly is very low, it means that the algorithm has a good chance of being deterministic (able to predict the market). On the contrary, if the results can be obtained easily through a random process, we have no sufficient statistical reason to consider it capable of generating profits in the future.

Summary of the 4 fundamental steps of the Binomial evolution function

Step 1: Transformation of the Trade Series

Purpose: To test whether two consecutive forecasts of the same type (two buys or two sells) are truly independent.

Method: 

  1. The trade sequence is transformed by always alternating buy and sell. 
  2. If there are two consecutive buys or sells, an opposite “test” operation is inserted between the two, of the same duration as the waiting time between them (ΔT).

Example:

Original sequence:

Buy — ΔT1 — Buy — ΔT2 — Buy — ΔT3 — Buy

Transformed sequence:

Buy — Sell(ΔT1) — Buy — Sell(ΔT2) — Buy — Sell(ΔT3) — Buy

Step 2: Convert to binary sequence

Purpose: To prevent a single large gain (or loss) from influencing the statistical analysis.

Method:  Each trade is converted to: o

  1. 1 if it closed in profit
  2. 0 if it closed in loss

Example (results of each trade in the transformed sequence):

Buy (profit) → 1

Sell (loss) → 0

Buy (profit) → 1

Sell (loss) → 0

Buy (profit) → 1

Sell (profit) → 1

Buy (loss) → 0

Binary result:

[1, 0, 1, 0, 1, 1, 0]

Step 3: Selection of Independent Trades

Purpose: Select trades that have been executed on different market evolutions.

Get Andrea Berdondini’s stories in your inbox

Join Medium for free to get updates from this writer.

Method: 

  1. In a binary sequence, only consecutive trade pairs having the same results are accepted (1 after 1 or 0 after 0). 
  2. This is because, to have the same result with two opposite operations (buy/sell), the system must be changed ⇒ independence. 
  3. Consecutive trade pairs where the results alternate (1 after 0 or 0 after 1) are discarded, because they are compatible with a stationary phase ⇒ possible dependence.

Example (using the sequence [1, 0, 1, 0, 1, 1, 0]):

Checks:

1 → 0 ⇒ rejected [1, 0, 1, 0, 1, 1, 0] 

0 → 1 ⇒ rejected [1, 0, 1, 0, 1, 1, 0] 

1 → 0 ⇒ rejected [1, 0, 1, 0, 1, 1, 0] 

0 → 1 ⇒ rejected [1, 0, 1, 0, 1, 1, 0] 

1 → 1 ⇒ included [1, 0, 1, 0, 1, 1, 0] 

1 → 0 ⇒ rejected [1, 0, 1, 0, 1, 1, 0]

Independent trades: only the pair 1 → 1 remain which corresponds to two consecutive profitable trades.

Step 4: Randomness test using the Binomial distribution

Purpose:

To assess whether the observed results can be attributed to a random process, for example a fair coin toss.

Method: 

  1. k = number of successes (2)
  2. n = number of independent trades selected (2)
  3. p = 0.5 (fair coin) 
  4. We calculate P(X ≥ k) with the binomial distribution.

Example: 

  1. We obtained 2 successes on 2 independent trades. 
  2. Using the binomial distribution: P(X ≥ 2) = 25%. 
  3. The value is high ⇒ the result is compatible with a random process (there is no evidence of deterministic prediction).

If the observed number of successes is highly improbable under the assumption of randomness (probability <1%) this provides statistical evidence that the prediction algorithm may exhibit deterministic behavior. Conversely, high probability values indicate that the observed results may plausibly be the outcome of a random process.

How to distinguish a real “fortune teller” from simple luck using the Bionomial evolution function in the paradox of professional Traders

In the article, of the professional trader paradox [4], I develop a simple experiment based on the toss of a coin to explain the importance of considering financial markets as non-stationary. In this paragraph, I explain how the Binomial evolution function can correctly analyze the results of this experiment. In this way, we could understand if the strategy used has useful information that allows it to increase the probability of prediction.

The Experiment

Two people, A and B, sit opposite each other, separated by a black cloth.

  1. A can toss a coin as many times as he wants during a fixed interval of time.
  2. B does not see the coin but, at any time, can “bet” by declaring whether the coin at that moment shows Heads or Tails.
  3. If the declaration coincides with the real state of the coin, B obtains a “success”.

The question: does B really know how to “read” the coin or does he win only by chance?

Why the Binomial evolution function is needed

In this experiment, A flips freely without being seen and B tries to guess Heads/Tails at any time. From the outside, we do not see the flips so If B hits two or more identical predictions in a row, we can interpret it in two opposite ways:

  1. B is really skilled and anticipates every single flip.
  2. B is just “breaking up” the same bet: the coin is not flipped again and he repeats the same answer on a single event already decided.

Confusing the two cases means mistaking a mere accounting trick for a “winning strategy.” Understanding when we are truly predicting new coin tosses and when we are simply spreading our bets over the same toss is crucial for evaluating any betting method.

Where the Binomial evolution function intervenes

The Binomial evolution function (BEF) was invented precisely to separate these two situations, here’s how:

  1. Transformation: It imposes the alternation Heads-Tails between two successive predictions, inserting a “dummy toss” if necessary.
  2. Binary conversion: each prediction becomes 1 (correct) or 0 (wrong); the individual amounts no longer matter, so each win and each loss have the same statistical value.
  3. Selection of independent cases: compares the result of each prediction with the one immediately before: it only keeps 0–0 or 1–1. Indeed, two equal and opposite predictions give the same result, only if there has been a new toss.
  4. Binomial test: calculates the probability that the independent successes of B are the result of a random process.

What we discover 

  1. If the p-value remains large, the consecutive wins are nothing special: they are consistent with a simple “splitting” of a single bet over one toss.
  2. If the p-value is low, then it means that the consecutive victories refer to effectively different throws and B has real information on the individual events.

When betting on non-stationary systems, one must analyze very carefully series of victories that derive from forecasts all in the same direction. In finance, the formation of groups of high returns, alternating with groups of low returns, creates a statistical phenomenon called clustering [5]. In other words, it means that the returns are not distributed homogeneously but tend to group together. The clustering phenomenon can have significative deleterious effects in finance, as it leads to the misperception that trades executed during winning streaks are statistically independent, when in fact they may be correlated. Consequently, it becomes essential to understand if the predictions were on truly distinct events by applying the Binomial evolution function to filter the self-delusion of “splitting the stakes” on the same roll.

Only in this way, do we know if we are acting as intelligent strategists or if we are simply multiplying bets on the same roll, convincing ourselves that we are winning when, in reality, we are acting irrationally.

Conclusion

The Binomial Evolution Function represents a new class of functions that address the problem of non independence of results in finance. Resolving this problem has become a central challenge in the modern approach to quantitative trading. As a result, there is growing interest in methods that can transform sequences of outcomes into statistically independent data. The method used by the Binomial evolution function to select independent data is conceptually simple: it is based on the idea that two identical but opposite predictions yield the same result only if the underlying system has evolved. This insight provides a practical criterion for identifying independent trades.

In conclusion, this function allows us to answer the following fundamental question:

Am I betting on different events or am I simply splitting a bet on the same event?

If we cannot answer this question, any analysis of the results will be useless.

References:

[1] Fama, E. F. (1965). “The Behavior of Stock-Market Prices.” The Journal of Business, 38(1), 34–105.

[2] O. Peters, M. Gell-Mann. “Evaluating gambles using dynamics”, Chaos: An Interdisciplinary Journal of Nonlinear Science, 2016; 26 (2): 023103 DOI: 10.1063/1.4940236.

[3] Berdondini, Andrea, Application of the Von Mises’ Axiom of Randomness on the Forecasts Concerning the Dynamics of a Non-Stationary System Described by a Numerical Sequence (January 21, 2019). Available at SSRN: https://ssrn.com/abstract=3319864 or http://dx.doi.org/10.2139/ssrn.3319864.

[4] Andrea Berdondini, “The Professional Trader’s Paradox”, (November 20, 2018). Available at SSRN: https://ssrn.com/abstract=3287968.

[5] Marti, G., Nielsen, F., Bińkowski, M., & Donnat, P. (2017) “A review of two decades of 7 correlations, hierarchies, networks and clustering in financial markets”, arXiv preprint arXiv:1703.00485.

--

--

Towards AI
Towards AI