traders to make transactions automatically which
makes trading easier and more efficient.
2 RESEARCH METHODS
There are three main processes, namely the Initial,
Ticking, and Close processes. The Initial process is
the initial stage by which the trader gives orders of
input values. While Ticking is a process where the
Expert Advisor monitors the movement of price
values, which causes floating loss or floating profit.
According to the conditions that occur, ea will run the
martingale method if there is a floating loss. And
finally the Closing process, the EA will end the
transaction according to the conditions reached where
it stops at the point of profit or loss (Dinata, H., 2018).
Initial process, the input needed includes the
period of the moving average indicator, stop loss
point, profit take point, slippage, and martingale point
lots. The ticking process is to let the EA run
automatically so that the EA always observes price
movements continuously. In this process, the EA will
be ready to use the martingale system, depending on
the ongoing price movement. The last stage of the
process is close, this stage calculates the profit or loss
of each completed transaction.
2.1 Moving Average
Average is an indicator that calculates the average
price of an asset in a certain period, then connects in
the form of a line. The average value can come from
the opening price (Open), close (Close), high (high),
lowest (Low), or mid (Median) of a chart candle for a
certain period.
Average is part of the lagging indicator. This
means that this calculation method is based on
previous events and explains information about
market history data. The use of the Moving Average
indicator is as a predictive tool, but rather provides
confirmation. The Simple Moving Average has the
simplest protection pattern and is often used by
traders. This method can be calculated by adding to
the current price series of a period, and then limiting
the number of periods.
Moving Averages can help traders recognize the
prevailing trend of market price values. If the price
currently occupies an area on the Moving Average
line, it means that the price tends to fall or be bearish.
Conversely, prices that are above the Moving
Average line provide bullish trend information or
tend to rise.
𝑆𝑀𝐴
𝑝𝑀 𝑝𝑀 1 ⋯𝑝𝑀𝑛1
𝑛
(1)
Information:
p = actual number
M = time or period
n = lots of actual data
2.2 Martingale Theory
Martingale is a strategy that existed since the 18th
century in France. This strategy was used by gamblers
at that time, where gamblers needed to double their
bets every loss. the goal is to recover the previous
losses coupled with the gains. Martingale is a
sequence of random variables or rather processes at a
given time in a realized order, the expectation of the
next value in its order is equal to the observed value.
The martingale system is a fairly interesting
probability system, which can be applied to various
aspects of life. There are some situations where in
order to be able to implement a martingale system, to
increase the knowledge of application about to real
situations not just theoretical propaganda. One of its
areas of application is a brief prediction of market
prices. The martingale concept can be known more
about the opportunities and possible outcomes of
future predictions. (Victor, O,O. 2015).
Figure 1: Martingale System.
Example:
It can be seen in figure 2.7 for example, a trader
opened an Open Buy eur/USD with lots of 0.1 at a
price of 2,100, but it turned out that the price moved
down to the level of 2,050 so that it experienced a
floating loss of -50. Then again open buy with lots of
0.2 at the price of 2,050 at that moment. That way, it
now means that there are 2 open postions. The first
position is a floating loss of -50 and the second
position is 0. If the price then rises towards 2,100 then
the first position rises to 0 (BEP) and the 2nd position
becomes a profit of 100 (lots 0.2 x 50 pips = 100|lots
0.2 then 1 pips = $2|).