Discussing the article: "Exploring Regression Models for Causal Inference and Trading"

 

Check out the new article: Exploring Regression Models for Causal Inference and Trading.

The article explores the possibility of using regression models in algorithmic trading. Regression models, unlike binary classification, allow for the creation of more flexible trading strategies by quantifying predicted price changes.

Binary classification is a fundamental machine learning task in which the goal is to classify input data into one of two different categories or classes. In the context of a Forex trading bot, this usually means predicting a "buy" (represented as 0) or "sell" (represented as 1) signal. This approach reduces complex market dynamics to a simple directional decision.

The most significant inherent limitation of binary classification for quantitative trading is its inability to quantify the magnitude or intensity of a predicted price movement. A binary classifier only indicates whether the price is expected to move up or down, without providing any information about how much it is expected to change. This lack of granularity fundamentally limits decision-making in trading.

The accuracy of the classifier's predictions alone does not take into account the magnitude of change, and is therefore not very useful for trading. This aspect is key because it highlights that high directional accuracy (e.g. predicting the correct direction 70% of the time) does not automatically lead to profitable trading. 

There is an important observation that high direction accuracy does not guarantee profitability. For example, you can be right 30% of the time and be profitable, or you can be right 70% of the time and be unprofitable. This demonstrates that the net result of a trading strategy is determined by the amount of profit on winning trades compared to the amount of loss on losing trades, and not simply the percentage of wins.


Author: dmitrievsky

 
我觉得你的方法中,测试数据参与进模型筛选的过程,容易存在过拟合的可能性,最好是两份足够多的数据做两份测试,一份做筛选模型,另一份检验筛选出来的最优模型,不参与模型筛选。
 

Forum on trading, automated trading systems and testing trading strategies

Discussion on "Developing a Multicurrency Expert Advisor (Part 25): Connecting a new strategy (II)"

Rashid Umarov, 2025.07.05 12:58 pm

All comments to articles are automatically translated in each language branch.

And also there is a button "Auto-translation" if he wants to read in English here.


[Deleted]  
zhainan #:
我我觉得你的方法中,测试数据参与进模型筛选的过程,容易存在过拟合的可能性,最好是两份足够多的数据做两份测试,一份做筛选模型,另一份检验筛选出来的最优模型,不参与模型筛选。

You can do it like this. Essentially, there is no model selection in the learning phase here. You just adjust the thresholds and then the model is validated on the new data.

 
马克西姆·德米特里耶夫斯基 #:

可以这样做。实际上,在训练阶段这里没有模型选择。只是设置阈值,然后在新数据上测试模型。

马克西姆-德米特里耶夫斯基 #:

可以这样做。实际上,在训练阶段这里没有模型选择。只是设置阈值,然后在新数据上测试模型。

差不多,因为是在循环中根据阈值保留在测试样本表现优秀的模型,我也差别不多,我现在采用的方法,是用多个交易品种,2015~2020的数据做为训练数据,可以补充更多市场形态,做好统一尺度,再用2020~2022年的目标交易品种数据做筛选模型,最后2022到2025的目标交易品种数据做最后的检验
[Deleted]  
zhainan #:
差不多,因为是在循环中根据阈值保留在测试样本表现优秀的模型,我也差别不多,我现在采用的方法,是用多个交易品种,2015~2020的数据做为训练数据,可以补充更多市场形态,做好统一尺度,再用2020~2022年的目标交易品种数据做筛选模型,最后2022到2025的目标交易品种数据做最后的检验
Forward is not involved in the choice of model in this article. The article is about the possible advantages of regression models over classifiers. I'm surprised no one has ever written anything like this about it. I'll write more articles on the topic when I get back from holiday, if they are of interest.
 
In the attached Python code, there is no module named bots.
[Deleted]  
Omega J Msigwa #:
In the attached Python code, there is no module named bots.

This is a folder, you can create it yourself. Either change the import paths to your module location.

Or read some introductory course on importing modules, it's very simple.

 

Hello Maxim, I downloaded the files, train using the exist csv file, and run the produced EA, and found the result is different with the one EA attached in zip folder.

I checked the parameters, and found no clue for this.

Would you please tell me what's the reason for this.

Thanks

[Deleted]  
zhuifeng123 #:

Hello Maxim, I downloaded the files, train using the exist csv file, and run the produced EA, and found the result is different with the one EA attached in zip folder.

I checked the parameters, and found no clue for this.

Would you please tell me what's the reason for this.

Thanks

Hi. Show me the differences, it's so hard to guess what it's about.

 
Maxim Dmitrievsky #:

Hello. Show me what the differences are, it's so hard to guess what we're talking about.

I use causal_regression_orig.py to produce ea header file, then compile ea.

The result is test_result pic in below.

There are so less trades than the one you posted.

So what's the difference between these.

Files:
src.zip  2372 kb