In Market Analysis 2 we upgrade Market Analysis to be better in all of its component , plus that we add a new component called Feature-Calculator.
Note: The order in setup is important.
Create a Dataset for any symbol in any period of time in Forex market (Metatrader 4) that contain the basic Features (open, high, low, close).
We do it by pulling data from MQL4 in to CSV file , the data is pulled using MQL4 build in functions that create our Features.
- Download the code in Dataset (here)
- Git in the code and write the number of bars you need.
- Name the csv file then compile it.
- Run the script (Dataset) in any symbol and any period of time.
"OPEN","HIGH","LOW","CLOSE","VOLUME" open=OPEN(i); high=HIGH(i); low=LOW(i); close=CLOSE(i); volume=VOLUME(i);
In Feature-Calculator we calculate the machine learning Feature based on this research (here).
- We build it in python .
- It based on the main Features Dataset.
- And we save it after finsh extraction the feature in csv file.
- After calculating the Dataset. copy the CSV file in to your python project.
- Download the code in Feature-Calculators (here) in to your python project.
- Run the collector program and it will generate the Calculated Feature in a CSV file.
Different Machine Learning models that we used to learn from the Feature.
- We build the the models in python using scikit-learn.
- It learn from our predefined Feature.
- And then save it after finsh traning in PKL file.
- Decision Tree.
- k-nearest neighbor.
- Logistic Regression.
- RandomForest.
- Support vector machine.
- Neural-network-MLPClassifier.
- After calculating the Feature. copy the CSV file in to your python project.
- Download the code in ML-Models (here) in to your python project.
- Run the program and it will generate the PKL file.
Tool that use to test the strategy that has been developed outside MQL4 in python.
- We do it by build our algorithmic trading strategy in python.
- And load our Models in Tester program.
- Then calculate the profits by saving the enter price then subtract from it the close price.
We call the models (Decision Tree and RandomForest) every one hour and say if the first 10 min is the same prediction do the predicted action.
- Profit
- Total number of trades
- Sum of wining trades
- Sum of loss trades
- Max drawdown
- Best trade
- After traning the models ML-Models.
- Get your testing data from Dataset.
- Download the code in Tester (here) in to your python project.
- Run the program and it will test the stratgy.
Connect the strategy that has been developed in Python with fxcm company in a real time connection the structure has been developed to run on cloud every 1 hour.
- Pull the basic data from fxcm by connect to a generated token you can git it from (here).
- After pulling data we predict the price using our machine learning models.
- All of this process is done in the cloud every 1 hour.
- Create a new Python project.
- Download the code in the project (here).
- Copy the generated models from ML-Models.
- Put it in a any cloud you are familiar with it.
- If you use ubuntu use crontab to set a time to run the code.
- the timer that are used in crontab is (11 * * * * * ) it means run the code every hour in minute 11.