You are on page 1of 6

IOP Conference Series: Materials Science and Engineering

PAPER • OPEN ACCESS

Binary options trading: candlestick prediction using Support Vector


Machine (SVM) on M5 time period
To cite this article: Lantana Dioren Rumpa et al 2021 IOP Conf. Ser.: Mater. Sci. Eng. 1088 012107

View the article online for updates and enhancements.

This content was downloaded from IP address 105.57.96.56 on 29/06/2023 at 18:50


Annual Conference on Computer Science and Engineering Technology (AC2SET) 2020 IOP Publishing
IOP Conf. Series: Materials Science and Engineering 1088 (2021) 012107 doi:10.1088/1757-899X/1088/1/012107

Binary options trading: candlestick prediction using Support


Vector Machine (SVM) on M5 time period

Lantana Dioren Rumpa1, Mey Enggane Limbongan2, Astriwati Biringkanae3,


Rahma Gusmawati Tammu4
1
Electrical Engineering Department, Universitas Kristen Indonesia Toraja
234
Management Department, Universitas Kristen Indonesia Toraja

*dionrumpa@ukitoraja.ac.id

Abstract. Many people choose to trade binary options because it is not difficult to understand.
They need to predict whether the price will be higher or lower than their open position in a
specific timeframe. The most popular timeframe for binary options traders is the M5 (5-
minutes). Many traders prefer to use a candlestick chart model to predict. We use SVM
(Support Vector Machine) to indicate the next-candlestick based on the previous-candlestick
features in this research. This paper uses six features such as Open Value, Close Value, High
Value, Low Value, Volume Value, and previous Candlestick Color on each candlestick. The
result of the prediction accuracy using SVM is only 56%.

1. Introduction
Many people have become interested in binary options trading (BO). The reason is that it is easier than
conventional trading systems. We do not need time to decide whether to press the High or Low button
on your favorite broker application. Some people think that binary options trading is a gamble, but on
the other hand, some say it is not because it requires a unique technique to guess whether it is higher
or lower. The main difference between BO and conventional trading is the time. In BO trading, the
time is determined (usually depends on the broker), while in traditional trading, traders are free to
choose when to close a position [1][6]. We have to determine whether the value is higher or lower
than the Open Position. We can get up to 90% profit, or depending on the agreed value of each market
opened by the broker. On the other hand, we could lose if our guess was wrong.
Researchers or even traders conducted many studies to find an asset value movement over a certain
period. The broker has assisted by several indicators used to predict price movements. Some popular
indicators are Moving Average (MA), Moving Average Convergence Divergence (MACD), and The
Relative Strength Index (RSI). Each of the indicators provides different information to help traders
choosing High or Low [1][2][4], and Several traders use it simultaneously.
One of the most popular asset price chart displays is Candlesticks (CS), which uses to read price
movements in financial markets (Technical Analysis). Using CS and some indicators can make it
easier for traders to read asset price directions. Most BO traders use the CS pattern technique to
determine what CS will be formed next. Some of these patterns are Spinning Top, Marubozu, Doji,
Hammer, and much more. Our research used major pairs like EURO-USD (EUR/USD) because the
volatility is relatively high, and many brokers provide. Transactions are conducted simultaneously

Content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence. Any further distribution
of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
Published under licence by IOP Publishing Ltd 1
Annual Conference on Computer Science and Engineering Technology (AC2SET) 2020 IOP Publishing
IOP Conf. Series: Materials Science and Engineering 1088 (2021) 012107 doi:10.1088/1757-899X/1088/1/012107

