In  this  article,  we  will  compare  two  approaches 
that  use  machine  learning  to  predict  the  price 
movement of a pair of currencies. The first approach 
is  a  strategy  built  with  a  linear  classifier  algorithm, 
and  it  tries  to  separate  the  classes  by  a  line  or 
hyperplane  like  logistic  regression.  The  second 
approach  is  a  different  strategy  built  using  a  non-
linear  classifier  algorithm  that  does  not  use  the 
linearity of the data, like the decision tree, KNN. 
2  ALGORITHMIC TRADING 
Traders have developed numerous trading strategies 
to avoid emotional investment and make profits from 
the market. However, sticking to one trading strategy 
will not  necessarily lead always to good results, not 
all successful trading strategies will stay helpful and 
profitable  in  the  future,  the  financial  markets  are 
changing  continuously  with  time  due  to  various 
factors that impact the state of the financial markets, 
technical  and  fundamental  analysis  differentiate 
and adapt their strategies for different situations. 
Recently,  Artificial  intelligence (AI)  Toke 
advantage of the continuous changes of the financial 
market to create a new type of trading based on Data 
mining  and  machine  learning.  This  type  of  trading 
requires a complex analysis; the first step is feeding a 
computer  with  a  massive  amount  of  past  data  sets, 
then  giving  it  enough  time  to  execute  complex 
calculations;  the  computer  learns  price  patterns  by 
itself  and  predicts  them  in  the  future.  In  the  pre-
market-efficiency  era  (i.e.,  pre-  1960s),  several 
practitioners and researchers believed that predictable 
patterns  in  stock  returns  might  lead  to  "abnormal" 
profits for trading techniques (Conrad & Kaul, 1998).    
In  (Chihab,  Bousbaa,  H.,  &  Bencharef,  2019), 
researchers have proposed a theoretical Multi-Agent 
System for stock market Speculation. They used four 
agents, the Metaheuristic Algorithm agent, technical 
indicators,  Text  Mining  agent,  and  Fundamental 
Factor agent. The final decision is made based on the 
combination of the four agent’s results.  
2.1  Support Vector Machine (SVM) 
In  1992  Vapnik  and coworkers  had  introduced  The 
Support  Vector  Machine  (SVM)  as  a  computer 
algorithm that learns by example to assign labels to 
objects (M.  Guyon, N.  Vapnik, &  E.  Boser,  1992). 
The SVM is a machine learning algorithm applied in 
many  different  fields  of  business  such  as  biology, 
biomedical,  recognizing  handwritten  digits, 
fraudulent  credit  cards  (Chihab,  Bousbaa,  Chihab, 
Bencharef, & Ziti, 2019; S. Noble, 2006). To solve a 
time-series  forecasting  problem,  Cao  (Juan  Cao  & 
Eng Hock Tay, 2001) proposed a solution  based on 
two-stage neural network architecture constructed by 
combining Support Vector Machines (SVMs) with a 
self-organizing  feature  map  (SOM).  The  backtest 
showed  an  impressive  result,  not  only  in  the 
prediction performance  but  also  in  speed  compared 
with a single SVM model. In (Kim, 2003), Kyoung-
Jae  proposed  a  promising  alternative  to  predict  the 
stock  market,  by  comparing  the  proposed  method 
with  back-propagation  neural  networks  and  case-
based reasoning. 
2.2  Logistic Regression 
Logistic  regression  Is  a  commonly  used  machine 
learning algorithm to model the chance of an event. 
In  (Sperandei,  2014)  Sperandei,  defined    Logistic 
regression as an algorithm that works very similar to 
linear-regression,  but  with  a  binomial  response 
variable,  which  tries  to  model  the  logarithm  of  the 
chance.  (Kung-Yee  &  L.  Zeger,  1988)  proposed an 
approach  to  solving  multivariate  time  binary  series 
data; in this approach, the logistic regression eases the 
computational  burden  of  the  maximum  likelihood 
method. 
2.3  Random Forest 
The  Random  Forest  (RF)  was  Introduced  in 
(Breiman, 2001) as a combination of predictor trees. 
It uses many trees to generate a predictive model. In 
each node, a random selection of features is used to 
identify the important predictors automatically. 
Random  forest  (RF)  is  a  non-linear  machine 
learning  algorithm  that  can  resolves  classification 
problems in many different fields of business; RF was 
used to understand the financial markets and forecast 
changes in prices. In (Booth, Gerding, & McGroarty, 
2014),  a  trading  strategy  was  built  and  developed 
based on a Random Forest algorithm. The proposed 
trading system forecasts the price return. The results 
showed that random forests produce superior results 
in terms of both profitability and prediction accuracy 
compared  with  other  ensemble  techniques.  Also,  in 
(Chihab, Bousbaa, Chihab, Bencharef, & Ziti, 2019), 
another approach was proposed to forecast the future 
price in the next week; the study showed impressive 
results to improve the  prediction accuracy by  using 
Random forest.