Posted by Dr Bouarfa Mahi on 18 Jan, 2025

Traditional financial models often focus on predicting future asset prices, relying on time series forecasting and technical indicators. However, predicting exact price movements can be unreliable due to market complexity and inherent randomness. This article introduces a novel framework for defining and computing the probability of market trends, offering a more flexible and realistic target for machine learning models. By using moving averages and a sigmoid transformation, we convert market dynamics into a probabilistic trend signal, bridging technical analysis with modern data-driven models. This probability will also serve as the foundational target for machine learning models developed to explore the influence of divine influence in financial markets.
Machine learning (ML) models in financial markets typically focus on forecasting asset prices or classifying price movements. However, precise price prediction is inherently difficult due to the complexity and noise in market data. A more effective approach involves predicting the probability of market trends (uptrend, downtrend, or neutral), aligning better with real-world trading decisions.
This article presents a systematic method to compute trend probabilities using price data, which can serve as a target variable in supervised ML models for market prediction. Additionally, this probability will be integrated into machine learning models designed to capture how divine influence could subtly guide market behaviors.
The goal is to quantify the market's directional bias as a probability rather than a binary outcome. This involves:
Let
Where:
The difference between the short-term and long-term moving averages captures the market's directional bias:
Normalize the trend signal relative to the current price to scale the result:
Transform the normalized signal into a probability:
Where:
Here is the complete version of the Python code with a single threshold of 0.5 for deciding between Buy and Sell signals.

The computed Trend Probability will serve as the target variable for machine learning models designed to detect subtle influences on market behavior. Specifically, this model will be used to explore how divine influence could subtly adjust traders' decision-making processes.
A natural approach to completing the machine learning framework is to use Trend Probabilities as input features (
In this framework, each trader is conceptualized as a neuron in a neural network, where decisions are based on weighted inputs. The volume-based trend probability functions as a refined input signal that encapsulates the collective behavior of the market. Similar to how neurons process signals in the brain, the trader integrates this probabilistic input with other influencing factors—such as price trends, emotions, and biases—to arrive at a decision (buy or sell).
Using probabilities as inputs provides a more flexible and realistic representation of human decision-making, as it reflects the inherent uncertainties and nuances in trading behavior. This abstraction not only strengthens the model's alignment with real-world market dynamics but also supports the hypothesis that traders act as decision nodes influenced by both market-driven factors and external adjustments, such as divine influence.
This framework introduces a probabilistic approach to market trend prediction, shifting from precise price forecasting to trend likelihood estimation. By leveraging moving averages and a sigmoid transformation, this model produces a more flexible and interpretable target for machine learning models. This probability will also act as a foundational component for models investigating divine influence on market behavior.
Future work could involve integrating additional indicators, optimizing scaling factors, and testing this approach with real market data for model training and validation.