Wednesday, October 1, 2008

Automatic Forex Trading System (AFTS)- Beginner's Approach Automatic Forex Trading System (AFTS)- Beginner's Approach Automatic Forex Trading System



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:
DAY Doller 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.
1.Technical Analysis.
2.Fundamental Analysis.
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:
1.Identify the upward trend reversal as early as possible and sell.
2.Identify the downward trend reversal as early as possible and buy.
i,e We need to sell at the peaks and buy at the troughs. Successful Trading has 3 pre-requisites
1.Knowledge: To be used for fundamental analysis.
2.Tools: Tools are used for automatic predictions, The more accurate the predictions, more the profits earned.
3.Data: The past data is useful for technical analysis. Tools used for predictions are trained based on these data, the more accurate the data, the more accurate will be the predictions.
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.
This way of representation is popularly known as CANDEL STICK MODEL. The decisions required to be made by AFTS for successful trading are:
1.Which currency to Buy/Sell ?
2.When to Buy/Sell ?
3.How much to Buy/Sell ?
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
Now person X wants to invest into forex trading, decisions need to be taken are :
1. How much to invest into
. ($,A)
. ($,B)
. ($,C)
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.
2.When to buy/sell?
*Find the downward trend reversal as early as possible and buy.
*Find the upward trend reversal as early as possible and sell.
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).
3.How much to buy/sell ?
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.
Inital Strategies:
1.Which currency to buy/sell ?
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 (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.
2. When to buy/sell ?
Based on the combined predictions of the set of neural networks regarding the trend
Find the downward trend reversal as early as possible and buy.
Find the upward trend reversal as early as possible and sell.
3. How much to buy/sell?
*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 ( y > x) do nothing else sell currency worth (x-y)%.
*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. if ( y > x) do nothing
else
buy currency worth (x-y)% of Investment for this currency pair.
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.

No comments: