Automatic Forex Trading System (AFTS)- Beginner's Approach
Author: G.Mallikarjun Reddy
Mail:mallikarjun@it.iitb.ac.in
Forex is abbrevation for FOReign EXchange. AFTS deals with making decisions
regarding which currency to buy/sell, when to buy/sell and in what amount
so as to maximize the profits. Assume the scenario given below:
In Fundamental analysis, the buy/sell strategy is based on the domain and company details. i,e. in forex market it is to
make predictions based on political stability in the country, GDP growth rate etc.
In Technical analysis we look for indication of future price trends based on historic prices and volume trends.
The Winning Mantra in technical analysis is:
i,e We need to sell at the peaks and buy at the troughs.
Successful Trading has 3 pre-requisites
Associated with each unit of time (hour,day..) are four parameters, HIGH , LOW, OPEN, CLOSE.
The OPEN is price at start and CLOSE is price at the end, whereas LOW and HIGH are the highest and lowest prices obtained during that time period
respectively.
Now person X wants to invest into forex trading, decisions need to be taken are :
To earn more profits one needs to invest in currency pair where the fluctuations are more,
but at the same time risk associated will be more if the wrong prediction is done by te tool.
Here ($,C) is an example of such a currency pair.
So, X has to find the maximal agreement between two conflicting features : risk and profit and accordingly
invest the money among different currency pairs.
This is most important part of AFTS, Here the set of Neural networks with
varying features are used and the predictions of all the neural networks are combined
so as to get more accurate predictions. The varying features can be architecture of the
Neural networks and the window sizes (number of earlier patterns to be considered for
predicting next days trend).
Neural networks will not be able to predict trend eversal with 100% accuracy
so instead of using a crisp neural network we use the fuzzy neural networks,
where the output of neural network will be of the form trend reverses with x% probability
and trend continues with y% probability. The probabilities will help in taking decisions regarding
how much to buy/sell so that we can minimize the loses causing due to some wrong predictions.
Based on past data for different currencies find the PROFIT and RISK associated with each currency pair.
Normalise the PROFIT and RISK associated with each currency to some common currency (say $)
For each currency pair, invest
If upward trend is following and the combined output of NN's predict that trend reversal
happens with x% probability and trend continues with y% probability.
If downward trend is following and the combined output of NN's predict that trend reversal
happens with x% probability and trend continues with y% probability.
DAY Dollar Rupee DAY1 1$ Rs:41.00 DAY2 1$ Rs:42.00 DAY3 1$ Rs:43.00 DAY4 1$ Rs:41.00 DAY5 1$ Rs:42.00
Now if a person buys a $ for Rs:41.00 on day 1 and sells it on day 5 then he would have earned a profit of
Rs:1.00, but he could have earned more profits by taking the decisions at the right time. If he could have
bought the $ on day 1 and sold it on day 3 and again bought it on day 4 and sold it on day 5,
he could have earned the profits of Rs:3.00. The major challenge is to make decisions on when to buy and sell
so as to make the maximum profits. This is one of major objectives of AFTS.
Using mechanical system like AFTS is a best way to make money trading in long term as its
decisions are independent of human behavior.
The pair (X,Y) is called CURRENCY PAIR, where X is called base currency and Y is called counter currency.
Ex: (1$,Rs:43.00)
BID is price at which market maker is willing to buy (and clients can sell) the base currency in exchange for
counter currency.
Financial market analysis is basically two types.
This way of representation is popularly known as CANDEL STICK MODEL.
The decisions required to be made by AFTS for successful trading are:


Diversification is an attempt to spread risk across many types of currencies.
Scenario:
Assume that past data for 3 different cureencies with respect to $ are as given below
DAY DOLLOR Currency A Currency B Currency C DAY1 1$ Rs:40.00 Rs:40.00 Rs:40.00 DAY2 1$ Rs:42.00 Rs:39.00 Rs:45.00 DAY3 1$ Rs:44.00 Rs:38.00 Rs:47.00 DAY4 1$ Rs:41.00 Rs:40.00 Rs:39.00 DAY5 1$ Rs:43.00 Rs:39.00 Rs:40.00
Inital Strategies:
These are inital strategies which can be further refined by proper mathematical analysis. So, future
lies in automated trading if the system can make a nearly accurate prediction. This is just a intial step
in direction of making the entire system of trading automated.
(PROFIT+RISK)/100*TOTAL Investment in common currency ($)
in the corresponding currency pair.
For same period of time (say 5 days) from above table
Cur-A Cur-B Cur-C PROFIT 6 2 8 RISK 1 0 -1 P+R 7 2 7
So, if total investment being made is 160$ then it is better to invest 70$ in ($,A), 20$ in ($,B), 70$ in ($,C) currency pairs.
Based on the combined predictions of the set of neural networks regarding the trend
if ( y > x)
do nothing
else
sell currency worth (x-y)%.
if ( y > x)
do nothing
else
buy currency worth (x-y)% of Investment for this currency pair.