#Technology #Machine learning #Finance

Forecasting Profits Direction: Weekly Stop-Loss and Stop-Gain

In a previous post we backtested our logistic model with walk-forward and we found two useful trading configurations, one for Monday-Wednesday and the other for Tuesday-Thursday-Friday. They are reported hereafter. Now, a question we could have is, do there is any way to improve our pnl ? We know that we could try a different machine learning paradigm in order to improve our training metrics (i.e. accuracy, sensitivity and specificity) but, assuming we don’t want to go to this direction, we can still try to improve our pnl by reducing our losses. ...

#Technology #Machine learning #Finance

Forecasting Profits Direction: PnL Backtesting

In a previous post we developed a logistic model with walk-forward to forecast profits direction as extension of a random forest model with the hope to improve its forecasting capabilities. Unfortunately, we didn’t get any better metric (accuracy, sensitivity, etc) and the bare testing of pnl prediction in a single week didn’t provide better results either. However, it is not possible to draw a general conclusion by testing a single case because most of the datasets coming from the financial markets are no stationary by nature, therefore no single case testing can be generalized. ...

#Technology #Machine learning #Finance

Forecasting Profits Direction: Logistic Model

In the previous posts we developed a random forest model and walk-forward validation approach to forecast the direction of trades in a CAC40 dataset. Here we investigate the adoption of a logistic model instead of random forests. Since we still adopt a walk-forward validation, we will actually adopt an ensemble of logistic models, one for each of the walk-forward splitting. Logistic modeling is quite common in binary classification problems, it is based on simple math which extends the linear regression approach, it has a nice bayesian interpretation and it can be seen as a single-layer perceptron so a first step in the world of neural networks and deep learning. ...

#Technology #Machine learning #Finance

Forecasting Profits Direction: Walk-Forward Validation

In a previous post we developed a random forest model to forecast the direction of trades in a CAC40 dataset. Despite the fact that the training accuracy was extremely high, the forecasting metrics resulted quite poor. Generally speaking, such kind of discrepancy is a clear evidence of overfitting in the learning process: the model is not able to generalize because it fitted too much with the training data. Of course, overfitting can be reduced by constraining the learning process and therefore trading an increase in its generalization capabilities for reduced training metrics - and this can be done in our case, for example, by constraining the number of generated trees in the random forest. ...

#Technology #Machine learning #Finance

Forecasting Profits Direction in a Dataset of CAC40 Trades

Our dataset consists of many possible trades generated by several different strategies and our main purpose is to identify the most useful features in order to detect the trades with positive gain and therefore the winning strategies. After having imported the data, we are going to clean in it up and to reformat them. Each record of the dataframe is a single transaction which consists of three trades. One trade to open the position and two trades to close it. ...