Discussing the article: "Symbolic Price Forecasting Equation Using SymPy"

 

Check out the new article: Symbolic Price Forecasting Equation Using SymPy.

The article describes an interesting approach to algorithmic trading based on symbolic mathematical equations instead of traditional machine learning "black boxes". The author demonstrates how to transform opaque neural networks into readable mathematical equations using the SymPy library and polynomial regression, allowing for a full understanding of the logic behind trading decisions. The approach combines the computational power of ML with the transparency of classical methods, giving traders the ability to analyze, adjust, and adapt models in real time.

Given the difficulty of interpreting the inner workings of machine learning models, I wondered: what if we could create a model that was just as powerful, but completely transparent? A model that would provide not just a forecast, but an exact mathematical formula: "Price in 24 hours = f(RSI, MACD, volatility, ...)". This would allow us not only to predict, but also to understand the market at a fundamental level.

The search led to symbolic mathematics, an area where computers work not with numbers, but with mathematical expressions. If regular machine learning says "the answer is 1.4523", then symbolic math explains: "the answer is 1.4523 because 0.003×RSI - 0.127×volatility² + ...".

The SymPy library in Python was a discovery. It allows you not only to train a model, but also to extract a mathematical equation from it in its pure form. Imagine: instead of a mysterious neural network, you have a formula that you can write down on paper, analyze, and understand each term. SymPy integrates with scikit-learn, allowing regressions to be transformed into algebraic expressions. This is not new – the concept has been developing since the 1980s (systems like Mathematica), but in trading it is revolutionary. In my experience with the Midas system, this increased the system's stability by 25%, as it allowed me to manually adjust the formulas to market conditions.

Author: Yevgeniy Koshtenko

 
I’m not quite sure what this is all about, but it looks nice :) I’m running it in Spyder (Python 3.13) from the WinPython 3.13.50 collection. Use Ctrl+U to retrieve data in the terminal.
Files: