【FX】 Board information trading experiment started; automated trading with MT4
【FX】Experimenting with Trade Using Order Book Data and Auto-Trading on MT4
1. Introduction (Self-Introduction)
My name is Sabei-kus. I trade mainly USD/JPY in FX using discretionary trading and automated trading, and I recently started actively as a trader. I am still a beginner trader, conducting various experiments. In this article, I will write about an experiment on trading using order book information. Since the EA will be fully operational from tomorrow Monday, there is no operating data yet, but I hope this article will be a thoughtful exploration of whether such an approach is feasible.
2. About the Order Book
An order book shows the prices and quantities of buy and sell orders. It is publicly available on Gaitame.com.
https://www.gaitame.com/markets/order/
From the above, you can see the buy and sell orders that Gaitame.com users have placed.
3. Using the Order Book
The order book displays orders as follows.
In the above example, there are many sell orders at 149.75. In fact, in the market on October 13, when the price reached 149.75 there, there was a rebound and many sell orders appeared.
Therefore, a hypothesis arises: if there are many buy or sell orders shown in the order book, the price may reverse there?
I wanted to use this to build automated trading.
4. Automated Trading
To start with, the conclusion is that I was able to build an automated trading system, but backtesting produced errors, and it remains to be seen whether it will actually work once the market opens tomorrow Monday.
4.1 Structure
The automated trading setup is as follows: first, using Python to obtain the order book information from Gaitame.com as described above, and write it to a file.
In the file, I write the full levels of selling and buying prices.
The file write is registered in Windows Task Scheduler to run every 10 minutes with a Python program.
Then MT4 reads the written file.
When the read prices reach the written levels, it assumes a reversal and places sell or buy orders accordingly.
The trade timing is set to until the Heikin-Ashi average reverses on the 5-minute chart.
4.2 Key Points (Difficulties)
If someone reading this article is considering building something similar, I will note the key points I addressed.
Initially, I attempted to use MT4's WebRequest to obtain the order book data from Gaitame.com with Python, but the data portion of the order book was not written into the HTML, so even if I fetched it via GET, the relevant part was missing, and I could not build it.
Therefore, I used Python with Selenium to obtain the relevant portion.
If I had my own server, I could place the Python code on the server and pull the information into MT4, but since I do not have a personal server, I used Task Scheduler on my PC to run the Python code.
Then, I connected via a file-based mechanism to share the information.
If you are building this, please ensure that access to Gaitame.com does not become excessive. If it is too frequent, it may be deemed an attack, so please be careful.
5. In Conclusion
Since before, I had been taking screenshots of the order book information using Python and notifying Line to use it for trading.
The usage period is short, but I feel the order book information is quite useful.
Therefore, I decided to create an automated trading system this time.
It will start operating from tomorrow Monday. I’m curious to see whether it will achieve good accuracy.
Once I accumulate operating data, I plan to write another article with the results.
Thank you for reading m(_ _)m