At The Profitable Traders Society, our mission is to review, test, and report the performance of various trading systems in real time. We use intensive testing methods and provide our members with all live trading documentation and read-only passwords plus knowledge and tools to help you trade the Forex market.

As a collective group we can do more. Everyone has something to offer whether it's positive or negative. The result, an open community of traders with one goal, to be a profitable trader.

Tuesday, December 4, 2007

Automated Currency (Forex) Trading

Setting up an automated trading system may seem difficult to understand at first glance. However, new and sophisticated tools make it easier to automate even the most complex trading strategies. Whether your trading strategy involves a simple moving average cross or a complex mix of indicators, I will show you how to get started.

Ok. Let's learn how to get started. First, you will need a software platform to help carry out the different trading tasks. My platform of choice is MetaTrader. MetaTrader has built a wrapper, so to speak, around their trading tools so you can automate any trading action including open/close/limit/stop orders, calculating indicator values, inspecting historical data, etc. For example, lets' say you always open a trade when the 5-day simple moving crosses the 12-day simple moving average. MetaTrader has a function to lookup the 5-day and 12-day moving averages. Then you can write a "robot" applied to a currency pair's chart that will automatically enter a buy/sell order, exit a position, or send you an email when the moving averages cross. I like MetaTrader because it can be used for simple strategies as well as very complex strategies.

You must first signup for free with InterbankFx by clicking here. Select MT 4.0. Then you can download MetaTrader. Install it and setup a free demo account. Once you've done that you will see a few currency pair charts. Now click on the "Tools" menu and click "MetaQuotes Language Editor" (MetaEditor) or just hit F4 on your keyboard. This brings up the editor you will use to code your automated "robot" or "Expert Advisor" as MetaTrader calls it.

Now let's look at an example Expert Advisor to get familiar with how it works. On the right side of the MetaEditor screen double-click on the "Moving Average.mq4" file. This brings up the Moving Average example. Now don't get overwhelmed by the code. I'll explain what's happening here. Find the line that starts "void start()" (it's one of the last lines) and looks like this:


void start()

//---- check for history and trading

   if(Bars<100 || IsTradeAllowed()==false) return;

//---- calculate open orders by current symbol

   if(CalculateCurrentOrders(Symbol())==0) CheckForOpen();

   else CheckForClose();

//----

  }



