This is a water strider. (Of course, pen name) Actually, the author has been continuing the EA development of MT4 (MQL4) for a long time, hoping to connect it to actual profit if it can be done as a hobby, and for the past 1-2 years, especially linking MT4 and AI (especially non-technical analysis) ) Was the main focus, but the results were not so good and I was stuck.
So, although it is not a short break, I tried to apply AI to "technical analysis" that I thought that the functions and performance of MT4 were sufficient, "AI" scikit-learn " FX technical analysis by ".
Since I am a beginner in AI, I have researched many articles and materials that try to utilize AI for FX technical analysis. (Net and books) However, unfortunately, I couldn't find anything that could be used properly. Maybe some private business ones can be used, but they aren't available to the general public like me.
So, I tried my own method (probably) to use MT4 (MQL4) to select "features" to be used in AI. In fact, I found other tools (especially Python-based) that could be used. This is a measure I took because I didn't have it, but I think it's probably a difference in the development process from other developers.
Although it is currently a prototype version, we have obtained "results that will shine if polished", so we decided to release it to everyone. Documents (reports) are serialized and divided into two. (Currently there are two, but we plan to increase them in the future)
This series reports the test results when AI (scikit-learn) is used for prediction by technical analysis of FX (USDJPY; dollar / yen). (Currently the prototype version)
** Attempt of FX technical analysis by AI "scikit-learn"; ** It is divided into [Part 1] and [Part 2].
◎ Please read [Part 1] first, and obtain [Part 2] if you think it is worth reading. (How to get it is described in [Part 1].)
** [Goal this time] ** ・ ・ Refer to the block diagram It is to extract the "technical analysis result" that is worth passing to the MT4 (MQL4) side on the AI side. To be honest, I think that MT4 (MQL4) is sufficient for the technical analysis function. When I tried it, I got quite interesting results, I think the try was not wasted. (AI program is written in Python)
** Explanation contents in [Part 1] and [Part 2]; ** First of all, the "procedure for applying AI to FX technical analysis" adopted by the author this time is as follows.
(1) [Part 1] is An example of the last stage ・ DataFrame (features and labels) generated from the Forex (FX) chart Explains an example of performing machine learning / prediction using a Python program.
(2) In [Part 2] I will explain from the very first stage to creating a DataFrame with an example -Detailed explanation of how to generate DataFrame (features and labels) used in [Part 1](separate article).
** <Indicator used (example)> ** ・ ・ [Part 2] posted The indicator used to extract the features is common as the author's original (pine needle type filter). Bollinger band.
**
**
** [Win / Loss Judgment Method] **
Win / loss judgment uses the same concept as when creating an MT4 EA. In other words, "buy or sell" by specifying profit (profit level), loss (loss level), and spread. Learn the result of winning or losing judgment when entering the market from, and make predictions for test data. In addition, winning and losing "learning and prediction" is performed by "classification" by random forest.
The development environment (all available free of charge) required to execute the contents is described in [Part 1]. However, it does not provide technical explanations on how to obtain Python, scikit-learn and MT4, which are necessary for beginners. Some of the knowledge required for beginners can be found on the author's website (below). ・ ・ All the knowledge necessary to understand the contents is available on the WEB such as Qiita.
The cause is that SVC (SVM) deals with "unbalanced data", that is, the number of data between classes is large. I learned that various advance adjustments are essential when dealing with objects that are highly biased. (Scaling, normalization, etc. need to be adjusted) After all, I changed the classification algorithm to "Random Forest" to solve this annoying problem. As a result of avoiding it, the result was quite convincing.
** ◎ Where to get [Part 1] URL ** ** ① Document (PDF) **; http://mql4.s1002.xrea.com/ai_tec/ai_tec_01.pdf ** ② Data set (.zip) **; http://mql4.s1002.xrea.com/ai_tec/ai_tec_01.zip
** ◎ About MT4 (MQL4) and EA **
that's all
Recommended Posts