### Price prediction using machine learning

Posted:

**Wed Oct 03, 2018 5:37 pm**You can use ForexConnect API in machine learning models.

The following sample scripts are available at github:

PricePredictionMLregressionMA.py

This sample script shows how to use Machine Learning in Python and how to predict prices by using Linear Regression.

The input of the regression model is three Moving Averages calculated based on close prices. The algorithm uses a linear model to minimize the residual sum of squares between the observed responses in the dataset and the responses predicted by the linear approximation.

PricePredictionMLregressionPrevious.py

This sample script shows how to use Machine Learning in Python and how to predict prices by using Linear Regression.

The input of the regression model is close prices of previous bars. The algorithm uses a linear model to minimize the residual sum of squares between the observed responses in the dataset and the responses predicted by the linear approximation.

PricePredictionMLClassification.py

This sample script shows how to use Machine Learning in Python and how to predict prices

by using Support Vector Classification.

The model divides objects into two groups: "the price will grow on the next bar" and "the price will fall on the next bar".

The input data for the model are Open-Close and High-Low. The model tries to define whether the price is growing or falling on the basis of the input data.

The following sample scripts are available at github:

PricePredictionMLregressionMA.py

This sample script shows how to use Machine Learning in Python and how to predict prices by using Linear Regression.

The input of the regression model is three Moving Averages calculated based on close prices. The algorithm uses a linear model to minimize the residual sum of squares between the observed responses in the dataset and the responses predicted by the linear approximation.

PricePredictionMLregressionPrevious.py

This sample script shows how to use Machine Learning in Python and how to predict prices by using Linear Regression.

The input of the regression model is close prices of previous bars. The algorithm uses a linear model to minimize the residual sum of squares between the observed responses in the dataset and the responses predicted by the linear approximation.

PricePredictionMLClassification.py

This sample script shows how to use Machine Learning in Python and how to predict prices

by using Support Vector Classification.

The model divides objects into two groups: "the price will grow on the next bar" and "the price will fall on the next bar".

The input data for the model are Open-Close and High-Low. The model tries to define whether the price is growing or falling on the basis of the input data.