if(Bars<100>I'll explain in english what each command does and in parathesis I'll quote the code above I'm describing in the two "if" statements. The first "if" line reads: if the current symbol (currency pair) has less than 100 bars to use in the calculation (Bars<100).

Now here's where it gets a little tricky. Find the code for "CalculateCurrentOrders", "CheckForOpen", and "CheckForClose." This is where the guts of the trading strategy is defined. "CalculateCurrentOrders" is very easy to understand since all it does is check to see if there is are any outstanding orders in play. All it does is loop through your brokerage account looking for BUY or SELL orders that are currently in the market. "CheckForOpen" is a little more in-depth. Here you will notice that it calls the iMA function to retrieve the moving average from the symbols' chart and creates orders accordingly. A similar thing is happening in "CheckForClose" where the iMA (moving average) is checked and current open orders will be closed accordingly.

Notice how in "CheckForOpen" there's an OrderSend and in "CheckForClose" there's an OrderClose. These are MetaTrader functions used to control trading. The iMA function is also a MetaTrader function to inspect values from an indicator. You do not have to code the logic for the indicator, it's already done for you. A sampling of indicators include: Awesome Oscillator, Bollinger Bands, Fractals, Momentum, On Balance Volume, RSI, Stochastic, MACD, Volume, and Williams' % R. You can even code your own indicator.

To apply this example to a currency pair chart, go back to the InterbankFX MetaTrader main window. Click on a currency pair chart. On the far left under "Expert Advisors" double-click on the one that says "Moving Average" and click the checkbox "Allow Live Trading." Now on every price change the "Moving Average" Expert Advisor will be run to decide when to trade or exit. Although, I do not recommend using this Expert Advisor as it does not produce consistent profits. It's used for example only.

So that's it to get started. All you have to do to start coding your own strategy is to change the "CheckForOpen" and "CheckForClose" routines in the "Moving Average" example, click the "Compile" button on the top menu and you're off and running.

For more information go to The Profitable Traders website.

Understanding Currency Trading

The number one lesson I learned as a trader, and believe me I learned it the hard way, was to understand the inner workings of the specifc market I was trading. During my stint as a stock options trader, I did not care about Black-Sholes, delta's, and other technical jargon regarding options. I was a good stock picker and options, as I thought, would be just another highly leveraged trade, right? Boy was I wrong! In my experience and in my opinion FOREX is no different. It was crucial I understand how the FOREX market works under the hood and how foreign currencies relate to each other.There are 7 major currencies traded in the FOREX market.

USD: US Dollar
UR: Euro
GBP: British Pound
CAD: Canadian Dollar
JPY: Japanese Yen
CHF: Swiss Franc
AUD: Australian Dollar

However, you don't just buy/sell individual currencies, you buy/sell pairs of currencies. Below are the "majors" traded in the FOREX.

EUR/USD
GBP/USD
USD/CAD
USD/JPY
USD/CHF
AUD/USD

I can hear your next question, why pairs? Well, when exchanging currency you are using one currency to get another, right. For example, let's say you are going on vacation and have $300 US Dollars to convert to Euros. Then you are basically asking a bank to "exchange" USD for EUR. As of this writing the exhange rate for EUR/USD is 1.3141. Which means you get 1 Euro for every 1.3141 US Dollars. So your $300 USD is exchanged for $228.29 EUR. When you see a currency pair, the first currency is the base currency and the second is the quote currency. So in our example, the EUR is the base currency and the USD is the quote currency.

As with any trading strategy there are still risks. No trading strategy is entirely risk free.

Go to The Profitable Traders website to find out more about our trading strategies.

What is the Off Exchange Retail Foreign Currency Market (FOREX)?

"Foreign Exchange" is defined as the simultaneous buying of one currency and the selling of another currency. The "Foreign Exchange" or Off Exchange Retail Foreign Currency Market (FOREX) is very hot today. The only way to understand why it is popular, in my opinion, is to compare features from those of the stock and commodity markets.

Liquidity
The FOREX or FX market is the most liquid financial market in the world. This high volume ensures two things: better trade execution and prevents market manipulation. So, why haven't you heard of the FOREX market until recently? Until now this market was only accessible by banks and financial institutions.

Market Hours

The FOREX market is open 24 hours a day (except weekends). Opening at 3:00 pm EST on Sunday and closing at 5:00 pm EST on Friday. This allows active traders to choose the times they want to trade. However, you will soon learn in future lessons the best times to trade and why. In comparison, commodities trading hours are variable based on the specific commodity you are trading. The US stock market, including extended hours, is open for trading between 8:30 am EST to 6:30 pm EST only on weekdays.

Leverage
Depending on your FOREX broker, trading goals, and account size, your leverage can range from 50:1 to 400:1. I definitely do not recommend trading with 400:1 leverage! But, we will get into that later. What this means is at 50:1 leverage, $1,000 can control $50,000 in currency (a simplified example using US dollars of course). Leverage varies in the commodities market (riskier due to low liquidity) and can be as high as 4:1 in the stock market. When I opened my stock market account, my broker only gave me 2:1 leverage.

Costs
Transaction costs are an important factor professional traders take into account when formulating their trading strategy. Transaction costs and brokerage fees in the stock and commodities market can eat up all your profits if not managed correctly. In the FOREX market, most brokers do not charge brokerage fees and your only cost is the difference between the buy and sell price of each currency pair. Again, we will get into that later when I show you how to choose a good broker.

Minimum Investment
A FOREX account can be opened for as little as $250. The minimum to open my stock account was $2,500 with most brokers requiring $5,000.

Noise

Have you ever been faced with so many decisions or possible outcomes that it all mashed together into one big confusion. I call this "noise" and it's why a lot of people lose money in the stock market due to "analysis paralysis." The US market alone has over 40,000 stocks and just over 200 commodity markets. The FOREX market, on the other hand, registers 85% of transactions on 7 major currencies. One final thought...trading in any market can be risky. FOREX is no different even with so many advantages. Understanding the risks and how to minimize them is very important. FOREX still requires training, commitment, discipline and patience. Experience is the best teacher. So get moving and continue reading.

Go to The Profitable Traders website to find out more about our trading strategies.