during the day at all trading hours so that traders could trade at any time. Another reason is that Major
Currency Pairs usually have the lowest Spreads in contrast to Minor Currency Pairs [7].
Predicting the next CS pattern is discussed in this paper. We propose using machine learning to
classify CS based on the Open and Close Value, Volume, High and Low Value, and CS Color features.
We use the Support Vector Machine (SVM) for the classification process because several studies
stated that SVM is suitable for multivariates prediction [1][3][5][8]. The data source is from the
website https://www.investing.com live chart. We use the M5 (5-Minutes) period, as some
experienced traders find it easy to analyze. There are 100 data that we use to perform the classification
process. Although we got poor results, at least it was preliminary information for other researchers.
2. Methodology
This article suggests a new approach for predicting the CS that will be formed based on the previous
CS. The data used in this analysis have been taken from www.investing.com. This approach is seen in
Fig.1 for further information.

DATA DATA SVM


COLLECTING LABELLING PROCESSING

CONCLUSION RESULT

Figure 1. Propose Method

2.1 Data Collecting


The data source of this research has previously been listed above. A menu, specifically a real-time
Chart, is available on the website. It is converted into CandleStick Chart with 5 minutes timeframe
(figure 2).

Figure 2. Chart of EUR/USD with M5

The data collection process is achieved by looking at a set of features of each candlestick formed.
These features include Open, Close, High, Low, Volume, CS Color, and Next-CS Color (NCC). Each
VALUE Of These features is inserted in the table. In this analysis, we used 100 data to be used as
training data. The sample of data collected from the live-chart www.investment.com website is shown
in table 1.

2
Annual Conference on Computer Science and Engineering Technology (AC2SET) 2020 IOP Publishing
IOP Conf. Series: Materials Science and Engineering 1088 (2021) 012107 doi:10.1088/1757-899X/1088/1/012107

Tabel 1. Example Data Collected from www.investing.com

No Open Close High Low Cs Color Next Cs Color


1 1.1165 1.1167 1.1167 1.1165 GREEN RED
2 1.1168 1.1166 1.1171 1.1165 RED RED
3 1.1166 1.1165 1.1170 1.1165 RED DOJI
4 1.1165 1.1164 1.1167 1.1163 RED GREEN
5 1.1164 1.1165 1.1166 1.1164 GREEN RED

A Doji is a name for a session where the control candlestick is open and close, nearly identical, and
is also a part of patterns [4]. Single doji are neutral patterns that often feature a variety of basic
patterns.
2.2 Data Labelling
This study’s data labeling process is to provide a label for each data collection. Labels are given based
on the parameters of the NCC column. The rules used in the labeling process are: if the NCC Column
is red, then the label is SELL, if the NCC is green, then the label is BUY, and if the NCC is DOJI, the
label is HOLD. The results of this procedure are shown in table 2.
Tabel 2. Examples of the Data Labelling process
No Open Close High Low Vol CS Color NCC Class
1 1.1165 1.1167 1.1167 1.1165 20 GREEN RED SELL
2 1.1168 1.1166 1.1171 1.1165 20 RED RED SELL
3 1.1166 1.1165 1.117 1.1165 10 RED RED SELL
4 1.1165 1.1164 1.1167 1.1163 10 RED GREEN BUY
5 1.1164 1.1165 1.1166 1.1164 10 GREEN DOJI HOLD

Table 2 provides an overview of the labeling method for the data collected. The goal of this process
is to identify each CS color predicted by machine learning.
2.3 SVM Processing
At this stage, the data labeled will be classified using SVM. The application we use is version 3.8.4 of
WEKA. We use the libsvm library for SVM processing. Data that has been labeled are stored in *CSV
format so that WEKA is easier to read. There is no filtering process for data at the pre-classification
stage. In this stage, we will get results such as Correctly Classified Instances, Incorrectly Classified
Instances, and Confusion Matrix
3. Result And Discussion
In the Data Collecting stage, there are 100 data or instances obtained from the live-chart of the site
www.investing.com, and these data are shown in table 1. These data cannot be displayed in this paper
due to limited pages. The same process occurs at the Data Labeling stage. The volume feature is added
at this stage, which includes the difference between High and Low Value. The results discussed in this
section are the processed results of the WEKA application.
Tabel 3. Summary of WEKA using libsvm

Correctly Classified Instances 58%


Incorrectly Classified Instances 42%
Kappa statistic 0.2101
Mean absolute error 0.28

3
Annual Conference on Computer Science and Engineering Technology (AC2SET) 2020 IOP Publishing
IOP Conf. Series: Materials Science and Engineering 1088 (2021) 012107 doi:10.1088/1757-899X/1088/1/012107

Root mean squared error 0.5292


Relative absolute error 72.58%
Root relative squared error 120.73%
Total Number of Instances 100

Tabel 3 shown us that WEKA indicates the accuracy of 56 percent Correctly Classified instances
and 42 percent Incorrectly Classified.
Tabel 4. Confusion Matrix

A B C Classified As
19 23 0 A=Sell
10 39 0 B=Buy
2 7 0 C=Hold

Confusion Matrix is a performance measure for machine learning classification problems. Tabel 4
shown us the 42 instances that should have been identified as SELL, 19 were correct, and 23 were
incorrectly identified (identified as BUY). From 49 BUY instances, 39 are correct, and ten are false
(identified as SELL), and from 9 HOLD instances, nothing is correct at all.
4. Conclusion
The main conclusion from this result is that the prediction results are not very good because only 56%
are correct. This means that if we use this in Binary Options, we will likely lose a lot of money.
According to confusion matrix results, better performance when identifying BUY class and poor
performance when identifying HOLD class. This may be due to the imbalance of instances used in the
training data. Additional study should balance the instances in each class, and the important thing is to
use machine learning to do the forecasting process, not classification.

References
[1] J. Kamruzzaman, “Application of Support Vector Machine to Forex Monitoring,” IEEJ
Transactions on Electronics, Information, and Systems, vol. 124, no. 10, pp. 1944–1951, 2004,
doi: 10.1541/ieejeiss.124.1944.
[2] “Binary Options Versus Forex - Artikel Forex,” seputarforex.
https://www.seputarforex.com/artikel/binary-options-versus-forex-182799-31 (accessed Nop. 15,
2020).
[3] B. J. de Almeida, “Combining Support Vector Machine with Genetic Algorithms to optimize
investments in Forex markets with high leverage,” Applied Soft Computing Journal, vol. 64, pp.
596–613, 2018, doi: 10.1016/j.asoc.2017.12.047.
[4] J. Chen, “Doji,” Investopedia. https://www.investopedia.com/terms/d/doji.asp (accessed Jan. 15,
2021).
[5] E. Gerlein, “Evaluating machine learning classification for financial trading: An empirical
approach,” Expert Systems with Applications, vol. 54, pp. 193–207, 2016, doi:
10.1016/j.eswa.2016.01.018.
[6] S. Choi, D. Gang, and K. K. Lai, “Generating Profit Using Option Selling Strategies,” in 2012
Fifth International Conference on Business Intelligence and Financial Engineering, Lanzhou,
Gansu, China, Aug. 2012, pp. 177–180, doi: 10.1109/BIFE.2012.45.
[7] TechGarage, “Perbedaan mata uang mayor dan mata uang minor,” Forex Indonesia, Feb. 19,
2018. https://forexindonesia.info/beritaforex/perbedaan-mata-uang-mayor-dan-mata-uang-
minor.html (accessed Nop. 23, 2020).
[8] T. N. T. Thu, “Using support vector machine in FoRex predicting,” 2018 IEEE International
Conference on Innovative Research and Development, ICIRD 2018, pp. 1–5, 2018, doi:

4
Annual Conference on Computer Science and Engineering Technology (AC2SET) 2020 IOP Publishing
IOP Conf. Series: Materials Science and Engineering 1088 (2021) 012107 doi:10.1088/1757-899X/1088/1/012107

10.1109/ICIRD.2018.8376303.

You might also like