26th December 2025

| Mode | Sample | Prob | Learn Rate | Post Var |
|---|---|---|---|---|
| P(Win | +, Long) | 9 | 67% | 8.3% | 1.71% |
| P(Win | +, Short) | 11 | 55% | 7.4% | 1.71% |
| P(Win | -, Long) | 6 | 88% | 12.5% | 1.22% |
| P(Win | -, Short) | 3 | 40% | 20% | 4% |
This script uses Bayesian probability theory to dynamically assess market trends by continuously updating its beliefs as new price data arrives. To be precise, the script uses Bayes' Theorem, a mathematical framework that describes how to revise probability estimates when presented with new evidence (a new trade).
Bayes' Theorem works by combining two elements: a prior belief (set at 50%) and the likelihood (how well the new data supports different hypotheses). The result is a posterior belief, an updated probability that incorporates both your starting assumptions and the fresh market information.
Eli5: If the trade is a winner, it updates the state using the Bayesian updating formula. The higher the probability of a mode, the greater the likelihood of the trade succeeding.
There are multiple ways to interpret and trade the Bayesian Trend.
Length:
Trading Styles:
But before you use the probability table, you must understand the modes:
Example: 55% P(Win | +, Long) means the script has been doing very well at capturing the trend. Thus, there's a better than even chance for the trade to be profitable (if long, close > entry).
Bayesian Probability Table: